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

Re: Date index not used when selecting a date range

From: Poul Møller Hansen <freebsd(at)pbnet(dot)dk>
To: lists(at)stringsutils(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Date index not used when selecting a date range
Date: 2008-07-29 07:49:36
Message-ID: 488ECB90.9010509@pbnet.dk (view raw or flat)
Thread:
Lists: pgsql-general
> Have you run analyze on the table?
>   
Yes
> How selective is the condition node = '1010101010' and the date range. In
> particular, do you have an idea what percentange of the table fits into
> that date range?
>   
There are around 1000 nodes and there is data for two years, so it must 
be around 1/4000 of all rows
> What about the "type" column? You have it in the index, but not in your
> query. Have you tried adding type to the query? Will that make it more
> selective?
>
>   
Why haven't I tried that ... That did the trick, thanks!

Poul


In response to

pgsql-general by date

Next:From: Asko OjaDate: 2008-07-29 08:35:09
Subject: Re: Clone a database to other machine
Previous:From: Poul Møller HansenDate: 2008-07-29 07:25:10
Subject: Re: Date index not used when selecting a date range

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