Re: Query palns and tug-of-war with enable_sort - Mailing list pgsql-general

From Tom Lane
Subject Re: Query palns and tug-of-war with enable_sort
Date
Msg-id 7021.1234971327@sss.pgh.pa.us
Whole thread Raw
In response to Query palns and tug-of-war with enable_sort  (Glyn Astill <glynastill@yahoo.co.uk>)
Responses Re: Query palns and tug-of-war with enable_sort
List pgsql-general
Glyn Astill <glynastill@yahoo.co.uk> writes:
> With enable_sort on this is the plan it chooses:

>  HashAggregate  (cost=14.72..14.73 rows=1 width=9)
>    ->  Nested Loop  (cost=0.00..14.72 rows=1 width=9)
>          ->  Index Scan using credit_index02 on credit  (cost=0.00..7.04 rows=1 width=9)
>                Index Cond: ((date >= '2009-02-16'::date) AND (date <= '2009-02-16'::date))
>                Filter: (((cancelled)::text = ' '::text) AND ((show = 450000::numeric) OR (show = 450
> 001::numeric)))
>          ->  Index Scan using mult_ord_index02 on mult_ord  (cost=0.00..7.67 rows=1 width=17)
>                Index Cond: (mult_ord.transno = credit.transno)

> That's what I want, good. Now with enable_sort off this is the plan it chooses:

>  Group  (cost=0.00..11149194.48 rows=1 width=9)

That's just bizarre.  Can you put together a self-contained test case
for this?  Also, what version is it exactly?  ("8.3" is the wrong
answer.)

            regards, tom lane

pgsql-general by date:

Previous
From: Aurimas Černius
Date:
Subject: Re: connecting using libpq breaks printf
Next
From: Martín Marqués
Date:
Subject: Mammoth replicator