Changing the result set to contain the cost of the optimizer's chosen plan - Mailing list pgsql-hackers

From Srinivas Karthik V
Subject Changing the result set to contain the cost of the optimizer's chosen plan
Date
Msg-id CAEfuzeS_7H_af-3w3nxNPRQbY3Gf0h2DN=Y_0RfTuZ8arTH14g@mail.gmail.com
Whole thread Raw
Responses Re: Changing the result set to contain the cost of the optimizer's chosen plan  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: pg_xlogdump bad error msg?
Next
From: Tom Lane
Date:
Subject: Re: [CF2016-9] Allow spaces in working path on tap-tests