RE: [HACKERS] Explain plan output
RE: [HACKERS] Explain plan output
От:
"Ansley, Michael" <Michael.Ansley@intec.co.za>
Дата:
>> > Anyway, the point of this mail is to say that I have altered the >> explain >> > code slightly, so that it dumps the results of the explain into a >> > table. >> >> What do you mean by that, exactly? You can't expect to fit long explain >> outputs into a single table row, so I suppose it's one row per line. >> How are the rows identified? What's the expected declaration of the >> table? CREATE SEQUENCE explain_plan_seq; CREATE TABLE explain_plan (id INT4,explain_line CHARACTER VARYING(255),level INT4,plan_order INT4 ); This is pretty close to the way that Oracle implements it. That's where I got the idea from. Just had to add a little SPI, and voila... >> > I find that a lot more convenient >> >> It strikes me as a lot less convenient for the sorts of things I use >> explain for. When ODBC is the only way in, then it's pretty inconvenient ;-) If you have access to psql, then it's fine, but for certain (perhaps most) other interfaces, it's not so cool. And when there is separation of duties (i.e.: the dba is not the same person as the developer), and the developers are using traditional win32 tools, the table is a lot more accessible. Generally, in the environments that I've worked in, the developers only use things like psql if they happen to be a db designer as well. Frequently, once the database has been designed and created, the developers only have ODBC access. Any change requests go through the dba. >> But I wouldn't object if it were an optional feature: >> >> EXPLAIN [ VERBOSE ] [ INTO