temboard icon indicating copy to clipboard operation
temboard copied to clipboard

Maintenance plugin may not list indexes

Open pgiraud opened this issue 4 years ago • 2 comments

For a table, in some cases, there are indexes that are not listed. I suspect that this is because they are not using btree.

Capture du 2020-08-24 09-38-18

pgiraud avatar Aug 24 '20 07:08 pgiraud

CREATE TABLE foo (t text);
CREATE INDEX ON foo (t);

After creating this table and index, the table appears in the maintenance pages but no index is listed.

Edit: Apparently an ANALYZE on the table made the index appear.

pgiraud avatar Aug 26 '20 07:08 pgiraud

CREATE TABLE reservation ( room int, during TSRANGE );
INSERT INTO reservation VALUES ( 1108, '[2010-01-01 14:30, 2010-01-01 15:30)' );
CREATE INDEX reservation_idx ON reservation USING gist (during);
set enable_seqscan=off;
explain select * from reservation where during @> '[now,now]'::tsrange;

This index does not appear in the list even after an analyze.

pgiraud avatar Aug 26 '20 07:08 pgiraud