Re: [GENERAL] [9.2devel] why it doesn't do index scan only?

2011-10-08 Thread Pavel Stehule
2011/10/8 Thom Brown : > On 8 October 2011 21:13, Pavel Stehule wrote: >> 2011/10/8 Thom Brown : >>> On 8 October 2011 19:47, Pavel Stehule wrote: >> I did it. It is strange, so your times are significantly slower than I >> have. Have you enabled asserts? > > The table contains 15

Re: [GENERAL] Trigger/Query Warnings

2011-10-08 Thread David Johnston
On Oct 8, 2011, at 21:45, Jake Stride wrote: > Hi, > > I've been staring at this for hours and was hoping somebody could > point me in the right direction. > > I have a trigger setup on a table to update some values based on the > values being inserted/updated and keep getting warning messages

[GENERAL] Trigger/Query Warnings

2011-10-08 Thread Jake Stride
Hi, I've been staring at this for hours and was hoping somebody could point me in the right direction. I have a trigger setup on a table to update some values based on the values being inserted/updated and keep getting warning messages in the logs, even tho this query has the desired effect and t

Re: [GENERAL] [9.2devel] why it doesn't do index scan only?

2011-10-08 Thread Pavel Stehule
2011/10/8 Thom Brown : > On 8 October 2011 19:47, Pavel Stehule wrote: I did it. It is strange, so your times are significantly slower than I have. Have you enabled asserts? >>> >>> The table contains 15 million rows with column values randomly >>> selected from the 1-350 range, with 60%

Re: [GENERAL] How to add xml data to table

2011-10-08 Thread Francisco Figueiredo Jr.
I think this approach is much better as you can solve everything on server itself. About your question on http request I don't know. Sorry for that. :( Maybe there is a module for Postgresql which can enable you to make http calls? On Sat, Oct 8, 2011 at 17:15, Andrus wrote: > Thank you. > I g

Re: [GENERAL] [9.2devel] why it doesn't do index scan only?

2011-10-08 Thread Thom Brown
On 8 October 2011 21:13, Pavel Stehule wrote: > 2011/10/8 Thom Brown : >> On 8 October 2011 19:47, Pavel Stehule wrote: > I did it. It is strange, so your times are significantly slower than I > have. Have you enabled asserts? The table contains 15 million rows with column value

Re: [GENERAL] [9.2devel] why it doesn't do index scan only?

2011-10-08 Thread Thom Brown
On 8 October 2011 19:47, Pavel Stehule wrote: >>> I did it. It is strange, so your times are significantly slower than I >>> have. Have you enabled asserts? >> >> The table contains 15 million rows with column values randomly >> selected from the 1-350 range, with 60% within the 1-50 range, and >>

Re: [GENERAL] [9.2devel] why it doesn't do index scan only?

2011-10-08 Thread Pavel Stehule
>> I did it. It is strange, so your times are significantly slower than I >> have. Have you enabled asserts? > > The table contains 15 million rows with column values randomly > selected from the 1-350 range, with 60% within the 1-50 range, and > asserts are enabled. > Now I repeated tests on litl

Re: [GENERAL] [9.2devel] why it doesn't do index scan only?

2011-10-08 Thread Thom Brown
On 8 October 2011 19:30, Pavel Stehule wrote: > 2011/10/8 Thom Brown : >> On 8 October 2011 18:53, Pavel Stehule wrote: >>> Hello >>> >>> 2011/10/8 Tom Lane : hubert depesz lubaczewski writes: > it is selecting 20 rows out of 30 million. why is it: > 1. not using index only scan >>>

Re: [GENERAL] How to add xml data to table

2011-10-08 Thread Francisco Figueiredo Jr.
I think your best bet would be to go with XmlReader as it provides a fast read only parsing of the document. >From MS doc about linq to xml: http://msdn.microsoft.com/en-us/library/bb387048.aspx "XmlReader is a fast, forward-only, non-caching parser. LINQ to XML is implemented on top of XmlReade

Re: [GENERAL] [9.2devel] why it doesn't do index scan only?

2011-10-08 Thread Pavel Stehule
2011/10/8 Thom Brown : > On 8 October 2011 18:53, Pavel Stehule wrote: >> Hello >> >> 2011/10/8 Tom Lane : >>> hubert depesz lubaczewski writes: it is selecting 20 rows out of 30 million. why is it: 1. not using index only scan 2. not using even normal index scan? >>> >>> It thinks

Re: [GENERAL] [9.2devel] why it doesn't do index scan only?

2011-10-08 Thread Thom Brown
On 8 October 2011 18:53, Pavel Stehule wrote: > Hello > > 2011/10/8 Tom Lane : >> hubert depesz lubaczewski writes: >>> it is selecting 20 rows out of 30 million. why is it: >>> 1. not using index only scan >>> 2. not using even normal index scan? >> >> It thinks the bitmap scan is cheaper.  Whet

Re: [GENERAL] [9.2devel] why it doesn't do index scan only?

2011-10-08 Thread Pavel Stehule
Hello 2011/10/8 Tom Lane : > hubert depesz lubaczewski writes: >> it is selecting 20 rows out of 30 million. why is it: >> 1. not using index only scan >> 2. not using even normal index scan? > > It thinks the bitmap scan is cheaper.  Whether that's true or not is not > very clear, but nobody is

Re: [GENERAL] [9.2devel] why it doesn't do index scan only?

2011-10-08 Thread pasman pasmański
This beaviour is normal. Bitmap index scan is faster than index scan. 2011/10/8, hubert depesz lubaczewski : > hi > did: > create table test as select i as id, i || ' ' || repeat('depesz', 100) as z > from generate_series(1,3000) i; > create index q on test (id); > vacuum verbose analyze test;

Re: [GENERAL] [9.2devel] why it doesn't do index scan only?

2011-10-08 Thread Tom Lane
I wrote: > hubert depesz lubaczewski writes: >> it is selecting 20 rows out of 30 million. why is it: >> 1. not using index only scan >> 2. not using even normal index scan? > It thinks the bitmap scan is cheaper. No, wait, I take that back --- it can't do a plain indexscan because ScalarArrayOp

Re: [GENERAL] [9.2devel] why it doesn't do index scan only?

2011-10-08 Thread Tom Lane
hubert depesz lubaczewski writes: > it is selecting 20 rows out of 30 million. why is it: > 1. not using index only scan > 2. not using even normal index scan? It thinks the bitmap scan is cheaper. Whether that's true or not is not very clear, but nobody is claiming that the costing of index-onl

[GENERAL] [9.2devel] why it doesn't do index scan only?

2011-10-08 Thread hubert depesz lubaczewski
hi did: create table test as select i as id, i || ' ' || repeat('depesz', 100) as z from generate_series(1,3000) i; create index q on test (id); vacuum verbose analyze test; vacuum verbose analyze test; then I checked that index only scans work: $ explain analyze select id from test order by

Re: [GENERAL] Best PostGIS function for finding the nearest line segment to a given point

2011-10-08 Thread René Fournier
Hi Filip, On 2011-10-08, at 2:26 AM, Filip Rembiałkowski wrote: > Any suggests how to speed it up? Coming from MySQL, I'm brand-new to PostGIS > (and Postgresql FWIW) and all the awesome spatial functions it has. I would > think that maybe selecting a bounding box of rows, and then finding the

Re: [GENERAL] PG 9.1 on Debian Squeeze

2011-10-08 Thread Karsten Hilbert
On Sat, Oct 08, 2011 at 03:54:31PM +0100, Raymond O'Donnell wrote: Oh, wait, you said Squeeze - which doesn't have: > Thanks everyone - I installed dpkg-dev, and it now produces a > different message: > > rod@simecom:~$ psql -U postgres -h localhost > DEB_HOST_MULTIARCH is not a supported variab

Re: [GENERAL] PG 9.1 on Debian Squeeze

2011-10-08 Thread Raymond O'Donnell
On 08/10/2011 13:03, Stephen Frost wrote: > * Karsten Hilbert (karsten.hilb...@gmx.net) wrote: >> apt-get install dpkg-dev >> >> should fix what you are seeing. The question remains whether >> postgresql-client(-common) should "Depends:" from dpkg-dev -- >> this should be "reportbug postgresql-c

Re: [GENERAL] Installation woes via Macports on Mac OS X 10.7

2011-10-08 Thread Neil Tiffin
On Oct 8, 2011, at 1:01 AM, Tom Lane wrote: > =?iso-8859-1?Q?Ren=E9_Fournier?= writes: >> I've tried installation 8.4 and 9.0 on two different machines, and at the >> end can't start Postgresql. Here's the basic story: > > No, you started it all right, because it's there in the ps output: > >

Re: [GENERAL] PG 9.1 on Debian Squeeze

2011-10-08 Thread Stephen Frost
* Karsten Hilbert (karsten.hilb...@gmx.net) wrote: > apt-get install dpkg-dev > > should fix what you are seeing. The question remains whether > postgresql-client(-common) should "Depends:" from dpkg-dev > -- this should be "reportbug postgresql-client"ed. I believe Martin has just put toge

Re: [GENERAL] PG 9.1 on Debian Squeeze

2011-10-08 Thread Karsten Hilbert
On Sat, Oct 08, 2011 at 12:19:22PM +0100, Raymond O'Donnell wrote: > I'm not sure if this is the correct place for this, but here goes: I've > just installed Postgres 9.1.1 from backports.debian.org on a fresh > installation of Debian Squeeze, and when I run psql here's what I get: > > rod@simeco

Re: [GENERAL] PG 9.1 on Debian Squeeze

2011-10-08 Thread Jens Wilke
On Samstag, 8. Oktober 2011, Raymond O'Donnell wrote: Hi, > rod@simecom:~$ psql -U postgres -h localhost > Can't exec "dpkg-architecture": No such file or directory at dpkg-architecture is missing. This file is provided by the package dpkg-dev. Regards, Jens -- Sent via pgsql-general mailing

[GENERAL] PG 9.1 on Debian Squeeze

2011-10-08 Thread Raymond O'Donnell
Hello all, I'm not sure if this is the correct place for this, but here goes: I've just installed Postgres 9.1.1 from backports.debian.org on a fresh installation of Debian Squeeze, and when I run psql here's what I get: rod@simecom:~$ psql -U postgres -h localhost Can't exec "dpkg-architecture":

Re: [GENERAL] Best PostGIS function for finding the nearest line segment to a given point

2011-10-08 Thread Filip Rembiałkowski
2011/10/8 René Fournier > Wow, have to say, I love Postgresql and PostGIS. Just awesome. > > So I have a table with ~400,000 rows, each representing a road or street > (multi line segment). I want to select the row whose line segment is closest > the a given point. The following query... > > gc3=

[GENERAL] Best PostGIS function for finding the nearest line segment to a given point

2011-10-08 Thread René Fournier
Wow, have to say, I love Postgresql and PostGIS. Just awesome. So I have a table with ~400,000 rows, each representing a road or street (multi line segment). I want to select the row whose line segment is closest the a given point. The following query... gc3=# SELECT r_stname_c, r_placenam, ST