I believe the PostgreSQL optimizer is fooled by many ORs and switches
to sequential scans: it cannot estimate properly the quantity of
results that will be returned.
Try it in one go, as
$sql = "SELECT notam_id, TO_CHAR(full_issue_date, 'DD-MON-YYYY
The optimizer should (I think) like this better and use the indices,
without requiring that you iterate the queries from the frontend.
As I am trying to learn these things too, I will appreciate knowing
about the result of your tests: please keep me posted.
In response to
pgsql-sql by date
|Next:||From: Kate Collins||Date: 2000-05-18 20:19:02|
|Subject: Re: SQL command speed|
|Previous:||From: Robert B. Easter||Date: 2000-05-18 19:27:56|
|Subject: Re: Novice Help Needed|