Re: [PG13] Planning (time + buffers) data structure in explain plan (format text)

Fujii Masao <masao.fujii@oss.nttdata.com>

From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Pierre Giraud <pierre.giraud@dalibo.com>, pgsql-hackers@lists.postgresql.org
Date: 2020-08-20T08:07:57Z
Lists: pgsql-hackers

On 2020/08/20 17:03, Pierre Giraud wrote:
> Can you please show what the plan would look like for?
> 
> =# explain (buffers on, summary on, format JSON) select * from t;

With my patch, the following is reported in that case.

=# explain (buffers on, summary on, format JSON) select * from pg_class;
              QUERY PLAN
------------------------------------
  [                                 +
    {                               +
      "Plan": {                     +
        "Node Type": "Seq Scan",    +
        "Parallel Aware": false,    +
        "Relation Name": "pg_class",+
        "Alias": "pg_class",        +
        "Startup Cost": 0.00,       +
        "Total Cost": 16.87,        +
        "Plan Rows": 387,           +
        "Plan Width": 265,          +
        "Shared Hit Blocks": 0,     +
        "Shared Read Blocks": 0,    +
        "Shared Dirtied Blocks": 0, +
        "Shared Written Blocks": 0, +
        "Local Hit Blocks": 0,      +
        "Local Read Blocks": 0,     +
        "Local Dirtied Blocks": 0,  +
        "Local Written Blocks": 0,  +
        "Temp Read Blocks": 0,      +
        "Temp Written Blocks": 0    +
      },                            +
      "Planning": {                 +
        "Shared Hit Blocks": 103,   +
        "Shared Read Blocks": 12,   +
        "Shared Dirtied Blocks": 0, +
        "Shared Written Blocks": 0, +
        "Local Hit Blocks": 0,      +
        "Local Read Blocks": 0,     +
        "Local Dirtied Blocks": 0,  +
        "Local Written Blocks": 0,  +
        "Temp Read Blocks": 0,      +
        "Temp Written Blocks": 0    +
      },                            +
      "Planning Time": 8.132        +
    }                               +
  ]
(1 row)

Regards,

-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION



Commits

  1. Fix explain regression test failure.

  2. Rework EXPLAIN for planner's buffer usage.