Re: How much clustered?

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: How much clustered?
Дата
Msg-id 200602241846.k1OIk8725454@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: How much clustered?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: How much clustered?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Tom Lane wrote:
> Carlos Henrique Reimer <carlosreimer@yahoo.com.br> writes:
> >   I would like to know how much clustered is a table related to some index.... How can I discover?
>
> You could do
>     select ctid from mytable order by indexcolumns
> and then do whatever sort of calculation strikes your fancy on the
> sequence of page numbers.  (It's probably fair to ignore the row
> numbers, considering an index to be fully clustered if the page
> reference sequence is perfect.)

Currently we output the ctid as a string:

    snprintf(buf, sizeof(buf), "(%u,%u)", blockNumber, offsetNumber);

Perhaps someday we should consider outputting that as an array or a
result set:

    test=> select x from (select 1, 2) as x;
       x
    -------
     (1,2)
    (1 row)

--
  Bruce Momjian   http://candle.pha.pa.us
  SRA OSS, Inc.   http://www.sraoss.com

  + If your life is a hard drive, Christ can be your backup. +

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

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: Backup file extension
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: ltree + gist index performance degrades significantly over a night