We can execute EXPLAIN ANALYZE on a query and on commands like CREATE TABLE but seems like we cannot on a CREATE INDEX.
What is the reason for this? Must one only get statistics about an index only elsewhere?
We can execute EXPLAIN ANALYZE on a query and on commands like CREATE TABLE but seems like we cannot on a CREATE INDEX.
What is the reason for this? Must one only get statistics about an index only elsewhere?
To get the time to create an index, you can do the following:
postgres=# select * from now();
postgres=# create index foo on table(col);
postgres=# select * from now();
Type the last command (select * from now()) while the index is being created, be sure to hit enter and it will run this command as soon as the index creation completes. You'll end up with the timestamp just before and just after index creation.