Index scan? - Mailing list pgsql-hackers

From Theo Kramer
Subject Index scan?
Date
Msg-id 37B3BC04.490D3187@flame.co.za
Whole thread Raw
Responses Re: [HACKERS] Index scan?
List pgsql-hackers
Hi

Does anyone know why the following occurs?
 coza=> explain select * from accounts where domain >= '%' order by domain; NOTICE:  QUERY PLAN:
 Index Scan using domain_idx on accounts  (cost=1434.50 rows=19611 width=106)

and
 coza=> explain select * from accounts order by domain; NOTICE:  QUERY PLAN:
 Sort  (cost=3068.39 rows=58830 width=106)   ->  Seq Scan on accounts  (cost=3068.39 rows=58830 width=106)

Surely both queries give the same result set, yet the second example does not
use the index causing unnecessary overhead.

I am running version 6.5 (haven't upgraded to 6.5.1 as yet)

--------
Regards
Theo


pgsql-hackers by date:

Previous
From: Tom Ivar Helbekkmo
Date:
Subject: Re: [HACKERS] Re: We won!
Next
From: "Hub.Org News Admin"
Date:
Subject: ...