Index scan?

From: Theo Kramer <theo(at)flame(dot)co(dot)za>
To: hackers(at)postgresql(dot)org
Subject: Index scan?
Date: 1999-08-13 06:32:36
Message-ID: 37B3BC04.490D3187@flame.co.za
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-hackers by date

  From Date Subject
Next Message Ansley, Michael 1999-08-13 08:28:37 Unlimited query strings
Previous Message Tom Ivar Helbekkmo 1999-08-13 06:22:56 Re: [HACKERS] Re: We won!