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

Re: Increasing select max(datecol) from bilkaib where datecol<=date'2008-11-01' and (cr='00' or db='00') speed

From: Matthew Wakeling <matthew(at)flymine(dot)org>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Increasing select max(datecol) from bilkaib where datecol<=date'2008-11-01' and (cr='00' or db='00') speed
Date: 2008-11-12 17:26:14
Message-ID: alpine.DEB.1.10.0811121723560.4666@aragorn.flymine.org (view raw or flat)
Thread:
Lists: pgsql-performance
Firstly, please upgrade to Postgres 8.3 if possible.

On Wed, 12 Nov 2008, Andrus wrote:
> There are columns
> kuupaev date,  cr char(10), db char(10)
> and regular indexes  for all those fields.

Create a single index on (cr, db, datecol).

Matthew

-- 
Those who do not understand Unix are condemned to reinvent it, poorly.
                -- Henry Spencer

In response to

pgsql-performance by date

Next:From: Vladimir SitnikovDate: 2008-11-12 17:28:53
Subject: Re: Increasing select max(datecol) from bilkaib where datecol<=date'2008-11-01' and (cr='00' or db='00') speed
Previous:From: fireroxDate: 2008-11-12 17:25:59
Subject: Re: slow full table update

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