Re: Changing the result set to contain the cost of the optimizer's chosen plan

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Srinivas Karthik V <skarthikv(dot)iitb(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Changing the result set to contain the cost of the optimizer's chosen plan
Date: 2016-07-11 15:29:06
Message-ID: 8421.1468250946@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Srinivas Karthik V <skarthikv(dot)iitb(at)gmail(dot)com> writes:
> Specifically, I have a Java program which calls
> ResultSet rs = statement.executeQuery("explain select * from table");
> I would like to change PostgreSQL such that ResultSet rs should contain a
> field that contains also the cost of the optimizer chosen plan.

Why do you need to change anything? The cost is right there in the
first line of the result text. It might be easier to parse out if
you use one of EXPLAIN's intended-to-be-machine-readable output
formats, though.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2016-07-11 16:08:30 Re: Showing parallel status in \df+
Previous Message Tom Lane 2016-07-11 15:24:52 Re: [CF2016-9] Allow spaces in working path on tap-tests