EXPLAIN ANALYZE SELECT * FROM x;
===CREATE OR DROP INDEX===
If the dbase is large or you just need things to run faster, add an index to your key fields.
CREATE UNIQUE INDEX title_idx ON films (title);
CREATE INDEX title_idx ON films (title);
DROP INDEX title_idx;
See https://www.postgresql.org/docs/9.5/static/sql-createindex.html for more options
==Perl Functions==