Skip to content

Instantly share code, notes, and snippets.

@felixge
Created January 26, 2020 13:05
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 felixge/d214ec8288bd1aab94d6e325dd5297db to your computer and use it in GitHub Desktop.
Save felixge/d214ec8288bd1aab94d6e325dd5297db to your computer and use it in GitHub Desktop.
postgres=# \timing
Timing is on.
postgres=# SELECT count(*) FROM generate_series(1, 10000);
count
-------
10000
(1 row)
Time: 2.587 ms
postgres=# EXPLAIN ANALYZE SELECT count(*) FROM generate_series(1, 10000);
QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------------
Aggregate (cost=12.50..12.51 rows=1 width=8) (actual time=156.107..156.119 rows=1 loops=1)
-> Function Scan on generate_series (cost=0.00..10.00 rows=1000 width=0) (actual time=2.168..78.817 rows=10000 loops=1)
Planning Time: 0.054 ms
Execution Time: 156.306 ms
(4 rows)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment