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

Поиск
Список
Период
Сортировка
От Gellert, Andre
Тема Mistake in my query or Index Scan on subquery failure? (7.4)
Дата
Msg-id 2740724BDE77EC4CB3CF41EA2227845730B077@NT-VISEXCH
обсуждение исходный текст
Ответы Re: Mistake in my query or Index Scan on subquery failure?  (Nick Barr <nicky@chuckie.co.uk>)
Re: Mistake in my query or Index Scan on subquery failure? (7.4)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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

В списке pgsql-general по дате отправления:

Предыдущее
От: Paulovič Michal
Дата:
Сообщение: Re: Moving from MySQL to PGSQL....some questions (multilevel
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: Moving from MySQL to PGSQL....some questions (multilevel