Query Snippet Output
unknown
pgsql
2 years ago
497 B
1
Indexable
Never
--Create Tables CREATE TABLE t1 (a INT, b CHAR(100) DEFAULT 'abcd'); CREATE TABLE t2 (a INT, b CHAR(100) DEFAULT 'abcd'); -- Insert data into tables INSERT INTO t1 SELECT * FROM generate_series(1, 50000000); INSERT INTO t2 SELECT a FROM t1 ORDER BY random(); -- Create Indexes CREATE INDEX ON t1(a); CREATE INDEX ON t2(a); -- Vacuum analyze VACUUM ANALYZE --Queries EXPLAIN (ANALYZE, BUFFERS, TIMING OFF) SELECT COUNT(a) FROM t1; EXPLAIN (ANALYZE, BUFFERS, TIMING OFF) SELECT COUNT(a) FROM t2;