patternsqlMinor
Understanding Query Plan’s “width”
Viewed 0 times
understandingquerywidthplan
Problem
The Douglas and Douglas PostgreSQL book includes the following EXPLAIN result:
The first step of the query, the Seq Scan, shows a width of 1917. However the last step of the query, the Sort, has a width of 1911.
Why/how could these values differ?
The first step of the query, the Seq Scan, shows a width of 1917. However the last step of the query, the Sort, has a width of 1911.
Why/how could these values differ?
Solution
Every PostgreSQL row version (“tuple”) has a number of system columns and other data that are not displayed by
These would account 23 bytes, not for four, so you'd have to look at tge source for more. The only of these items that occupies 6 bytes is
SELECT * (see the documentation for details. Among them arexminandxmax
- extra flags that contain the “hint bits” and the “frozen” flag.
ctid, the tuple's physical address.
These would account 23 bytes, not for four, so you'd have to look at tge source for more. The only of these items that occupies 6 bytes is
ctid, so maybe that.Context
StackExchange Database Administrators Q#241715, answer score: 3
Revisions (0)
No revisions yet.