OSDN Git Service

pgstoreplans/pg_store_plans.git
16 months agoAdd new columns to pg_store_plans view master 1.7
Kyotaro Horiguchi [Wed, 14 Dec 2022 06:52:34 +0000 (15:52 +0900)]
Add new columns to pg_store_plans view

Likewise pg_stat_statements, add temp_blk_read_time and
temp_blk_write_time to pg_store_plans view.
Version is changed to 1.7.

16 months agoUpdate copyright year
Kyotaro Horiguchi [Wed, 14 Dec 2022 06:51:02 +0000 (15:51 +0900)]
Update copyright year

16 months agoFollow new shared memory request convention since PG15
Kyotaro Horiguchi [Wed, 30 Nov 2022 08:20:54 +0000 (17:20 +0900)]
Follow new shared memory request convention since PG15

The procedure to request shared memory for extensions has been changed
in PG15.  Follow that convention only when the target PG version >=
15.

2 years agoAdd forgot upgrade sql file 1.6.1
Kyotaro Horiguchi [Thu, 3 Feb 2022 13:50:38 +0000 (22:50 +0900)]
Add forgot upgrade sql file

Add upgrade SQL script forgot to be included in the last commits.

2 years agoFix bogus date in SPEC file
Kyotaro Horiguchi [Thu, 3 Feb 2022 13:48:35 +0000 (22:48 +0900)]
Fix bogus date in SPEC file

2 years agoVersion 1.6.1.
Kyotaro Horiguchi [Thu, 3 Feb 2022 07:56:11 +0000 (16:56 +0900)]
Version 1.6.1.

The only differnece since 1.6 is a fix of a bug that causes a strange
error message at the first run or a runs after crash.

2 years agoA strange message is emitted after a crash or the first time
Tatsuhito Kasahara [Mon, 24 Jan 2022 05:36:36 +0000 (14:36 +0900)]
A strange message is emitted after a crash or the first time
pg_store_plans is loaded on a fresh database cluster.

WARNING:  1 temporary files and directories not closed at end-of-transaction

pgsp_shmem_startup forgot to close the temporary plan storeage file
when the main persistent storage file is missing.  It should be closed
before exiting the function.

2 years agoFix RPM change log 1.6
Kyotaro Horiguchi [Mon, 17 Jan 2022 04:42:34 +0000 (13:42 +0900)]
Fix RPM change log

Fill it with the final inforamtion.

2 years agoIgnore commands under CREATE/ALTER EXTENSION commands
Kyotaro Horiguchi [Wed, 1 Dec 2021 08:26:50 +0000 (17:26 +0900)]
Ignore commands under CREATE/ALTER EXTENSION commands

Sometimes CREATE/ALTER EXTENSION runs a lot of commands. However,
those commands are not welcomed to be shown in pg_store_plans view in
common case.  Ignore commands run under those commands when
pg_store_plans.track is set to "all".  The new option "verbose" let
all commands including ones excluded by all show in pg_store_plans.

Author: Kasahara Tatsuhito, Kyotaro Horiguchi

2 years agoRemove unused track option TRACK_LEVEL_FORCE
Kyotaro Horiguchi [Wed, 1 Dec 2021 07:09:40 +0000 (16:09 +0900)]
Remove unused track option TRACK_LEVEL_FORCE

It doesn't look like the item has ever been used. Remove it.

2 years agoAvoid use of uninitialized variables
Kyotaro Horiguchi [Tue, 30 Nov 2021 06:38:45 +0000 (15:38 +0900)]
Avoid use of uninitialized variables

Some variables may be used uninitialized. Fix that.

2 years agoFix comment style
Kyotaro Horiguchi [Wed, 12 Jan 2022 08:01:32 +0000 (17:01 +0900)]
Fix comment style

The end mark of a single-line comment went to the next line. Fix it.

2 years agoReturn null in queryid/planid when privilege insifficiency
Kyotaro Horiguchi [Wed, 12 Jan 2022 07:58:35 +0000 (16:58 +0900)]
Return null in queryid/planid when privilege insifficiency

The fields returned zeroes but null is appropriate.  I think
compatibility won't be issue since that field anyway cannot match
meaningful pg_stat_statements field.

2 years agoFix GUC context of a custom variable
Kyotaro Horiguchi [Thu, 25 Nov 2021 11:15:01 +0000 (20:15 +0900)]
Fix GUC context of a custom variable

The new GUC variable pg_store_plans.plan_storage is intended to be a
PGC_POSTMASTER. Fix it.

2 years agoFix compiling error on Solaris
sunw.fnst [Wed, 1 Jul 2020 11:37:50 +0000 (19:37 +0800)]
Fix compiling error on Solaris

The 'LDFLAGS+=-Wl,--build-id' option is for rpm building in Linux like
OS.  The SunOS is not native support the option
'LDFLAGS+=-Wl,--build-id' . So, disable this option in SunOS while
compiling.

2 years agoAdd statistics of pg_store_plans
Kyotaro Horiguchi [Mon, 22 Nov 2021 05:47:57 +0000 (14:47 +0900)]
Add statistics of pg_store_plans

Likewise pg_stat_statements, this commit adds a statistics view about
the activity of pg_store_plans.

2 years agoRestore in-hash plan text storage as an alternative
Kyotaro Horiguchi [Thu, 25 Nov 2021 02:03:36 +0000 (11:03 +0900)]
Restore in-hash plan text storage as an alternative

We once moved completely to store plan texts into a file.  This commit
re-introduces the in-hash plan storage as an alternative choice with
the file storage, in case where garbage collection on files is
painful.

The in-hash storage is fixed-length so the efficiency of memory usage
if rather low.  We could improve the efficiency by using the same
strategy with the file storage if DSA, or expandable shared memory,
were available on postmaster, but it is not available at least for
now.  So as the second best we stay providing the same method with the
existing implement.

2 years agoIntroduce file storage of plan texts
Kyotaro Horiguchi [Mon, 22 Nov 2021 05:18:24 +0000 (14:18 +0900)]
Introduce file storage of plan texts

pg_stat_statements has been changed so that it separately stores query
texts into a file outside the main hash table. This configuration is
advantageous in several aspects. Let pg_store_plans make use the same
technique.  We don't intend to obsolete the existing in-hash-entry
plan text storage but remove that feature once so that this feature is
planted more easily.

2 years agoHandle new nodes and fields added in pg14.
Julien Rouhaud [Tue, 9 Nov 2021 03:45:48 +0000 (11:45 +0800)]
Handle new nodes and fields added in pg14.

Handle the new nodes T_TidRangeScan and T_Memoize and the new property
"AsyncCapable".  Adjust the test files for the change.

2 years agoRemove the queryid_stat_statements field.
Julien Rouhaud [Sat, 6 Nov 2021 07:00:21 +0000 (15:00 +0800)]
Remove the queryid_stat_statements field.

With pg14 and above core postgres can compute a queryid without any
external extension, so we can simply rely on it.  We do so by asking
for the core to compute a queryid if users allow it.  Note that if
users explicitly disable compute_query_id, we will obey and not record
anything.

For previous versions, automatically detect if a queryid is computed
by some external extensions or not.  If yes, use it as the key queryid
otherwise fallback on internal queryid calculation.

2 years agoMake maximum plan length configurable
Kyotaro Horiguchi [Thu, 25 Nov 2021 00:23:11 +0000 (09:23 +0900)]
Make maximum plan length configurable

The maximum length of plan texts was not configurable. However, it is
apparently intended to be configurable.  Let's complete that work now.

2 years agoRename names of some structs and a function
Kyotaro Horiguchi [Mon, 22 Nov 2021 05:59:25 +0000 (14:59 +0900)]
Rename names of some structs and a function

Rename struct names so that we can easily find corresponding struct in
pg_stat_statements. Likewise rename store_entry to pgsp_store.

2 years agoDon't use the long-obsolete LWLockId type
Kyotaro Horiguchi [Mon, 22 Nov 2021 05:52:13 +0000 (14:52 +0900)]
Don't use the long-obsolete LWLockId type

2 years agoRemove sjson2testsql.pl
Julien Rouhaud [Tue, 9 Nov 2021 03:37:54 +0000 (11:37 +0800)]
Remove sjson2testsql.pl

This file looks like a thinko in
736421dcca69dfb9907e4404a900d39d36e87c1c and isn't used.

2 years agoIgnore psqlrc file in make rules relying on psql.
Julien Rouhaud [Tue, 9 Nov 2021 03:36:51 +0000 (11:36 +0800)]
Ignore psqlrc file in make rules relying on psql.

2 years agoMove misplaced comment.
Julien Rouhaud [Sat, 6 Nov 2021 06:38:45 +0000 (14:38 +0800)]
Move misplaced comment.

2 years agoRemove some trailing whitespaces and other minor stylistic issues.
Julien Rouhaud [Sat, 6 Nov 2021 06:27:10 +0000 (14:27 +0800)]
Remove some trailing whitespaces and other minor stylistic issues.

2 years agoPG14 support
Tatsuro Yamada [Fri, 5 Nov 2021 07:00:01 +0000 (16:00 +0900)]
PG14 support

- Successfully builds on PG14, and also passes PG13 regression tests.
- The new node types added in PG14 are not yet supported.

Co-Author: Julien Rouhaud <julien.rouhaud@free.fr>

2 years agoUpdate copyright year of files
Tatsuro Yamada [Fri, 5 Nov 2021 04:15:16 +0000 (13:15 +0900)]
Update copyright year of files

2 years agoFix Makefile to follow a directory rename.
Kyotaro Horiguchi [Wed, 27 Jan 2021 07:36:32 +0000 (16:36 +0900)]
Fix Makefile to follow a directory rename.

2 years agoVersion 1.5
Kyotaro Horiguchi [Wed, 27 Jan 2021 05:25:23 +0000 (14:25 +0900)]
Version 1.5

Supports PostgreSQL 13.

2 years agoReplace directory name for github pages. s/doc/docs/
Tatsuro Yamada [Sun, 15 Nov 2020 12:04:38 +0000 (21:04 +0900)]
Replace directory name for github pages. s/doc/docs/

2 years agoFix a typo
Tatsuro Yamada [Tue, 10 Apr 2018 09:40:20 +0000 (18:40 +0900)]
Fix a typo

s/Sbu/Sub/

3 years agoSupport PostgreSQL 13
Kyotaro Horiguchi [Wed, 7 Oct 2020 08:21:43 +0000 (17:21 +0900)]
Support PostgreSQL 13

Support PostgreSQL 13, with compression of some of the node new in 13.

4 years agoVersion 1.4. 1.4
Kyotaro Horiguchi [Thu, 23 Jan 2020 05:12:14 +0000 (14:12 +0900)]
Version 1.4.

Add new stats items max_time/min_time/stddev_time.
Supports PostgreSQL 12 only.

4 years agoRevert "Version 1.3.1"
Kyotaro Horiguchi [Fri, 31 Jan 2020 03:27:26 +0000 (12:27 +0900)]
Revert "Version 1.3.1"

To swap branches including master, this reverts commit
132519a8cf6e8e3af57130734bf3e24321d6f8e4.

4 years agoVersion 1.3.1 1.3
Kyotaro Horiguchi [Thu, 30 Jan 2020 10:09:57 +0000 (19:09 +0900)]
Version 1.3.1

4 years agoFix a bug of plan string inflation
Kyotaro Horiguchi [Thu, 30 Jan 2020 07:42:09 +0000 (16:42 +0900)]
Fix a bug of plan string inflation

pg_store_plans() gave the length of raw plan string to encoding
function. Queries on the pg_store_plans view gets ERROR when (a)
inflated string contained unprintable byte sequence after the raw
length, or (b) the inflation made a string shorter. Fixed it.

4 years agoUpdate copyright year to 2020
Kyotaro Horiguchi [Thu, 30 Jan 2020 10:24:27 +0000 (19:24 +0900)]
Update copyright year to 2020

5 years agoFig regression test. 1.3
Kyotaro Horiguchi [Thu, 28 Feb 2019 06:45:44 +0000 (15:45 +0900)]
Fig regression test.

expected/convert.out had a wrong result based on a bug. Commit
9d7ea07912 fixed the bug with the test script being left alone. This
doesn't change the behavior so only source package with the next
release number is released.

5 years agoFix SPEC file for pg_store_plans11
Kyotaro Horiguchi [Mon, 28 Jan 2019 05:11:58 +0000 (14:11 +0900)]
Fix SPEC file for pg_store_plans11

The llvm subpackage wrongly rewires pg_hint_plan11. Fxied it. There'
no other differences so the dependency is described omitting the
release number.

5 years agoAdd SPEC file for PostgresSQL 11
Kyotaro Horiguchi [Tue, 22 Jan 2019 10:54:35 +0000 (19:54 +0900)]
Add SPEC file for PostgresSQL 11

The previous commit forgot to add the SPEC file for PostgreSQL11 and
some other files. Also Modify Makefile so that RPM files are sainly
generate.

5 years agoVersion bumped to 1.3
Kyotaro Horiguchi [Tue, 22 Jan 2019 09:13:09 +0000 (18:13 +0900)]
Version bumped to 1.3

Changed version to 1.3. Only SPEC files for 9.6 and later are fixed to
generate 1.3 package since the last fixed bug doesn't affect the
eralier versions.

5 years agoFix boolean setter declaration
Kyotaro Horiguchi [Tue, 22 Jan 2019 08:14:21 +0000 (17:14 +0900)]
Fix boolean setter declaration

BOOL_SETTER ignores given name and always sets value to the member
"parallel_aware". When inner_uniue comes after parallel_aware, the
former overrides the latter and the latter doesn't get the right
value.  As the result the following JSON plan is wrongly converted as
"Parallel Join".

select pg_store_plans_textplan('{"Plans":[{"Node Type":"Join","Parallel Aware":false,"Inner Unique":true}]}');

Currently only "Inner Unique" hits this.

5 years agoFix misspelling of pg_store_plans
Kyotaro Horiguchi [Tue, 22 Jan 2019 09:18:40 +0000 (18:18 +0900)]
Fix misspelling of pg_store_plans

In many places in the files pg_store_plans is misspelled as
pg_store_plan. Fix all of them.

5 years agoFix a typo of a message.
Kyotaro Horiguchi [Tue, 22 Jan 2019 07:15:41 +0000 (16:15 +0900)]
Fix a typo of a message.

Fix a long-standing typo in an error message.

5 years agoFollow a change in core.
Kyotaro Horiguchi [Tue, 22 Jan 2019 07:14:46 +0000 (16:14 +0900)]
Follow a change in core.

Parameter of scanner_init has changed in core. Follow it.

5 years agoAdd the LICENSE file and update copyright notice of all files
Kyotaro Horiguchi [Tue, 8 Jan 2019 04:11:36 +0000 (13:11 +0900)]
Add the LICENSE file and update copyright notice of all files

The LICENSE file is added to explicitly declare copyright notice of
this software. Updated copyright notice on each files along with.

5 years agoSupport PG11
Kyotaro Horiguchi [Wed, 13 Jun 2018 07:50:01 +0000 (16:50 +0900)]
Support PG11

Support 64-bit queryid widen as of PG11.

5 years agoIgnore trailing semicolon in hashing a query
Kyotaro Horiguchi [Wed, 13 Jun 2018 02:13:36 +0000 (11:13 +0900)]
Ignore trailing semicolon in hashing a query

Since PG10 pg_stat_statements doesn't store trailing semicolon in the
column "query". Normalization is basically useless in the version but
still usefull to match utility commands so follow the behavior change.

6 years agoBump up version to 1.2. 1.2
Kyotaro Horiguchi [Tue, 10 Oct 2017 05:00:58 +0000 (14:00 +0900)]
Bump up version to 1.2.

Supports PostgreSQL 10.

6 years agoAdd test for storing plans
Kyotaro Horiguchi [Thu, 14 Sep 2017 06:12:14 +0000 (15:12 +0900)]
Add test for storing plans

There was no regtest for actual storing behavior. This commit add
that.

6 years agoModify the script to generate conversion test file
Kyotaro Horiguchi [Thu, 14 Sep 2017 06:13:37 +0000 (15:13 +0900)]
Modify the script to generate conversion test file

The script contained a query setting a multievent trigger using
transition tables. Split it into two triggers since such operation has
been inhibited.

6 years agoReplace test files
Kyotaro Horiguchi [Mon, 5 Jun 2017 10:29:42 +0000 (19:29 +0900)]
Replace test files

Update test files so that all supported field names are tested.

6 years agoAdd support for new node types
Kyotaro Horiguchi [Tue, 6 Jun 2017 08:30:12 +0000 (17:30 +0900)]
Add support for new node types

Pg10 has some new nodes. This commit add support for them.

6 years agoSupport PostgreSQL 10
Kyotaro Horiguchi [Fri, 2 Jun 2017 04:32:10 +0000 (13:32 +0900)]
Support PostgreSQL 10

Followed the change of API of some executor functions.

6 years agoAvoid duplicate warning on nonstandard escaping of strings
Kyotaro Horiguchi [Tue, 6 Jun 2017 07:25:01 +0000 (16:25 +0900)]
Avoid duplicate warning on nonstandard escaping of strings

pg_store_plans emits duplicate warning with core parser for each
nonstandard string escape in expressions of a query. This commit stops
that.

6 years agoFix wrong indentaion of short json plan
Kyotaro Horiguchi [Mon, 5 Jun 2017 10:09:59 +0000 (19:09 +0900)]
Fix wrong indentaion of short json plan

pgsp_json_shorten insertes unnecessary line breaks for keys of
grouping sets. This commit fixes it.

6 years agoFix a crash bug caused by unkown aggregation type.
Kyotaro Horiguchi [Mon, 5 Jun 2017 10:19:22 +0000 (19:19 +0900)]
Fix a crash bug caused by unkown aggregation type.

Unknown aggregation type caused a crash. This happens only on
development but should be treated as the same as other similar cases.

7 years agoPrint unknown properties in text representation
Kyotaro Horiguchi [Fri, 2 Sep 2016 08:07:25 +0000 (17:07 +0900)]
Print unknown properties in text representation

Foreign data wrappers may put explain properties unknown to the core,
such as "Remote SQL". This patch prints such properties in text
explains.

7 years agoSupport parallel query
Kyotaro Horiguchi [Fri, 2 Sep 2016 07:55:14 +0000 (16:55 +0900)]
Support parallel query

Support Gather node and related properties.

7 years agoEdit copyright notice
Kyotaro Horiguchi [Fri, 2 Sep 2016 04:44:14 +0000 (13:44 +0900)]
Edit copyright notice

Edit year range of copyright notices.

7 years agoAdd RPM SPEC file for 9.6
Kyotaro Horiguchi [Tue, 30 Aug 2016 09:35:44 +0000 (18:35 +0900)]
Add RPM SPEC file for 9.6

To build a RPM file, do the following thing.

(Edit $PATH to point right pg_config)
$ make USE_PGXS=1 rpm96

7 years agoSupport PostgreSQL 9.6
Kyotaro Horiguchi [Tue, 30 Aug 2016 09:07:50 +0000 (18:07 +0900)]
Support PostgreSQL 9.6

Use user defined lwlock tranche from 9.6 instead of the old way of 9.5
and before. Follow the change of the third parameter of ExecutorRun.

7 years agoPrepare RPM build environmnet for Version 1.1 1.1
Kyotaro Horiguchi [Fri, 26 Aug 2016 08:03:41 +0000 (17:03 +0900)]
Prepare RPM build environmnet for Version 1.1

Stored data is backward compatible with 1.0.

Fixed "Original Hash Backets", IO Timings, Sort Keys in text plan
representation.

Fixed text plan representation of "ON CONFLICT", "GROUPING SETS",
"TABLESAMPLE" and multi-targetted ModifyTables, which just were not
shown or looked broken.

7 years agoReplace test scripts
Kyotaro Horiguchi [Fri, 26 Aug 2016 07:16:54 +0000 (16:16 +0900)]
Replace test scripts

Since some features added, the scripts and result files are repalced
with ones according to the current behavior.

7 years agoAdd support for TableSample in text representaion.
Kyotaro Horiguchi [Fri, 26 Aug 2016 01:28:40 +0000 (10:28 +0900)]
Add support for TableSample in text representaion.

Text representaion of table sample properties to be shown properly
with this fix.

 Sample Scan  (cost=0.00..2768.00 rows=100000 width=4)
+  Sampling: system ('10'::real) REPEATABLE ('0'::double precision)

7 years agoAllow handled properties not to have a short name
Kyotaro Horiguchi [Fri, 26 Aug 2016 01:22:10 +0000 (10:22 +0900)]
Allow handled properties not to have a short name

Shorten a json representaion allows the properties that the parser
doesn't knonw to be left unshortened. This is applicable to other
properties that the parser knows *but* don't shorten
intentionally. This is convenient some properties to be handled but
rarely seen.

7 years agoSupport ORDER BY and GROUPING SETS in text representation.
Kyotaro Horiguchi [Fri, 26 Aug 2016 04:16:47 +0000 (13:16 +0900)]
Support ORDER BY and GROUPING SETS in text representation.

Text plan representaion omitted these items. This patch make them
properly shown.
Addition to that, GroupKeys (ON CONFLICT) introduced another way of
indentation of brackets. Make the bracket indentaion code behave
differently for the case.

7 years agoSupport ON CONFLICT in text plan output
Kyotaro Horiguchi [Fri, 26 Aug 2016 04:13:24 +0000 (13:13 +0900)]
Support ON CONFLICT in text plan output

ON CONFLICT syntax yields some additional information. This commit
adds support for "Conflict Resolution", "Conflict Arbiter Indexes",
"Tuples Inserted", "Conflicting Tuples". "Conflict Filter" and "Rows
Removed by Conflict Filter" still are not shown in text plans by this
commit.

7 years agoSupport multi-targetted ModifyTable in plan output in text-style
Kyotaro Horiguchi [Fri, 26 Aug 2016 05:02:51 +0000 (14:02 +0900)]
Support multi-targetted ModifyTable in plan output in text-style

PostgreSQL 9.5 newly supports explicit target table listing for
ModifyTable and pg_store_plans doesn't show such plans sainly in text
style. This doesn't affect JSON, XML, YAML styles of output.

Note: JSON representation lacks information about whether every target
table is a Foreign relation or not so the result of
pg_store_plans_textplan tells as if all target tables are local
relations even if there's remote ones.

7 years agoChange the way to treat nested json-objects
Kyotaro Horiguchi [Fri, 26 Aug 2016 04:47:54 +0000 (13:47 +0900)]
Change the way to treat nested json-objects

Previously the text converting parser assumes that all JSON object are
Plan or a children of Plans but Target Tables breaks the
assumption. This patch changes the way to detect the end of a Plan (or
a child of Plans) cleaner so that it can handle JSON objects other
than Plan.

7 years agoFix text plan representation for sort keys
Kyotaro Horiguchi [Thu, 25 Aug 2016 02:01:05 +0000 (11:01 +0900)]
Fix text plan representation for sort keys

Sort keys are in a list but read as a simple string. As the result
only the last of the list is shown in a text representation. This
commit fixes it.  This patch adds new setter macro LIST_SETTER for
this purpose and Output: is also changed to make use of the macro.

7 years agoAdd I/O Timings in text plan representation
Kyotaro Horiguchi [Thu, 25 Aug 2016 00:32:13 +0000 (09:32 +0900)]
Add I/O Timings in text plan representation

Add I/O Timings which has been forgotten in text representation.

7 years agoAdd JSON item for "Original Hash Buckets"
Kyotaro Horiguchi [Wed, 24 Aug 2016 01:51:38 +0000 (10:51 +0900)]
Add JSON item for "Original Hash Buckets"

The previous version forgot to count that item as known and doesn't
show it in a text plan representation.

7 years agoFix indent calculation
Kyotaro Horiguchi [Thu, 25 Aug 2016 08:36:36 +0000 (17:36 +0900)]
Fix indent calculation

Extra indentation was added at wrong timing. Fixed.

7 years agoFix a misspelling of a function
Kyotaro Horiguchi [Fri, 26 Aug 2016 01:13:31 +0000 (10:13 +0900)]
Fix a misspelling of a function

Fix coverter_core => converter_core.

8 years agoPrepare RPM build environment for PostgreSQL 9.5.
Kyotaro Horiguchi [Wed, 13 Apr 2016 03:00:10 +0000 (12:00 +0900)]
Prepare RPM build environment for PostgreSQL 9.5.

Modified the Makefile and added a SPEC file for PostgreSQL9.5.

8 years agoPrepare for building RPM files. 1.0
Kyotaro Horiguchi [Fri, 9 Oct 2015 07:11:42 +0000 (16:11 +0900)]
Prepare for building RPM files.

Added SPEC file and makefile entry for building RPM files.

8 years agoFix a bug of expression normalizer.
Kyotaro Horiguchi [Fri, 12 Jun 2015 02:33:20 +0000 (11:33 +0900)]
Fix a bug of expression normalizer.

Expression normalizer is intended to remove parentheses directly
surrounding a constant, but the logic was broken somehow, sometime
before the first commit in this repository.

This causes wrong separation of plans which should be regarded as the
same in intention.

8 years agoFix some typos and wrong comments.
Kyotaro Horiguchi [Fri, 12 Jun 2015 02:32:01 +0000 (11:32 +0900)]
Fix some typos and wrong comments.

9 years agoMake compile quiet phase 2
Kyotaro Horiguchi [Fri, 10 Apr 2015 06:27:08 +0000 (15:27 +0900)]
Make compile quiet phase 2

MacOS X Maverics and later offers only LLVM compiler (clang) and it
warns for implicit type conversions between enums. This program uses
some enum types for a member in the same struct type but they cannot
be merged because one of them is defined in PostgreSQL. The situation
is safe as long as an enumeration and a word table are in one-to-one
correspondence so I decided to change the type of the member to
integer. This change make the commit
78415c006cd24f41d722a41014c526b43731968f useless so it is reverted
along with this commit.

Reported by Fujii Masao.

9 years agoAdd documentation
Kyotaro Horiguchi [Fri, 3 Apr 2015 05:36:42 +0000 (14:36 +0900)]
Add documentation

9 years agoMake compiler quiet.
Kyotaro Horiguchi [Fri, 3 Apr 2015 05:29:25 +0000 (14:29 +0900)]
Make compiler quiet.

Gcc 4.6.3 complains for comarison between pgsp_strategies and
pgsp_prop_tags so replaced them with switch construct.

9 years agoAdd file headers.
Kyotaro Horiguchi [Fri, 3 Apr 2015 05:13:01 +0000 (14:13 +0900)]
Add file headers.

As the preparation for publication, added headers to every source
files.

9 years agoFollow the change in 9.5dev.
Kyotaro Horiguchi [Tue, 10 Feb 2015 03:43:58 +0000 (12:43 +0900)]
Follow the change in 9.5dev.

In 9.5, the way to initialize ExplainState has been changed. The new
function NewExplainState() takes in the function of old
ExplainInitState(). I decided to follow the code to the 9.5 manner and
make the equivelant of the new function for the older versions.

9 years agoFix the wrong measure for the change in ExplainState.
Kyotaro Horiguchi [Tue, 10 Feb 2015 00:37:10 +0000 (09:37 +0900)]
Fix the wrong measure for the change in ExplainState.

The fix made in the commit 6819c84350ea599988440c5c07becfe56c71723a is
not appropriate according to its objective. The correct fix for the
change is translating es->extra as "List *grouping_stack" in the
versions 9.3.6, 9.4.1 and their successors. This secure the binary
comaptibility throughout minor PG versions.

9 years agoFix a typo in test script.
Kyotaro Horiguchi [Mon, 9 Feb 2015 10:38:20 +0000 (19:38 +0900)]
Fix a typo in test script.

This change affects test script but doesn't affect the test result, so
I don't regenerae test scripts including this change. It will be fixed
at the next chance to regenerate the testset.

9 years agoFix typo of WorkTable Scan.
Kyotaro Horiguchi [Mon, 9 Feb 2015 10:35:26 +0000 (19:35 +0900)]
Fix typo of WorkTable Scan.

The node WorkTable Scan was not properly handled by silly typo. Fixed
it. And test script was regenerated so many unstable portions of it is
changed.

9 years agoMask constants of sort key value.
Kyotaro Horiguchi [Mon, 9 Feb 2015 10:19:47 +0000 (19:19 +0900)]
Mask constants of sort key value.

Expressions in plan properties are normalized by replacing constants
with '?' in them. Sort key was forgotten to do so.

9 years agoAdd new explain properties.
Kyotaro Horiguchi [Mon, 9 Feb 2015 10:13:18 +0000 (19:13 +0900)]
Add new explain properties.

Added new plan property node Planning Time, Execution Time, Exact Heap
Blocks, Lossy Heap Blocks and Rows Removed by Join Filter which were
ignored.

9 years agoFollow the change of ExplainState.
Kyotaro Horiguchi [Mon, 9 Feb 2015 03:01:36 +0000 (12:01 +0900)]
Follow the change of ExplainState.

ExplainState was changed at 9.4.1 and 9.3.6. This change breaks where
using es->grouping_stack so change the way to access it so that one
source supports both before and after the change was made. After all,
for instance, PG 9.4.0 and 9.4.1 cannot be able to share the same
pg_store_plans binary.

9 years agoSafely exit from json parser with chopped representations.
Kyotaro Horiguchi [Fri, 3 Apr 2015 06:07:52 +0000 (15:07 +0900)]
Safely exit from json parser with chopped representations.

JSON plan strings can be chopped halfway from the limitation in the
storage. This fix make the JSON parser to handle it safely.

9 years agoBug fix for text representation when log_timing = off
Kyotaro Horiguchi [Fri, 25 Apr 2014 05:54:17 +0000 (14:54 +0900)]
Bug fix for text representation when log_timing = off

plan structure don't have actual timings if log_timing is turned
off. This should be safely skipped.

9 years agoMask more unplivileged columns in pg_store_plans view.
Kyotaro Horiguchi [Fri, 25 Apr 2014 05:54:02 +0000 (14:54 +0900)]
Mask more unplivileged columns in pg_store_plans view.

queryid, planid and queryid_stmt were newly masked for unplivileged
users following pg_stat_statements.

9 years agoAdded test for unknown JSON field names.
Kyotaro Horiguchi [Thu, 3 Apr 2014 05:37:20 +0000 (14:37 +0900)]
Added test for unknown JSON field names.

Added the test for handling of unknown JSON field names. Regeneration
of test script made changes which are not significant in many other
places.

9 years agoAdd regtests for plan storage.
Kyotaro Horiguchi [Thu, 3 Apr 2014 05:17:28 +0000 (14:17 +0900)]
Add regtests for plan storage.

9 years agoRemove useless debug print.
Kyotaro Horiguchi [Fri, 3 Apr 2015 05:49:44 +0000 (14:49 +0900)]
Remove useless debug print.

9 years agoRename module to pg_store_plans
Kyotaro Horiguchi [Mon, 24 Mar 2014 06:40:18 +0000 (15:40 +0900)]
Rename module to pg_store_plans