Re: [PERFORM] Query times change by orders of magnitude as DB ages

2009-11-22 Thread Sergey Aleynikov
Hello, > * Is there any way I can nail the query planner to a particular query plan, > rather than have it keep changing its mind? All these setting leads to choosing different plans. If you have small number of complex sensitive queires, you can run explain on them with correct settings, then re

[PERFORM] Query times change by orders of magnitude as DB ages

2009-11-22 Thread Richard Neill
Dear All, Thanks for your help earlier with the previous question. I wonder if I might ask another. We have various queries that need to run, of which I'm going to focus on 2, "vox" and "du_report". Both of them are extremely sensitive to the precise values of random_page_cost and seq_pag

Re: [PERFORM] Postgres query completion status?

2009-11-22 Thread Richard Neill
Greg Smith wrote: Richard Neill wrote: Am I missing something though, or is this project dormant, without having released any files? My bad--gave you the wrong url. http://git.postgresql.org/gitweb?p=pg_top.git;a=summary has the project I meant to point you toward. Will try that out...

Re: [PERFORM] Postgres query completion status?

2009-11-22 Thread Richard Neill
Justin Pitts wrote: I don't know if I would call it "terribly" ugly. Its not especially pretty, but it affords the needed degree of twiddling to get the job done. Relying on the clients is fine - if you can. I suspect the vast majority of DBAs would find that notion unthinkable. The usual res

Re: [PERFORM] Postgres query completion status?

2009-11-22 Thread Richard Neill
Thanks very much for your help so far. (it is pretty confusing that the HashAggregate reports ~6M rows, but the sort does 41M rows, but maybe I can not read this). Anyway, I think that if You up the work_mem for this query to 512M, the sort will be in memory, an thus plenty faster. Tried this

Re: [PERFORM] Why is the query not using the index for sorting?

2009-11-22 Thread Jonathan Blitz
Many thanks. I'll give it a try and see what happens. -Original Message- From: Craig Ringer [mailto:cr...@postnewspapers.com.au] Sent: Sunday, November 22, 2009 3:25 PM To: Jonathan Blitz Cc: pgsql-performance@postgresql.org Subject: Re: [PERFORM] Why is the query not using the index for

Re: [PERFORM] Why is the query not using the index for sorting?

2009-11-22 Thread Craig Ringer
On 22/11/2009 8:50 PM, Jonathan Blitz wrote: > I have a table with a number of columns. > > I perform > > Select * > from table > order by a,b > > There is an index on a,b which is clustered (as well as indexes on a and > b alone). > I have issued the cluster and anyalze commands. > > Never

Re: [PERFORM] Why is the query not using the index for sorting?

2009-11-22 Thread Thom Brown
2009/11/22 Jonathan Blitz > I have a table with a number of columns. > > I perform > > Select * > from table > order by a,b > > There is an index on a,b which is clustered (as well as indexes on a and b > alone). > I have issued the cluster and anyalze commands. > > Nevertheless, PostgreSQL perf

[PERFORM] Why is the query not using the index for sorting?

2009-11-22 Thread Jonathan Blitz
I have a table with a number of columns. I perform Select * from table order by a,b There is an index on a,b which is clustered (as well as indexes on a and b alone). I have issued the cluster and anyalze commands. Nevertheless, PostgreSQL performs a Sequential Scan on the table and then

Re: [PERFORM] Performance degrade running on multicore computer

2009-11-22 Thread afancy
Hi, I am using the PostgreSQL 8.4. What is the code path? After a row is inserted to the table, it will update the fields of "validfrom", and "validto". Followings are the table structure, data, and the performance data: xiliu=# \d page Table "pyetlexa.page" Column |

Re: [PERFORM] sub-select makes query take too long - unusable

2009-11-22 Thread Sergey Aleynikov
Hello, SubPlan 2 -> Seq Scan on item_price (cost=0.00..423.30 rows=1 width=8) (actual time=1.914..1.914 rows=0 loops=10669) Filter: ((item_id = $1) AND (zone_id = 'OUsEaRcAA3jQrg42WHUm8A'::bpchar) AND (price_type = 0) AND ((size_name)::text = ($2)::text)) This means that, for ever