Re: The cost of visibillity testing? (gin-search)

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: The cost of visibillity testing? (gin-search)
Дата
Msg-id 4D110167.9010006@enterprisedb.com
обсуждение исходный текст
Ответ на The cost of visibillity testing? (gin-search)  (Jesper Krogh <jesper@krogh.cc>)
Ответы Re: The cost of visibillity testing? (gin-search)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 21.12.2010 21:25, Jesper Krogh wrote:
> The first query should have the cost of the GIN-search +
> visibillity-test of 158K tuples,
> the latter should have the cost of visibillity-testing 168K tuples. If
> we set the cost
> of actually searching GIN to 0 then the gin-search - visibillity costs:
> 95/158000 0.000373ms/tuple
> where the seq-scan case costs close to 0.001ms/tuple (close to 3 times
> as much).
>
> So I have a strong feeling that GIN is cheating on the visibillity tests
> otherwise I have problems imagining how it ever can become faster to
> execute
> than the seq_scan of the table.
>
> Or is a Bitmap Heap Scan simply 3 times faster than a Seq-scan for
> visibillity-testing?

It certainly shouldn't be.

> What have I missed in the logic?

Perhaps you have a lot of empty space or dead tuples that don't match 
the query in the table, which the sequential scan has to grovel through, 
but the bitmap scan skips? What does EXPLAIN ANALYZE of both queries say?

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


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

Предыдущее
От: Eric Ridge
Дата:
Сообщение: Re: bug in SignalSomeChildren
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: bug in SignalSomeChildren