So I'm tidying up and doing docs for the next version of this patch, but
here for comment is the current functionality:

select cap,
       pg_indexam_has_property(a.oid, cap) as "AM",
       pg_index_has_property('onek_hundred'::regclass, cap) as "Index",
       pg_index_column_has_property('onek_hundred'::regclass, 1, cap) as 
"Column"
  from pg_am a,
       unnest(array['asc', 'desc', 'nulls_first', 'nulls_last',
                    'orderable', 'distance_orderable', 'can_order',
                    'can_unique', 'can_multi_col', 'can_exclude',
                    'can_backward', 'can_cluster', 'index_scan',
                    'bitmap_scan', 'can_return', 'search_array',
                    'search_nulls'])
         with ordinality as u(cap,ord)
 where a.amname='btree'
 order by ord;
        cap         | AM | Index | Column 
--------------------+----+-------+--------
 asc                |    |       | t
 desc               |    |       | f
 nulls_first        |    |       | f
 nulls_last         |    |       | t
 orderable          |    |       | t
 distance_orderable |    |       | f
 can_order          | t  | t     | t
 can_unique         | t  | t     | t
 can_multi_col      | t  | t     | t
 can_exclude        | t  | t     | t
 can_backward       |    | t     | t
 can_cluster        |    | t     | t
 index_scan         |    | t     | t
 bitmap_scan        |    | t     | t
 can_return         |    |       | t
 search_array       |    |       | t
 search_nulls       |    |       | t
(17 rows)

This table shows what properties are exposed at the AM-wide level, the
per-index level and the per-column level.

distance_orderable now returns true/false depending on the opclass, not
just on the amcanorderbyop field. In order to do this, I've added an
optional amproperty function to the AM api, which if it exists, gets
first dibs on all property calls so it can override the result as it
sees fit.

can_return likewise reflects the result of index_can_return.

-- 
Andrew (irc:RhodiumToad)


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

Reply via email to