pgsql: Revise parse tree representation for VACUUM and ANALYZE.

Started by Robert Haasover 7 years ago7 messagescomitters
Jump to latest
#1Robert Haas
robertmhaas@gmail.com

Revise parse tree representation for VACUUM and ANALYZE.

Like commit f41551f61f9cf4eedd5b7173f985a3bdb4d9858c, this aims
to make it easier to add non-Boolean options to VACUUM (or, in
this case, to ANALYZE). Instead of building up a bitmap of
options directly in the parser, build up a list of DefElem
objects and let ExecVacuum() sort it out; right now, we make
no use of the fact that a DefElem can carry an associated value,
but it will be easy to make that change in the future.

Masahiko Sawada

Discussion: /messages/by-id/CAD21AoATE4sn0jFFH3NcfUZXkU2BMbjBWB_kDj-XWYA-LXDcQA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6776142a07afb4c28961f27059d800196902f5f1

Modified Files
--------------
src/backend/commands/vacuum.c | 52 ++++++++++++++++----
src/backend/parser/gram.y | 94 ++++++++++++++++--------------------
src/backend/tcop/utility.c | 6 +--
src/include/commands/vacuum.h | 17 ++++++-
src/include/nodes/parsenodes.h | 26 +++-------
src/test/regress/expected/vacuum.out | 6 ++-
src/test/regress/sql/vacuum.sql | 1 +
7 files changed, 116 insertions(+), 86 deletions(-)

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Robert Haas (#1)
Re: pgsql: Revise parse tree representation for VACUUM and ANALYZE.

Robert Haas <rhaas@postgresql.org> writes:

Revise parse tree representation for VACUUM and ANALYZE.

The buildfarm's not too happy with this, which I suspect traces
to the fact that you neglected to fix copyfuncs.c and equalfuncs.c.

regards, tom lane

#3Michael Paquier
michael@paquier.xyz
In reply to: Tom Lane (#2)
Re: pgsql: Revise parse tree representation for VACUUM and ANALYZE.

On Mon, Mar 18, 2019 at 09:53:23PM -0400, Tom Lane wrote:

The buildfarm's not too happy with this, which I suspect traces
to the fact that you neglected to fix copyfuncs.c and equalfuncs.c.

If you use -DDCOPY_PARSE_PLAN_TREES -DRAW_EXPRESSION_COVERAGE_TEST, I
am pretty sure that you will be able to reproduce those failures. See
calliphoridae (still don't know how to pronounce that without
wikipedia-sensei):
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=calliphoridae&amp;dt=2019-03-18%2022%3A19%3A24
--
Michael

#4Masahiko Sawada
sawada.mshk@gmail.com
In reply to: Michael Paquier (#3)
Re: pgsql: Revise parse tree representation for VACUUM and ANALYZE.

On Tue, Mar 19, 2019 at 11:01 AM Michael Paquier <michael@paquier.xyz> wrote:

On Mon, Mar 18, 2019 at 09:53:23PM -0400, Tom Lane wrote:

The buildfarm's not too happy with this, which I suspect traces
to the fact that you neglected to fix copyfuncs.c and equalfuncs.c.

If you use -DDCOPY_PARSE_PLAN_TREES -DRAW_EXPRESSION_COVERAGE_TEST, I
am pretty sure that you will be able to reproduce those failures.

Thank you for the information. I'll test with that options before
submitting a patch.

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Masahiko Sawada (#4)
Re: pgsql: Revise parse tree representation for VACUUM and ANALYZE.

Masahiko Sawada <sawada.mshk@gmail.com> writes:

On Tue, Mar 19, 2019 at 11:01 AM Michael Paquier <michael@paquier.xyz> wrote:

On Mon, Mar 18, 2019 at 09:53:23PM -0400, Tom Lane wrote:

The buildfarm's not too happy with this, which I suspect traces
to the fact that you neglected to fix copyfuncs.c and equalfuncs.c.

If you use -DDCOPY_PARSE_PLAN_TREES -DRAW_EXPRESSION_COVERAGE_TEST, I
am pretty sure that you will be able to reproduce those failures.

Thank you for the information. I'll test with that options before
submitting a patch.

You shouldn't really have needed the buildfarm to point you to doing
that. *Any* change to Node structures requires looking into the
backend/node/ files, i.e. copyfuncs.c, equalfuncs.c, outfuncs.c,
readfuncs.c, nodeFuncs.c. There are some classes of Nodes that
can get away without coverage in one or more of those, but certainly
if you're changing an existing Node struct you should just grep to
see if what you're changing is already mentioned in there.

(I tend to just grep the entire tree, if practical, for references
to a node structure that I'm changing.)

regards, tom lane

#6Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Michael Paquier (#3)
Re: pgsql: Revise parse tree representation for VACUUM and ANALYZE.

On 2019-Mar-19, Michael Paquier wrote:

See calliphoridae (still don't know how to pronounce that without
wikipedia-sensei):

We already discussed this one, remember? Anyway, I've avoided Latin
names in further animals to forestall this problem.

--
�lvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

#7Michael Paquier
michael@paquier.xyz
In reply to: Alvaro Herrera (#6)
Re: pgsql: Revise parse tree representation for VACUUM and ANALYZE.

On Tue, Mar 19, 2019 at 11:09:25AM -0300, Alvaro Herrera wrote:

We already discussed this one, remember? Anyway, I've avoided Latin
names in further animals to forestall this problem.

Of course I remember! Not being able to remember how to spell that is
another problem, and my own issue :)
--
Michael