Re: PATCH: psql show index with type info

From: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Amos Bird <amosbird(at)gmail(dot)com>, PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PATCH: psql show index with type info
Date: 2017-03-09 05:31:13
Message-ID: CAFjFpRdpcPUv9a1yojHg2pSt4d0GXWrojzUbEoiq9frZ873Yug@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Mar 8, 2017 at 7:00 PM, Stephen Frost <sfrost(at)snowman(dot)net> wrote:
> Ashutosh,
>
> * Ashutosh Bapat (ashutosh(dot)bapat(at)enterprisedb(dot)com) wrote:
>> On Mon, Mar 6, 2017 at 7:54 PM, Amos Bird <amosbird(at)gmail(dot)com> wrote:
>> > Well, the prefix is used to differentiate other \d commands, like
>> > this,
>> >
>> > amos=# \ditv
>> > List of relations
>> > Schema | Name | Type | Owner | Table
>> > --------+--------------------+--------------+-------+---------
>> > public | i | table | amos |
>> > public | ii | index: gist | amos | i
>> > public | j | table | amos |
>> > public | jj | index: gin | amos | i
>> > public | jp | index: btree | amos | i
>> > public | js | index: brin | amos | i
>> > public | numbers | table | amos |
>> > public | numbers_mod2 | index: gin | amos | numbers
>> > public | numbers_mod2_btree | index: btree | amos | numbers
>> > public | ts | table | amos |
>> > (10 rows)
>>
>> The header for this table is "list of relations", so type gets
>> associated with relations indicated type of relation. btree: gin as a
>> type of relation doesn't sound really great.
>
> The type is 'index', we're just adding a sub-type here to clarify the
> kind of index it is.
>
>> Instead we might want to
>> add another column "access method" and specify the access method used
>> for that relation. But then only indexes seem to have access methods
>> per pg_class.h.
>
> Right, I don't think having an extra column which is going to be NULL a
> large amount of the time is good. The approach taken by Amos seems like
> a good one to me, to have the type still be 'index' but with a sub-type
> indicating the access method.

Ok. Seems like a good trade-off.

--
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2017-03-09 05:44:04 Re: Reporting planning time with EXPLAIN
Previous Message Rushabh Lathia 2017-03-09 05:24:51 Re: wait events for disk I/O