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

Re: Query composite index range in an efficient way

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: Havasvölgyi Ottó <havasvolgyi(dot)otto(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Query composite index range in an efficient way
Date: 2009-02-17 15:53:39
Message-ID: 3289.1234886019@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
Gregory Stark <stark(at)enterprisedb(dot)com> writes:
> Havasvlgyi Ott <havasvolgyi(dot)otto(at)gmail(dot)com> writes:
>> I also tried Row constructors with a Between expression, but in this case
>> Postgres handled the elements of the row independently, and this led to
>> false query result.

> What version of Postgres is this? row constructors were fixed a long time ago
> to not do that and the main benefit of that was precisely that this type of
> expression could use a multi-column index effectively.

That depends on whether you think 8.2 is "a long time ago" ;-).  But
yeah, row comparisons in a modern Postgres version are the way to handle
this.

			regards, tom lane

In response to

pgsql-performance by date

Next:From: Kevin GrittnerDate: 2009-02-17 16:16:13
Subject: Re: Query composite index range in an efficient way
Previous:From: Jörg KiegelandDate: 2009-02-17 14:33:40
Subject: Cannot interpret EXPLAIN

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