- architecture somewhat old - primarily optimized towards oltp - not many low hanging fruits - hashtables - hash based aggregation - bitmpscans - expression evaluation - "mini" Virtual-Machine - possibly JITable - incrementally changing executor to batch tuples - show plan - explain flow - explain batches Aggregate (actual time=...6691.528 rows=1) -> Bitmap Heap Scan on lineitem (actual time=..5195.704 rows=9113219) Recheck Cond: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate <= '1996-12-31'::date)) Heap Blocks: exact=585542 -> Bitmap Index Scan on i_l_shipdate (actual time=..4429.997 rows=9113219) Index Cond: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate <= '1996-12-31'::date)) Execution time: 5196.203 ms Aggregate (actual time=..3341.864 rows=1) -> Bitmap Heap Scan on lineitem (actual time=..2569.560 rows=9113219) Recheck Cond: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate <= '1996-12-31'::date)) Heap Blocks: exact=585542 -> Bitmap Index Scan on i_l_shipdate (actual time=..951.016 rows=9113219) Index Cond: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate <= '1996-12-31'::date)) Execution time: 3343.101 ms EXPLAIN (ANALYZE, TIMING OFF) SELECT l_partkey, SUM(l_extendedprice) FROM lineitem GROUP BY 1 ORDER BY 2 DESC LIMIT 10; Limit (actual rows=10 loops=1) -> Sort (actual rows=10 loops=1) Sort Key: (sum(l_extendedprice)) DESC Sort Method: top-N heapsort Memory: 25kB -> HashAggregate (cost=1038925.33..1049377.88 rows=1045255 width=12) (actual rows=1000000 loops=1) Group Key: l_partkey -> Seq Scan on lineitem (cost=0.00..888926.22 rows=29999822 width=12) (actual rows=29999795 loops=1) Execution time: 17803.043 ms Limit (cost=1071965.46..1071965.49 rows=10 width=12) (actual rows=10 loops=1) -> Sort (cost=1071965.46..1074578.60 rows=1045255 width=12) (actual rows=10 loops=1) Sort Key: (sum(l_extendedprice)) DESC Sort Method: top-N heapsort Memory: 25kB -> HashAggregate (cost=1038925.33..1049377.88 rows=1045255 width=12) (actual rows=1000000 loops=1) Group Key: l_partkey -> Seq Scan on lineitem (cost=0.00..888926.22 rows=29999822 width=12) (actual rows=29999795 loops=1) Execution time: 12444.961 ms SELECT l_partkey, SUM(l_extendedprice) FROM lineitem GROUP BY 1 ORDER BY 2 DESC LIMIT 10; Limit (actual time=..18529.047 rows=10) -> Sort (actual time=..18529.045) Sort Key: (sum(l_extendedprice)) DESC Sort Method: top-N heapsort Memory: 25kB -> HashAggregate (actual time=..18427.389 rows=1000000) Group Key: l_partkey -> Seq Scan on lineitem (actual time=..3106.676 rows=29999795) Execution time: 18536.564 ms Limit (actual time=..14087.096 rows=10) -> Sort (actual time=..14087.093 rows=10) Sort Key: (sum(l_extendedprice)) DESC Sort Method: top-N heapsort Memory: 25kB -> HashAggregate (actual time=..14047.655 rows=1000000) Group Key: l_partkey -> Seq Scan on lineitem (actual time=..3136.398 rows=29999795) Execution time: 14102.279 ms SELECT count(*) FROM lineitem WHERE l_extendedprice > 1000; ExecMakeFunctionResultNoSets() check_stack_depth() ExecEvalFuncArgs() ExecEvalScalarVarFast() ExecEvalConst() float8gt()