Re: ways to force index use? - Mailing list pgsql-performance

From Josh Berkus
Subject Re: ways to force index use?
Date
Msg-id 200310131655.25022.josh@agliodbs.com
Whole thread Raw
In response to ways to force index use?  (Seth Ladd <seth@picklematrix.net>)
List pgsql-performance
Seth,

> The Query: explain analyze select * from path where start = 653873 or
> start = 649967 or stop = 653873 or stop = 649967

you need to cast all those numbers to BIGINT:

select * from path where start = 653873::BIGINT or
start = 649967::BIGINT or stop = 653873::BIGINT or stop = 649967::BIGINT

Then an index on start or stop should be used by the planner.

--
-Josh Berkus
 Aglio Database Solutions
 San Francisco


pgsql-performance by date:

Previous
From: Seth Ladd
Date:
Subject: ways to force index use?
Next
From: Tom Lane
Date:
Subject: Re: ways to force index use?