[pgpool-hackers: 3346] MOdifying temp table checking method

Tatsuo Ishii ishii at sraoss.co.jp
Thu Jun 27 15:03:24 JST 2019

Currently checking temp tables is done by inspecting system
catalog. Moreover it's a session local cache, that means whenever new
session starts, looking up system catalog must be performed.

To eliminate the system catalog looking up, I would like to propose
following method.

- Trace CREATE TEMP TABLE. If new temp table is created (and
  committed), memorize it in a list.

- To know whether it's temp table or not, search the list.

- Trace DROP TABLE. If a table is dropped (and committed), remove the
  table from the list.

- When a transaction aborts, remove tables from the list if any.

This way, we could completely eliminate system catalog look up, thus
much faster.

A down side of the method is, we cannot trace inside functions or

Consider this, I think we should offer choices to users.  So existing
boolean "check_temp_table" parameter needs to be changed to;

"catalog": existing method (catalog lookup, same as check_temp_table = on)
"trace":   the proposed new way
"none":    no temp table checking (same as check_temp_table = off)

Patch attached.

Best regards,
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
-------------- next part --------------
A non-text attachment was scrubbed...
Name: temp_table.diff
Type: text/x-patch
Size: 27612 bytes
Desc: not available
URL: <http://www.sraoss.jp/pipermail/pgpool-hackers/attachments/20190627/3b606005/attachment-0001.bin>

More information about the pgpool-hackers mailing list