Re: [PATCHES] WIP: executor_hook for pg_stat_statements - Mailing list pgsql-hackers

From ITAGAKI Takahiro
Subject Re: [PATCHES] WIP: executor_hook for pg_stat_statements
Date
Msg-id 20080708091907.6D35.52131E4D@oss.ntt.co.jp
Whole thread Raw
In response to Re: [PATCHES] WIP: executor_hook for pg_stat_statements  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [PATCHES] WIP: executor_hook for pg_stat_statements  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> wrote:

> I don't want the tag there at all, much less converted to a pointer.
> What would the semantics be of copying the node, and why?
> 
> Please justify why you must have this and can't do what you want some
> other way.

In my pg_stat_statements plugin, the tag is used to cache hash values of
SQL strings in PlannedStmt. It is not necessarily needed because the hash
value is re-computable from debug_query_string. It is just for avoiding
the work. In addition, we see different SQLs in debug_query_string in
PREPARE/EXECUTE and DECLARE/FETCH. Hashed SQL cache can work on those
commands.

However, it's ok to remove the tag field from the patch if we should
avoid such an unused field in normal use. EXECUTE and FETCH issues
could be solved if I write simple SQL parser in my plugin because SQL
bodies can be fetched from pg_prepared_statements and pg_cursors.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: 8.1 index corruption woes
Next
From: Bruce Momjian
Date:
Subject: Re: CommitFest rules