Re: [GENERAL] Query planner refuses to use index

2005-07-27 Thread Kilian Hagemann
On Friday 22 July 2005 16:17, Tom Lane pondered: > Pre-8.0 tends to underestimate the correlation of a multicolumn index. > (8.0 may too, but not as much.) I actually upgraded to 8.0.3 now and 2 things have changed. Firstly, I don't need to do the annoying casts anymore as the query planner now r

Re: [GENERAL] Query planner refuses to use index

2005-07-27 Thread Kilian Hagemann
On Monday 25 July 2005 15:43, Michael Fuhr pondered: > Whatever the results of your experiments, could you post the settings > you tried and the corresponding EXPLAIN ANALYZE outputs? I did lots of tests now that you pointed me to a useful guide, also taking what's in the documentation into accou

Re: [GENERAL] Query planner refuses to use index

2005-07-25 Thread Michael Fuhr
On Mon, Jul 25, 2005 at 11:23:01AM +0200, Kilian Hagemann wrote: > shared_buffers, effective_cache_size and cpu_index_tuple_cost all have their > default values of 1000, 1000 and 0.001 respectively. From their descriptions > I gather that's reasonable and I don't know how I would optimise these f

Re: [GENERAL] Query planner refuses to use index

2005-07-25 Thread Kilian Hagemann
On Friday 22 July 2005 15:23, Michael Fuhr pondered: > Did you run VACUUM ANALYZE or just ANALYZE? Could we see the output > of VACUUM ANALYZE VERBOSE speed? I just ran a plain ANALYZE then. When I VACUUM ANALYZE the table the (inferior) sequential scan strategy is still chosen over the index sc

Re: [GENERAL] Query planner refuses to use index

2005-07-22 Thread Tom Lane
Kilian Hagemann <[EMAIL PROTECTED]> writes: >> - what version are you running? > 7.4.8, not sure if I'm ready for 8 yet. Pre-8.0 tends to underestimate the correlation of a multicolumn index. (8.0 may too, but not as much.) > Also, note that set_id is strictly increasing (hence correlation of 1)

Re: [GENERAL] Query planner refuses to use index

2005-07-22 Thread Michael Fuhr
On Fri, Jul 22, 2005 at 10:46:39AM +0200, Kilian Hagemann wrote: > > - did you run "VACUUM ANALYZE speed" lately? > > Yes, just before I ran all of the queries in my last email. Did you run VACUUM ANALYZE or just ANALYZE? Could we see the output of VACUUM ANALYZE VERBOSE speed? > Hence I mentio

Re: [GENERAL] Query planner refuses to use index

2005-07-22 Thread Kilian Hagemann
Hi there, Thanks for your and Martijn's comments, I obviously forgot to put in some vital detail: > - You never want to set enable_seq off in production database. That's what I thought... > - did you run "VACUUM ANALYZE speed" lately? Yes, just before I ran all of the queries in my last email

Re: [GENERAL] Query planner refuses to use index

2005-07-21 Thread Janning Vygen
Am Donnerstag, 21. Juli 2005 17:45 schrieb Kilian Hagemann: > Hi there, > > I know this subject has come up before many times, but I'm struggling for > hours with the following problem and none of the posts seem to have a > solution. I have a table with a good 13 million entries with > > station_da

Re: [GENERAL] Query planner refuses to use index

2005-07-21 Thread Martijn van Oosterhout
On Thu, Jul 21, 2005 at 05:45:55PM +0200, Kilian Hagemann wrote: > Hi there, > > I know this subject has come up before many times, but I'm struggling for > hours with the following problem and none of the posts seem to have a > solution. I have a table with a good 13 million entries with Firs