[PERFORM] Query in 9.0.2 not using index in 9.0.0 works fine

2011-07-06 Thread Matthias Howell
I've just copied a database from one linux machine to another. Fast machine is CentOS 5.5, running postgres 9.0.0 64 bit Slow machine is Red Hat 5.5 running postgres 9.0.2 64 bit. Here's the query: explain analyze select sentenceid from sentences where sentenceid = any ( array(select

[PERFORM] GROUP BY with reasonable timings in PLAN but unreasonable execution time

2011-07-06 Thread Clem Dickey
I have a query which seems to be taking an extraordinarily long time (many minutes, at least) when seemingly equivalent queries have different plans and execute in seconds. naturally, I'd like to know why. Version is Postgresql 8.4.8. The table, t, is Column | Type | Modifiers

Re: [PERFORM] Query in 9.0.2 not using index in 9.0.0 works fine

2011-07-06 Thread Samuel Gendler
On Tue, Jul 5, 2011 at 1:50 PM, Matthias Howell matthias.how...@voxco.comwrote: I've just copied a database from one linux machine to another. Fast machine is CentOS 5.5, running postgres 9.0.0 64 bit ** ** Slow machine is Red Hat 5.5 running postgres 9.0.2 64 bit. ** **

Re: [PERFORM] 100% CPU Utilization when we run queries.

2011-07-06 Thread bakkiya
Any help, please? -- View this message in context: http://postgresql.1045698.n5.nabble.com/100-CPU-Utilization-when-we-run-queries-tp4465765p4556775.html Sent from the PostgreSQL - performance mailing list archive at Nabble.com. -- Sent via pgsql-performance mailing list

Re: [PERFORM] Query in 9.0.2 not using index in 9.0.0 works fine

2011-07-06 Thread Matthias Howell
From: Samuel Gendler [mailto:sgend...@ideasculptor.com] Sent: Wednesday, July 06, 2011 3:43 AM To: Matthias Howell Cc: pgsql-performance@postgresql.org Subject: Re: [PERFORM] Query in 9.0.2 not using index in 9.0.0 works fine On Tue, Jul 5, 2011 at 1:50 PM, Matthias Howell

Re: [PERFORM] 100% CPU Utilization when we run queries.

2011-07-06 Thread Tomas Vondra
Dne 6.7.2011 15:30, bakkiya napsal(a): Any help, please? According to the EXPLAIN ANALYZE output (please, don't post it to the mailing list directly - use something like explain.depesz.com, I've done that for you this time: http://explain.depesz.com/s/HMN), you're doing a UNIQUE over a lot of

Re: [PERFORM] Query in 9.0.2 not using index in 9.0.0 works fine

2011-07-06 Thread Samuel Gendler
On Wed, Jul 6, 2011 at 5:50 AM, Matthias Howell matthias.how...@voxco.comwrote: However, in the end, it was user brain damage. ** ** It does use the doc id index for the subquery, but for some reason, the primary key on sentences - the sentenceid - was not set. So in fact, there is

Re: [PERFORM] 100% CPU Utilization when we run queries.

2011-07-06 Thread Scott Marlowe
On Wed, Jul 6, 2011 at 1:04 PM, Tomas Vondra t...@fuzzy.cz wrote: Dne 6.7.2011 15:30, bakkiya napsal(a): Any help, please? According to the EXPLAIN ANALYZE output (please, don't post it to the mailing list directly - use something like explain.depesz.com, I've done that for you this time:

Re: [PERFORM] 100% CPU Utilization when we run queries.

2011-07-06 Thread Craig Ringer
On 7/07/2011 3:04 AM, Tomas Vondra wrote: That is done by sorting the data, and sorting is very CPU intensive task usually. So the fact that the CPU is 100% utilized is kind of expected in this case. So that's a feature, not a bug. In general each process is hitting some bottleneck. It might be