Anyway to view original query on top of views using postgres For example, I have a simple query:
SELECT * FROM information_schema.columns where table_schema = 'public';

Which turn out very complex, information_schema.columns is a complex view.
Right now, to understand the query, I need to read all the definitions of all the views involved.
Is there any way to &quot;expand&quot; query and make it easier to read side by side with query plan output?
You can use EXPLAIN (ANALYZE, BUFFERS) on the query, which will show what is really executed on the base tables. That allows you to understand where the slowness is and what causes it. This works for catalog tables just as well as for other tables.