PostgreSQL – Generate Explain Plan

You can view the explain plan of any query by prefixing the query with EXPLAIN keyword as shown below:

EXPLAIN SELECT * from table1;
See also  PostgreSQL - Count distinct over multiple columns