Re: Forcing query to use an index

From: Michael Nachbaur <mike(at)nachbaur(dot)com>
To: josh(at)agliodbs(dot)com
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Forcing query to use an index
Date: 2003-03-04 01:03:21
Message-ID: 17BEC416-4DDD-11D7-90E0-000A27935D5A@nachbaur.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Monday, Mar 3, 2003, at 15:32 US/Pacific, Josh Berkus wrote:
> Check out the thread: Re: [SQL] OUTER JOIN with filter
> in today's list; this relates to your problem. Then try your query as:

I'll read through this, thank you.

> LEFT OUTER JOIN (SELECT * FROM Customer_Month_Summary
> WHRE CMS.MonthStart = DATE '2003-02-01'
> ) CMS ON C.ID = CMS.CustomerID

This works beautifully! Thanks.

> This set of expressions has "seq scan" written all over it. I hihgly
> suggest
> that you try to find a way to turn these into anchored text searches,
> perhaps
> using functional indexes on lower(column).

Hmm, I'll have to give this one some thought, since it looks like there
won't be any easy way to index those text columns, since the text I'm
searching for could be anywhere within the column.

Thank you everyone for all the help!

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Greg Stark 2003-03-04 01:14:11 Re: Forcing query to use an index
Previous Message Susan Hoddinott 2003-03-04 00:34:19 Database function syntax for inserting records