Re: Index Analysis: Filters - Mailing list pgsql-general

From Thomas F.O'Connell
Subject Re: Index Analysis: Filters
Date
Msg-id 9B328500-1288-11D9-8537-000D93AE0944@sitening.com
Whole thread Raw
In response to Re: Index Analysis: Filters  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Yeah, I suppose this would be faster than the EXTRACT technique, too,
eh? Because it requires only a single index and is not an index on an
expression, which are generally more expensive?

-tfo

On Sep 29, 2004, at 6:59 PM, Tom Lane wrote:

> "Thomas F.O'Connell" <tfo@sitening.com> writes:
>> Here's what I've got:
>> WHERE some_date LIKE '<year>-<month>%' *
>
> Seems like you'd be better off turning this into a range query.  A
> textual LIKE is just about the most inefficient way of testing a date
> range that I can think of.  How about
>
> WHERE some_date >= 'year-month-01'::date AND some_date <
> ('year-month-01'::date + '1 month'::interval)::date
>
> (adjust as appropriate if it's really a timestamp column).
>
>             regards, tom lane


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: 7.3.4 vacuum/analyze error
Next
From: "Ed L."
Date:
Subject: Re: 7.3.4 vacuum/analyze error