Re: Question about indexes

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Question about indexes
Дата
Msg-id 18092.1075301951@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Question about indexes  (Greg Stark <gsstark@mit.edu>)
Ответы Re: Question about indexes  ("Simon Riggs" <simon@2ndquadrant.com>)
Список pgsql-hackers
Greg Stark <gsstark@mit.edu> writes:
> Tom Lane <tgl@sss.pgh.pa.us> writes:
>> What sort?  

> To build the in-memory bitmap you effectively have to do a sort.

Hm, you're thinking that the operation of inserting a bit into a bitmap
has to be at least O(log N).  Seems to me that that depends on the data
structure you use.  In principle it could be O(1), if you use a true
bitmap (linear array) -- just index and set the bit.  You might be right
that practical data structures would be O(log N), but I'm not totally
convinced.

> If the tuples come out of the index in heap order then you can combine
> them without having to go through that step.

But considering the restrictions implied by that assumption --- no range
scans, no non-btree indexes --- I doubt we will take the trouble to
implement that variant.  We'll want to do the generalized bitmap code
anyway.

In any case, this discussion is predicated on the assumption that the
operations involving the bitmap are a significant fraction of the total
time, which I think is quite uncertain.  Until we build it and profile
it, we won't know that.
        regards, tom lane


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

Предыдущее
От: "Simon Riggs"
Дата:
Сообщение: Re: Write cache
Следующее
От: Greg Stark
Дата:
Сообщение: Re: Write cache