Re: SQL With Dates

From: Rafael Domiciano <rafael(dot)domiciano(at)gmail(dot)com>
To: Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: SQL With Dates
Date: 2009-04-20 18:48:28
Message-ID: 3a0028490904201148h38fad8b2g671a972d5b5a5cdd@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hello Grzegorz,

Thnks for response, but lot of the selects is using BETWEEN and the cost is
the same.

2009/4/20 Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>

> BETWEEN X AND Y
>
> On Mon, Apr 20, 2009 at 2:55 PM, Rafael Domiciano
> <rafael(dot)domiciano(at)gmail(dot)com> wrote:
> > Hello People,
> >
> > I have initiated a work to review the sqls of our internal software.
> > Lot of them he problem are about sql logic, or join with table
> unecessary,
> > and so on.
> > But software has lot of sql with date, doing thinks like:
> > [..]
> > date >= '2009-04-01' AND
> > date <= '2009-04-15'
> > [..]
> >
> > Redoing the SQL with fix date (date = '2009-04-01') o cost in explain
> always
> > still about 200 or less. But with a period the cost is high, about 6000
> or
> > more.
> >
> > Select is using Index and the date is using index too.
> >
> > There is some way to use date period with less cost?
> >
> > Rafael Domiciano
> >
>
>
>
> --
> GJ
>

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Scott Marlowe 2009-04-20 18:59:12 Re: SQL With Dates
Previous Message Tom Lane 2009-04-20 15:27:00 Re: GiST index performance