Re: Forcing the use of particular execution plans

From: "Tim Truman" <tim(at)advam(dot)com>
To: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Forcing the use of particular execution plans
Date: 2006-10-03 06:51:01
Message-ID: 000001c6e6b8$4a696570$0340050a@sdg
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance


Thanks Tom
The time difference did distract me from the issue. Switching Seq Scan to
off reduced the runtime greatly, so I am now adjusting the
effective_cache_size, random_page_cost settings to favor indexes over Seq
Scans.

Regards,
Tim

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Tuesday, 3 October 2006 1:50 PM
To: Tim Truman
Cc: 'Dave Dutcher'; pgsql-performance(at)postgresql(dot)org
Subject: Re: [PERFORM] Forcing the use of particular execution plans

"Tim Truman" <tim(at)advam(dot)com> 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
> time=55829.000..55829.000 rows=1 loops=1)"
> ...
> " -> Seq Scan on "transaction" t
> (cost=0.00..87061.04 rows=1630 width=349) (actual time=234.000..55797.000
> rows=200 loops=1)"
> " Filter: ((transaction_date >=
> '2005-01-01'::date) AND (transaction_date <= '2006-09-25'::date) AND
> ((credit_card_no)::text ~~ '4564%549'::text))"

Since that component of the plan was identical in your two original
plans ("desired" and "undesired") it seems pretty clear that you have
not correctly identified what your problem is.

regards, tom lane

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Jérôme BENOIS 2006-10-03 07:36:22 Re: High CPU Load
Previous Message Tom Lane 2006-10-03 04:19:39 Re: Forcing the use of particular execution plans