Re: Getting all entries in a single block with ctid

Поиск
Список
Период
Сортировка
От Tomas Vondra
Тема Re: Getting all entries in a single block with ctid
Дата
Msg-id a350535cc6bb6b2cd3ac99fe49d2a400.squirrel@sq.gransy.com
обсуждение исходный текст
Ответ на Re: Getting all entries in a single block with ctid  (Tore Halvorsen <tore.halvorsen@gmail.com>)
Ответы Re: Getting all entries in a single block with ctid  (Tore Halvorsen <tore.halvorsen@gmail.com>)
Список pgsql-general
On 16 Leden 2012, 17:15, Tore Halvorsen wrote:
> On Mon, Jan 16, 2012 at 4:08 PM, Tomas Vondra <tv@fuzzy.cz> wrote:
>
>> The only other solution is to check all possible items on the page.
>> There
>> may be up to 291 items (although it depends on block size and
>> architecture, see MaxHeapTuplesPerPage in access/htup.h).
>>
>> Nice to know.
>
>
>> Something like this should work
>>
>>  ctid = '(123,0)'::tid OR ctid = '(123,1)'::tid OR ctid = '(123,2)'::tid
>> OR ... OR ctid = '(123,290)'::tid
>>
>
> Yeah, that works, but it's kinda impractical... I'm mostly trying to
> figure
> out how fragmented a table is,
> by checking how must the blocks are shared - so that the worst one can be
> scheduled for clustering...

What about pgstattuple?

http://www.postgresql.org/docs/9.1/interactive/pgstattuple.html

Maybe it already does what you're trying to implement ...

Look at pageinspect module too

http://www.postgresql.org/docs/9.1/interactive/pageinspect.html

You're trying to do a quite low-level thing, so maybe this approach would
be more appropriate.

Tomas


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

Предыдущее
От: Evert Koks
Дата:
Сообщение: postgres Windows distribution - openssl support
Следующее
От: Dennis Runz
Дата:
Сообщение: 2D array aggregation performance (array_agg for arrays)