May 2017
Beginner
416 pages
10h 37m
English
If only one CPU is used, the execution plan will look like this:
test=# EXPLAIN SELECT * FROM t_test WHERE id = 432332; QUERY PLAN ---------------------------------------------------------- Seq Scan on t_test (cost=0.00..71622.00 rows=1 width=9) Filter: (id = 432332) (2 rows)
PostgreSQL will sequentially read (sequential scan) the entire table and apply the filter. It expects the operation to cost 71622 penalty points. Now what does that mean? Penalty points (or costs) are mostly an abstract concept. They are needed to compare different ways to execute the query. If a query can be executed by the executor in many different ways, PostgreSQL will decide on the execution plan promising the lowest cost ...
Read now
Unlock full access