how to extract the page "address" from the ctid

From: Marc Mamin <M(dot)Mamin(at)intershop(dot)de>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: how to extract the page "address" from the ctid
Date: 2015-06-30 13:56:35
Message-ID: B6F6FD62F2624C4C9916AC0175D56D8828BEBD0E@jenmbs01.ad.intershop.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Hello,

while waiting for the new BRIN and improved GIN Indexes :-)

I'd like to get a rough feeling, how some column's values are distributed on the internal pages.

e.g.:

SELECT c, count(*) FROM
(
SELECT substring(ctid::text, '^.([^,]+)'),
count(distinct myColumn) as c
FROM myTable
GROUP BY substring(ctid::text, '^.([^,]+)')
)foo
GROUP BY c order by 1 desc;

Is there a quicker way to extract the page reference from the ctid?

regards,

Marc Mamin

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jimit Amin 2015-06-30 16:05:37 PgPool Configuration Document required
Previous Message Leonard Boyce 2015-06-30 13:47:40 Hardware question