postgresql explain analyze from sql file? I had wrote a long query for postgresql, and I want to use postgresql explain ANALYZE to find out runnig time / parallel workers information about that query.
I can run that sql command by using 

psql -d database -f myquery.sql


but I don't know how to explan/analyze that sql file in command.
and because it is a really long query , it's hard to paste in psql console.
so , is there any other way to run explain/analyze from the sql file ?
You could use cat to create a command you pass to psql. For example like this: 

psql -d database -c "explain analyze $( cat myquery.sql )"


Editing a file and adding those statements at the beginning are an option too.