psql -h localhost -U pony pg_guts \timing SELECT * FROM projects WHERE id = 1337; SELECT * FROM projects WHERE name = 'Manhattan'; EXPLAIN SELECT * FROM projects WHERE name = 'Manhattan'; CREATE INDEX projects_name ON projects(name); EXPLAIN SELECT * FROM projects WHERE name = 'Manhattan'; SELECT * FROM projects WHERE name = 'Manhattan'; SELECT COUNT(*) FROM projects WHERE priority = 'low'; CREATE INDEX projects_priority ON projects(priority); SELECT COUNT(*) FROM projects WHERE priority = 'low'; EXPLAIN SELECT COUNT(*) FROM projects WHERE priority = 'low'; SELECT DISTINCT priority FROM projects; EXPLAIN SELECT * FROM projects WHERE priority = 'low' AND created_at > '2016-01-29'; CREATE INDEX projects_priority_created_at ON projects(priority, created_at); EXPLAIN SELECT * FROM projects WHERE priority = 'low' AND created_at > '2016-01-29'; SELECT * FROM projects WHERE priority = 'low' AND created_at > '2016-01-29'; EXPLAIN SELECT * FROM projects WHERE priority = 'low' AND created_at > '2016-01-29'; SELECT * FROM projects WHERE priority = 'low' AND created_at > '2016-01-29'; EXPLAIN SELECT * FROM projects WHERE priority = 'low'; EXPLAIN SELECT * FROM projects WHERE created_at > '2016-01-29';