November 2019
Beginner to intermediate
470 pages
11h 59m
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 this mean? Penalty points (or costs) are mostly an abstract concept. They are needed to compare different ways to execute a query. If a query can be executed by the executor in many different ways, PostgreSQL will decide on the execution plan by promising the lowest ...
Read now
Unlock full access