Re: [HACKERS] [GENERAL] when are indexes used?

From: Andreas Zeugswetter <andreas(dot)zeugswetter(at)telecom(dot)at>
To: infrared(at)a-b(dot)hu, hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] [GENERAL] when are indexes used?
Date: 1999-09-23 16:47:55
Message-ID: 37EA59BB.47245CD4@telecom.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

1. run:

vacuum auth;

> real problem is with a ~6000 row database and a select * ...
> order by query
> which takes more than 5 sec. The same query runs for less
> than 0.1 sec on mssql
> :-((

No way you select 6000 rows in 0.1 sec with mssql,
that would be 60000 rows/sec.
Maybe you mean the first few rows show in 0.1s, this is possible.

In PostgreSQL the order by alone currently does not use the index.
Try:
select * from auth where uid >= 0 order by uid;

if you only have positive uid's. This should use the index.

Andreas

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-09-23 17:18:18 Re: [SQL] Re: [HACKERS] SELECT DISTINCT question
Previous Message Adriaan Joubert 1999-09-23 16:20:49 Re: [HACKERS] Re: [GENERAL] Update of bitmask type