Re: pageinspect: Hash index support

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>
Cc: Mithun Cy <mithun(dot)cy(at)enterprisedb(dot)com>, Jesper Pedersen <jesper(dot)pedersen(at)redhat(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pageinspect: Hash index support
Date: 2017-02-01 18:06:25
Message-ID: CA+TgmoaTRh4B75CguW=pWLjJ=LLBBH-=Anz6pcPFn5jx_VQPQQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Jan 28, 2017 at 9:09 PM, Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com> wrote:
> okay. Thanks. I have done changes on top of this patch.

+ ptr = (char *) itup + IndexInfoFindDataOffset(itup->t_info);
+ Assert(ptr <= uargs->page + BLCKSZ);

I think this should be promoted to an ereport(); these functions can
accept an arbitrary bytea.

+ if (opaque->hasho_flag & LH_BUCKET_PAGE)
+ stat->hasho_prevblkno = InvalidBlockNumber;
+ else
+ stat->hasho_prevblkno = opaque->hasho_prevblkno;

I think we should return the raw value here. Mithun's patch to cache
the metapage hasn't gone in yet, but even if it does, let's assume
anyone using contrib/pageinspect wants to see the data that's
physically present, not our gloss on it.

Other than that, I don't think I have any other comments on this. The
tests that got added look a little verbose to me (do we really need to
check pages 1-4 separately in each case when they're all hash pages?
if hash_bitmap_info rejects one, surely it will reject the others) but
I'm not going to fight too hard if Peter wants it that way.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2017-02-01 18:08:50 Re: [COMMITTERS] pgsql: Make psql's \set display variables in alphabetical order.
Previous Message Tom Lane 2017-02-01 17:59:36 Re: [COMMITTERS] pgsql: Make psql's \set display variables in alphabetical order.