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?
Re: Mistake in my query or Index Scan on subquery failure? (7.4) |
Список | 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 по дате отправления: