dalibo / temboard

PostgreSQL Remote Control
https://labs.dalibo.com/temboard
Other
459 stars 54 forks source link

Maintenance plugin may not list indexes #822

Open pgiraud opened 4 years ago

pgiraud commented 4 years ago

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 commented 4 years ago
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 commented 4 years ago
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.