Re: Forcing query to use an index

From: Michael Nachbaur <mike(at)nachbaur(dot)com>
To: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Forcing query to use an index
Date: 2003-03-03 22:32:45
Message-ID: 0E014EA3-4DC8-11D7-90E0-000A27935D5A@nachbaur.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Monday, Mar 3, 2003, at 14:09 US/Pacific, Stephan Szabo wrote:
> If you're hitting all the rows in the table, there's only disadvantage
> to using an indexscan (right now, given the way data is stored). If
> you
> were returning some fraction of the rows postgresql should hopefully
> switch to a different plan (depending on the estimated costs).

I should only ever get one match per record. This is the structure of
the relevant tables:

Customer --> Customer_Month_Summary
^
|
EmailAddress

There is one Customer_Month_Summary record per-customer-per-month, so I
should only get one record out of the database. Additionally, since
there are about 2000 customer records, but multiple months in the
summary table, I'll never use the entire results of the summary table
in one query.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Nachbaur 2003-03-03 22:46:52 Re: Forcing query to use an index
Previous Message Michael Nachbaur 2003-03-03 22:29:29 Re: Forcing query to use an index