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

From: Srinivas Karthik V <skarthikv(dot)iitb(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Changing the result set to contain the cost of the optimizer's chosen plan
Date: 2016-07-11 15:24:23
Message-ID: CAEfuzeS_7H_af-3w3nxNPRQbY3Gf0h2DN=Y_0RfTuZ8arTH14g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

I am Srinivas and have been working inside PostgreSQL (mostly in the
optimizer module and few times in the executor module). I would like to
change PostgreSQL code such that it also returns the cost of the optimizer
chosen plan to the Java program (through JDBC) as part of the result set.

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.

If the above is not possible, also please let me know if there is some
other way I could get the cost of the plan in a single call to engine
through Java program.

Regards,
Srinivas Karthik

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-07-11 15:24:52 Re: [CF2016-9] Allow spaces in working path on tap-tests
Previous Message Andres Freund 2016-07-11 15:20:59 Re: pg_xlogdump bad error msg?