Re: SELECT * FROM LIMIT 1; is really slow Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: SELECT * FROM LIMIT 1; is really slow
Дата
Msg-id 5089.1085773691@sss.pgh.pa.us
обсуждение исходный текст
Ответ на SELECT * FROM LIMIT 1; is really slow  (David Blasby <dblasby@refractions.net>)
Ответы Re: SELECT * FROM LIMIT 1; is really slow
Список pgsql-hackers
Alvaro Herrera <alvherre@dcc.uchile.cl> writes:
> On Fri, May 28, 2004 at 03:19:29PM -0400, Tom Lane wrote:
>> We'd still need a plain CommandCounterIncrement facility, which means
>> that actually a subtransaction would have to be a group of CIDs not just
>> one.

> Right, this is why I suggested runlength (the group is contiguous).

Not necessarily.

> Right.  We only need to store the "borders" though.  Not even that: only
> the start, because the end is what is current at AbortSubTransaction()
> time.

Nope.  Think about sub-subtransactions.

A runlength encoding might be worth using, though, since you're right
that subxacts would tend to get runs of consecutive CIDs.

In theory we could also use a runlength representation for the master
bitmap of aborted CIDs, but that would be costly since you would have to
do a search, and not just a trivial index, to check the state of a
particular CID.  My inclination would be to stick with a bitmap for now.
It'd be easy enough to revise the implementation later if that gut feel
proves out wrong.
        regards, tom lane


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

Предыдущее
От: pgsql@mohawksoft.com
Дата:
Сообщение: Extended customizing, SQL functions, internal variables, API
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Nested xacts: looking for testers and review