Skip to content

Instantly share code, notes, and snippets.

@Madusudanan
Last active May 10, 2016 04:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Madusudanan/333e6662b7b78220c6292d575aaf091d to your computer and use it in GitHub Desktop.
Save Madusudanan/333e6662b7b78220c6292d575aaf091d to your computer and use it in GitHub Desktop.
Postgres Query plan for a sequential scan #1
performance_test=# explain (analyze,buffers) select count(*) from users;
QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------
Aggregate (cost=48214.95..48214.96 rows=1 width=0) (actual time=3874.445..3874.445 rows=1 loops=1)
Buffers: shared read=35715
-> Seq Scan on users (cost=0.00..45714.96 rows=999996 width=0) (actual time=6.024..3526.606 rows=1000000 loops=1)
Buffers: shared read=35715
Planning time: 0.114 ms
Execution time: 3874.509 ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment