Re: [PERFORM] Identical DB's, different execution plans

2008-09-29 Thread Doug Eck
Tom, You nailed it. The t1 table was using 9600 relpages versus 410 after the vacuum full. The two databases are now showing similar execution plans and times. Thanks for your help. It is greatly appreciated. Doug Eck - Original Message From: Tom Lane <[EMAIL PROTECTED]> To: Dou

Re: [PERFORM] Identical DB's, different execution plans

2008-09-29 Thread Tom Lane
Doug Eck <[EMAIL PROTECTED]> writes: > The new plan from the slower db: >-> Index Scan using t1_uc2 on t1 (cost=0.00..25604.74 rows=204906 > width=32) (actual time=0.061..327.285 rows=8438 loops=1) > Filter: active This seems a bit fishy. In the first place, with such a simple fi

Re: [PERFORM] Identical DB's, different execution plans

2008-09-29 Thread Doug Eck
Setting enable_nestloop = off did result in a hash join, so I also set enable_hashjoin = off. The new plan from the slower db: QUERY PLAN -

Re: [PERFORM] Identical DB's, different execution plans

2008-09-29 Thread Tom Lane
Doug Eck <[EMAIL PROTECTED]> writes: > Any ideas as to what could the first db to opt for the slower subquery rather > than the merge? Not from the information given. Presumably db1 thinks that the mergejoin plan would be slower, but why it thinks that isn't clear yet. Try setting enable_nestloo

[PERFORM] Identical DB's, different execution plans

2008-09-29 Thread Doug Eck
I have two identical databases that run the same query each morning. Starting this morning, something caused the first db to start using a different execution plan for the query, resulting in much worse performance. I've have tried several things this morning, but I am currently stumped on wha

[PERFORM] dedicated server & postgresql 8.1 conf tunning

2008-09-29 Thread paul
Hello I'm running pgsql 8.1.11 (from debian stable) on a server with 16GB RAM (Linux helios 2.6.18-6-amd64 #1 SMP Tue Aug 19 04:30:56 UTC 2008 x86_64 GNU/Linux). I have a table "tickets" with 1 000 000 insert by month ( ~2600 each 2hours ) (for the moment 1300 rows for 5GB ) and i have to extr

Re: [PERFORM] CPU load

2008-09-29 Thread Albe Laurenz
kiki wrote: > I expanded work_mem to 256 Mb and created index on table > > create index xxx on system_alarm (id_camera, date, time) where confirmed = > 'false' and dismissed = 'false'; That index is not used for the query (as could be expected). You better remove it. > the processor load now exe

Re: [PERFORM] CPU load

2008-09-29 Thread kiki
> kiki wrote: >> The speed of the query is not a problem but the strange thing is the >> processor load with postmaster when the query is executed. >> I don’t now how to reduce processor load. > > Did you try without the ORDER BY? > Where are the execution plans? > > Yours, > Laurenz Albe > I expa

Re: [PERFORM] CPU load

2008-09-29 Thread Albe Laurenz
kiki wrote: > The speed of the query is not a problem but the strange thing is the > processor load with postmaster when the query is executed. > I don’t now how to reduce processor load. Did you try without the ORDER BY? Where are the execution plans? Yours, Laurenz Albe -- Sent via pgsql-perf

Re: [PERFORM] CPU load

2008-09-29 Thread Albe Laurenz
Please try to avoid top-posting where inappropriate. kiki wrote: >>> There is still heavy load of postmaster process (up to 100%) for a simple >>> query >>> >>> EXPLAIN ANALYSE SELECT * FROM system_alarm WHERE id_camera='3' AND >>> confirmed='false' AND dismissed='false' ORDER BY date DESC, time

Re: [PERFORM] CPU load

2008-09-29 Thread hubert depesz lubaczewski
On Mon, Sep 29, 2008 at 10:29:45AM +0200, [EMAIL PROTECTED] wrote: > >> EXPLAIN ANALYSE SELECT * FROM system_alarm WHERE id_camera='3' AND > >> confirmed='false' AND dismissed='false' ORDER BY date DESC, time DESC > >> LIMIT 1; > Sorry, without LIMIT returns around 70 rows. > Tried to index da

Re: [PERFORM] CPU load

2008-09-29 Thread kiki
Hello Herald, the queried table is used for communication between server application and web user interface. When application detects an event it writes it down in table. The web client checks every 10 second if something new is written in the table. Usually nothing new is written but the client h

Re: [PERFORM] CPU load

2008-09-29 Thread kiki
Sorry, without LIMIT returns around 70 rows. Tried to index date column and time column but the performance is pretty much the same. Everything is OK, I just don’t understand way is this query burdening the processor so much. Regards, Maja > kiki wrote: >> First I have increased shared_buffer

Re: [PERFORM] CPU load

2008-09-29 Thread Albe Laurenz
kiki wrote: > First I have increased shared_buffers from 2000 to 8000. Since the > postgresql is on Debian I had to increase SHMMAX kernel value. > Everything is working much faster now. Good to hear that the problem is gone. > There is still heavy load of postmaster process (up to 100%) for a si

Re: [PERFORM] CPU load

2008-09-29 Thread Harald Armin Massa
Hello Maja, > EXPLAIN ANALYSE SELECT * FROM system_alarm WHERE id_camera='3' AND > confirmed='false' AND dismissed='false' ORDER BY date DESC, time DESC > LIMIT 1; > > (the table is indexed by id_camera, has around 1 milion rows, and this > query returns around 70 rows and is executed (EXPLAI

Re: [PERFORM] CPU load

2008-09-29 Thread kiki
Thanks’ for the instructions for detecting the problem. It helped a lot. First I have increased shared_buffers from 2000 to 8000. Since the postgresql is on Debian I had to increase SHMMAX kernel value. Everything is working much faster now. There is still heavy load of postmaster process (up to 1