Re: [PERFORM] Forcing the use of particular execution plans

2006-10-03 Thread Jim C. Nasby
Adding -performance back in. On Tue, Oct 03, 2006 at 05:10:04PM -0700, Ron Mayer wrote: > Jim C. Nasby wrote: > > > > Index scans are also pretty picky about correlation. If you have really > > low correlation you don't want to index scan, > > I'm still don't think "correlation" is the right met

Re: [PERFORM] Forcing the use of particular execution plans

2006-10-03 Thread Ron Mayer
Jim C. Nasby wrote: > > Index scans are also pretty picky about correlation. If you have really > low correlation you don't want to index scan, I'm still don't think "correlation" is the right metric at all for making this decision. If you have a list of addresses clustered by "zip" the "correla

Re: [PERFORM] Forcing the use of particular execution plans

2006-10-03 Thread Tim Truman
PROTECTED] Sent: Tuesday, 3 October 2006 1:50 PM To: Tim Truman Cc: 'Dave Dutcher'; pgsql-performance@postgresql.org Subject: Re: [PERFORM] Forcing the use of particular execution plans "Tim Truman" <[EMAIL PROTECTED]> writes: > Here is an "explain analyze&q

Re: [PERFORM] Forcing the use of particular execution plans

2006-10-02 Thread Tom Lane
"Tim Truman" <[EMAIL PROTECTED]> writes: > Here is an "explain analyze" for the query that performs slowly, This shows that the planner is exactly correct in thinking that all the runtime is going into the seqscan on transaction: > "Aggregate (cost=88256.32..88256.32 rows=1 width=0) (actual > ti

Re: [PERFORM] Forcing the use of particular execution plans

2006-10-02 Thread Tim Truman
'4564%549'::text))" " -> Hash (cost=20.88..20.88 rows=8 width=282) (actual time=16.000..16.000 rows=0 loops=1)" "-> Seq Scan on merchant m (cost=0.00..20.88 rows=8 width=282) (actual time=0.000..16.000 rows=7 loop

Re: [PERFORM] Forcing the use of particular execution plans

2006-09-27 Thread Jim C. Nasby
On Wed, Sep 27, 2006 at 10:51:26AM -0500, Dave Dutcher wrote: > To make the planner prefer an index scan over a seq scan, I would first > check the statistics again, and then you can try setting enable_seqscan to > false (enable_seqscan is meant more for testing than production) or, you > could try

Re: [PERFORM] Forcing the use of particular execution plans

2006-09-27 Thread Dave Dutcher
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tim Truman > > Hi, > > I have the following query which has been running very slowly > and after a > lot of testing/trial and error I found an execution plan that > ran the query > in a fraction of th

Re: [PERFORM] Forcing the use of particular execution plans

2006-09-27 Thread Jochem van Dieten
Tim Truman wrote: Query: SELECT count(*) as count FROM ( SELECT * FROM transaction t, merchant m WHERE t.merchant_id = m.id AND m.id = 198 AND t.transaction_date >= '20050101' AND t.transaction_date <= '20060925'

[PERFORM] Forcing the use of particular execution plans

2006-09-26 Thread Tim Truman
Hi, I have the following query which has been running very slowly and after a lot of testing/trial and error I found an execution plan that ran the query in a fraction of the time (and then lost the statistics that produced it). What I wish to know is how to force the query to use the faster execu