Re: Planner debug views - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Planner debug views
Date
Msg-id 20150728032036.GO5596@postgresql.org
Whole thread Raw
In response to Re: Planner debug views  (Qingqing Zhou <zhouqq.postgres@gmail.com>)
Responses Re: Planner debug views  (Qingqing Zhou <zhouqq.postgres@gmail.com>)
List pgsql-hackers
Qingqing Zhou wrote:

> Attached is a draft patch implementing the idea. To play with it, you
> shall create the follow two foreign tables:
> CREATE EXTENSION file_fdw;
> CREATE SERVER pglog FOREIGN DATA WRAPPER file_fdw;
> create foreign table pg_planner_rels(rel text, content text)server
> pglog options(filename '<your_install>/data/debug_planner_relopt.csv',
> format 'csv');
> create foreign table pg_planner_paths(rel text, path text, replacedby
> text, reason int, startupcost float, totalcost float, cheapest text,
> innerp text, outerp text, content text) server pglog options(filename
> '<your_install>/data/debug_planner_paths.csv', format 'csv');

I think this is a pretty neat idea, but I'm not sure this user interface
is a good one.  Why not have a new option for EXPLAIN, so you would call
"EXPLAIN (planner_stuff=on)" and it returns this as a resultset?  This
idea of creating random CSV files seems odd and inconvenient in the long
run.  For instance it fails if you have two sessions doing it
simultaneously; you could tack the process ID at the end of the file
name to prevent that problem, but then the foreign table breaks each
time.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Kouhei Kaigai
Date:
Subject: Re: [DESIGN] ParallelAppend
Next
From: Andres Freund
Date:
Subject: Re: LWLock deadlock and gdb advice