Skip site navigation (1) Skip section navigation (2)

Re: SQL With Dates

From: Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>
To: Rafael Domiciano <rafael(dot)domiciano(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: SQL With Dates
Date: 2009-04-20 14:14:15
Message-ID: 2f4958ff0904200714x2beda1d2pa0136080e84d15e0@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-performance
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

Responses

pgsql-performance by date

Next:From: Tom LaneDate: 2009-04-20 15:27:00
Subject: Re: GiST index performance
Previous:From: Matthew WakelingDate: 2009-04-20 14:11:08
Subject: Re: GiST index performance

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group