Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the `width` field mean in PostgreSQL's EXPLAIN?

Tags:

sql

postgresql

For example, from the EXPLAIN documentation:

 EXPLAIN SELECT * FROM tenk1;                           QUERY PLAN -------------------------------------------------------------  Seq Scan on tenk1  (cost=0.00..458.00 rows=10000 width=244) 

What does width=244 mean?

like image 308
David Wolever Avatar asked Jun 09 '12 20:06

David Wolever


People also ask

What is width in Postgres explain?

This is the "Estimated average width (in bytes) of rows output by this plan node"

How do you use explain analyze in PostgreSQL?

The ANALYZE option causes the statement to be actually executed, not only planned. Then actual run time statistics are added to the display, including the total elapsed time expended within each plan node (in milliseconds) and the total number of rows it actually returned.

What is cost in explain plan Postgres?

Understanding the Postgres EXPLAIN cost It returns the execution plan generated by PostgreSQL query planner for a given statement. The EXPLAIN command specifies whether the tables referenced in a statement will be searched using an index scan or a sequential scan.

What is cost in explain query?

Cost is the estimated amount of work the plan will do. A higher cardinality => you're going to fetch more rows => you're going to do more work => the query will take longer. Thus the cost is (usually) higher. All other things being equal, a query with a higher cost will use more resources and thus take longer to run.


1 Answers

This is the "Estimated average width (in bytes) of rows output by this plan node"

Basically each row returned will be 244 bytes.

See Explain for more details.

like image 169
Reed Copsey Avatar answered Sep 22 '22 01:09

Reed Copsey