Re: many 'OR' in WHERE-condition

Поиск
Список
Период
Сортировка
От A. Kretschmer
Тема Re: many 'OR' in WHERE-condition
Дата
Msg-id 20070420112930.GE15322@a-kretschmer.de
обсуждение исходный текст
Ответ на Re: many 'OR' in WHERE-condition  (Richard Huxton <dev@archonet.com>)
Ответы Re: many 'OR' in WHERE-condition
Список pgsql-sql
am  Fri, dem 20.04.2007, um 12:03:44 +0100 mailte Richard Huxton folgendes:
> A. Kretschmer wrote:
> >in a SELECT with a condition 'WHERE foo IN (1,2,3,4,...)' with a large
> ...
> >But if the list increase the planner choose an seq-scan. The amount of
> >values in the list is about 200 and the table has about 250.000 rows.
> >
> >How can we avoid the seq-scan?
> 
> Are you sure you'd want to? What plan have you found to be faster with 
> 200 tests?

It's not my problem - i found it in a forum (german)
http://pg-forum.de/showthread.php?t=1332

If the list contains up to 195 entrys -> up to 195 bitmap index scans
and BitmapOr -> 7.839ms

If the list contains 196 entrys -> seq-scan -> 5591.567ms



Andreas
-- 
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net


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

Предыдущее
От: "Bart Degryse"
Дата:
Сообщение: Re: We all are looped on Internet: request + transport = invariant
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: many 'OR' in WHERE-condition