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

Cannot interpret EXPLAIN

From: Jörg Kiegeland <kiegeland(at)ikv(dot)de>
To: pgsql-performance(at)postgresql(dot)org
Subject: Cannot interpret EXPLAIN
Date: 2009-02-17 14:33:40
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance

I have a query  SELECT * FROM myTable WHERE ((myCol = var1) OR (myCol = 

.. which produces the following EXLAIN output:

Index Scan using myIndex on myTable (cost=0.00..8.28 rows=1 width=537)
  Filter: ((myCol = $1) OR (myCol = $2))

The index "myIndex" is an index on column "myCol". However I expected an 
"Index Cond:" row instead of a "Filter:" row, which normally indicates 
performance problems.
Should I rather split the OR and use two SELECT statements to get my 
result (var1!=var2)? Namely in this case, "Index Cond:" is outputed by 

--Jörg Kiegeland

pgsql-performance by date

Next:From: Tom LaneDate: 2009-02-17 15:53:39
Subject: Re: Query composite index range in an efficient way
Previous:From: Rajesh Kumar MallahDate: 2009-02-17 13:25:42
Subject: Re: suggestions for postgresql setup on Dell 2950 , PERC6i controller

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