Mistake in my query or Index Scan on subquery failure? (7.4)

From: "Gellert, Andre" <AGellert(at)ElectronicPartner(dot)de>
To: "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: Mistake in my query or Index Scan on subquery failure? (7.4)
Date: 2004-03-03 17:17:06
Message-ID: 2740724BDE77EC4CB3CF41EA2227845730B077@NT-VISEXCH
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,
I have a problem with this simple query :

explain select * from ref_artikel a where a.artnr in ( 351275 , 351346 ,
293082 ) LIMIT 20 OFFSET 0 ;
QUERY PLAN

----------------------------------------------------------------------------
------------------------------------------------------
Limit (cost=0.00..9.06 rows=3 width=299)
-> Index Scan using ref_artikel_pkey, ref_artikel_pkey, \
ref_artikel_pkey on ref_artikel a (cost=0.00..9.06 rows=3 width=299)
Index Cond: ((artnr = 351275) OR (artnr = 351346) OR (artnr =
293082))
(3 rows)

Is it okay , that the word ref_artikel_pkey will be repeated for each
condition ?

How can i optimize this, i have a number of up to 3000 "artnr" cond. to
check for equality
( and more tables joined over this query which i left away for better
understanding ) ,
is a "(x=1) or (x=2)..." faster than "x in 1,2... " at this large number of
checks ?

Maybe this is the hash-joined bug marked for this 7.4 postgresql....
I consider upgrading to 7.41 on another testing server....

Thx for ideas,
Andre

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2004-03-03 17:48:20 Re: Moving from MySQL to PGSQL....some questions (multilevel
Previous Message Paulovič Michal 2004-03-03 17:12:18 Re: Moving from MySQL to PGSQL....some questions (multilevel