Find query characters in respect of optimizer for develop purpose - Mailing list pgsql-hackers

From Andy Fan
Subject Find query characters in respect of optimizer for develop purpose
Date
Msg-id CAKU4AWr83NNdjj8hzD4fmJdP5HTxYXFkRt_KbgE0dkojzTJVNw@mail.gmail.com
Whole thread Raw
Responses Re: Find query characters in respect of optimizer for develop purpose  (Melanie Plageman <melanieplageman@gmail.com>)
List pgsql-hackers
Hello:

Before I want to pay attention to some optimizer features, I want to
estimate how much benefits it can create for customers, at least for our current
running customer. So I want to have some basic idea what kind of the query is
running now in respect of optimizer.  


My basic is we can track it with the below struct(every backend has one global 
variable to record it).

+typedef struct
+{
+       int     subplan_count;
+       int     subquery_count;
+       int join_count;
+       bool hasagg;
+       bool hasgroup;
+} QueryCharacters;

it will be reset at the beginning of standard_planner, and the values are
increased at  make_subplan, set_subquery_pathlist, make_one_rel,
create_grouping_paths. later it can be tracked and viewed in
pg_stat_statements.


What do you think about the requirement and the method I am thinking? Any
kind of feedback is welcome.


--
Best Regards
Andy Fan

pgsql-hackers by date:

Previous
From: Greg Nancarrow
Date:
Subject: Re: Libpq support to connect to standby server as priority
Next
From: Masahiko Sawada
Date:
Subject: Re: Fix a typo in slot.c