pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Kevin Grittner <kgrittn@gmail.com>
Cc: Stephen Frost <sfrost@snowman.net>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers\@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: No longer possible to query catalogs for index capabilities?
Date: Fri, 12 Aug 2016 16:26:07 -0400
Message-ID: <12983.1471033567@sss.pgh.pa.us> (raw)
In-Reply-To: <87y441n4q8.fsf@news-spur.riddles.org.uk>
References: <20160809155623.GA567087@alvherre.pgsql>
	<87y445ap58.fsf@news-spur.riddles.org.uk>
	<87a8gkr8fu.fsf@news-spur.riddles.org.uk>
	<17563.1470843700@sss.pgh.pa.us>
	<8737mcr3vn.fsf@news-spur.riddles.org.uk>
	<30901.1470868017@sss.pgh.pa.us>
	<87fuq9oo12.fsf@news-spur.riddles.org.uk>
	<9594.1471028028@sss.pgh.pa.us>
	<87y441n4q8.fsf@news-spur.riddles.org.uk>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Andrew Gierth <andrew@tao11.riddles.org.uk> writes:
> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:
>  Tom> +1 mostly, but I'm a bit bemused by can_order and can_backward
>  Tom> having different scopes --- how come?

> That's where they were in the previous list, a couple of messages up in
> the thread...

> Currently can_backward is always the same for all indexes in the same
> AM, but I guess there's no guarantee that won't change. In the previous
> message you suggested it might have to be per-column, even, but I think
> that makes no sense (either the whole index is scannable in both
> directions or it is not, it can't be different per column).

OK, fuzzy thinking on my part --- I was conflating amcanbackward with
whether you can get a descending-order scan.  I can imagine an index
type in which some opclasses can produce btree-ordered output and some
can't, in which case "orderable" has to be per-index and maybe even
per-column.  (If, say, the leading column is orderable and the next
is not, then you could expect to produce output that is sorted by
the first column but not by the first two.)  However, the ability to
back up in a scan is entirely independent of that; see the hash AM,
which sets amcanbackward even though its output has no definable order.

Right offhand it's pretty hard to see how amcanbackward wouldn't be
dependent on AM only.  However, we earlier posited that the only AM-level
properties should be those needed to figure out what you can say in CREATE
INDEX, so if we believe that then can_backward is properly positioned.

>  Tom> In particular, I'm not sure what you intend to mean by applying
>  Tom> can_unique at the index or column level.  Is that supposed to mean
>  Tom> that the index or column *is* unique?

> No. (We could add properties like is_unique, is_exclusion which clients
> currently query in pg_index; should we?)

No, I don't feel a need to replace that.  But we need to be clear in the
documentation about what this property actually means.  My objection to
having it answer at the index or column level is basically that that
encourages confusion as to what it means.

			regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (69+ messages)  latest in thread

Message-ID: <12983.1471033567@sss.pgh.pa.us>
Permalink:  ../12983.1471033567@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/12983.1471033567@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andrew@tao11.riddles.org.uk, alvherre@2ndquadrant.com, kgrittn@gmail.com, sfrost@snowman.net, peter.eisentraut@2ndquadrant.com, robertmhaas@gmail.com
  Subject: Re: No longer possible to query catalogs for index capabilities?
  In-Reply-To: <12983.1471033567@sss.pgh.pa.us>
  References: <20160809155623.GA567087@alvherre.pgsql> <87y445ap58.fsf@news-spur.riddles.org.uk> <87a8gkr8fu.fsf@news-spur.riddles.org.uk> <17563.1470843700@sss.pgh.pa.us> <8737mcr3vn.fsf@news-spur.riddles.org.uk> <30901.1470868017@sss.pgh.pa.us> <87fuq9oo12.fsf@news-spur.riddles.org.uk> <9594.1471028028@sss.pgh.pa.us> <87y441n4q8.fsf@news-spur.riddles.org.uk> <12983.1471033567@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox