Re: Index Analysis: Filters

From: Thomas F(dot)O'Connell <tfo(at)sitening(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "PgSQL - General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Index Analysis: Filters
Date: 2004-09-30 02:29:51
Message-ID: 9B328500-1288-11D9-8537-000D93AE0944@sitening.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)sitening(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ed L. 2004-09-30 02:33:18 Re: 7.3.4 vacuum/analyze error
Previous Message Michael Mallete 2004-09-30 02:12:39 Fwd: error: unicode characters greater than or equal to 0x10000