public inbox for [email protected]help / color / mirror / Atom feed
Re: Add proper planner support for ORDER BY / DISTINCT aggregates 23+ messages / 5 participants [nested] [flat]
* Re: Add proper planner support for ORDER BY / DISTINCT aggregates @ 2023-01-18 09:49 David Rowley <[email protected]> 0 siblings, 1 reply; 23+ messages in thread From: David Rowley @ 2023-01-18 09:49 UTC (permalink / raw) To: Richard Guo <[email protected]>; +Cc: Tom Lane <[email protected]>; Dean Rasheed <[email protected]>; Ronan Dunklau <[email protected]>; Justin Pryzby <[email protected]>; Pavel Luzanov <[email protected]>; [email protected]; Ranier Vilela <[email protected]> On Wed, 18 Jan 2023 at 22:37, Richard Guo <[email protected]> wrote: > I'm still confused that when the same scenario happens with ORDER BY in > an aggregate function, like in query 1, the result is different in that > we would get an unsorted output. > > I wonder if we should avoid this inconsistent behavior. It certainly seems pretty strange that aggregates with an ORDER BY behave differently from the query's ORDER BY. I'd have expected that to be the same. I've not looked to see why there's a difference, but suspect that we thought about how we want it to work for the query's ORDER BY and when ORDER BY aggregates were added, that behaviour was not considered. Likely finding the code or location where that code should be would help us understand if something was just forgotten in the aggregate's case. It's probably another question as to if we should be adjusting this behaviour now. David ^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: Add proper planner support for ORDER BY / DISTINCT aggregates @ 2023-01-18 10:52 Dean Rasheed <[email protected]> parent: David Rowley <[email protected]> 0 siblings, 1 reply; 23+ messages in thread From: Dean Rasheed @ 2023-01-18 10:52 UTC (permalink / raw) To: David Rowley <[email protected]>; +Cc: Richard Guo <[email protected]>; Tom Lane <[email protected]>; Ronan Dunklau <[email protected]>; Justin Pryzby <[email protected]>; Pavel Luzanov <[email protected]>; [email protected]; Ranier Vilela <[email protected]> On Wed, 18 Jan 2023 at 09:49, David Rowley <[email protected]> wrote: > > On Wed, 18 Jan 2023 at 22:37, Richard Guo <[email protected]> wrote: > > I'm still confused that when the same scenario happens with ORDER BY in > > an aggregate function, like in query 1, the result is different in that > > we would get an unsorted output. > > > > I wonder if we should avoid this inconsistent behavior. > > It certainly seems pretty strange that aggregates with an ORDER BY > behave differently from the query's ORDER BY. I'd have expected that > to be the same. I've not looked to see why there's a difference, but > suspect that we thought about how we want it to work for the query's > ORDER BY and when ORDER BY aggregates were added, that behaviour was > not considered. > I think the behaviour of an ORDER BY in the query can also be pretty surprising. For example, consider: SELECT ARRAY[random(), random(), random()] FROM generate_series(1, 3); array ------------------------------------------------------------- {0.2335800863701647,0.14688842754711273,0.2975659224823368} {0.10616525384762876,0.8371175798972244,0.2936178886154661} {0.21679841321788262,0.5254761982948826,0.7789412240118161} (3 rows) which produces 9 different random values, as expected, and compare that to: SELECT ARRAY[random(), random(), random()] FROM generate_series(1, 3) ORDER BY random(); array --------------------------------------------------------------- {0.01952216253949679,0.01952216253949679,0.01952216253949679} {0.6735145595500629,0.6735145595500629,0.6735145595500629} {0.9406665780147616,0.9406665780147616,0.9406665780147616} (3 rows) which now only has 3 distinct random values. It's pretty counterintuitive that adding an ORDER BY clause changes the contents of the rows returned, not just their order. The trouble is, if we tried to fix that, we'd risk changing some other behaviour that users may have come to rely on. Regards, Dean ^ permalink raw reply [nested|flat] 23+ messages in thread
* Re: Add proper planner support for ORDER BY / DISTINCT aggregates @ 2023-01-18 15:46 Tom Lane <[email protected]> parent: Dean Rasheed <[email protected]> 0 siblings, 0 replies; 23+ messages in thread From: Tom Lane @ 2023-01-18 15:46 UTC (permalink / raw) To: Dean Rasheed <[email protected]>; +Cc: David Rowley <[email protected]>; Richard Guo <[email protected]>; Ronan Dunklau <[email protected]>; Justin Pryzby <[email protected]>; Pavel Luzanov <[email protected]>; [email protected]; Ranier Vilela <[email protected]> Dean Rasheed <[email protected]> writes: > I think the behaviour of an ORDER BY in the query can also be pretty > surprising. Indeed. The fundamental question is this: in > SELECT ARRAY[random(), random(), random()] > FROM generate_series(1, 3) > ORDER BY random(); are those four occurrences of random() supposed to refer to the same value, or not? This only matters for volatile functions of course; with stable or immutable functions, textually-equal subexpressions should have the same value in any given row. It is very clear what we are supposed to do for SELECT random() FROM ... ORDER BY 1; which sadly isn't legal SQL anymore. It gets fuzzy as soon as we have SELECT random() FROM ... ORDER BY random(); You could make an argument either way for those being the same value or not, but historically we've concluded that it's more useful to deem them the same value. Then the behavior you show is not such a surprising extension, although it could be argued that such matches should only extend to identical top-level targetlist entries. > The trouble is, if we tried to fix that, we'd risk changing some other > behaviour that users may have come to rely on. Yeah. I'm hesitant to try to adjust semantics here; we're much more likely to get complaints than kudos. regards, tom lane ^ permalink raw reply [nested|flat] 23+ messages in thread
* [PATCH v2 3/4] expand binaryheap api @ 2023-07-20 16:52 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 23+ messages in thread From: Nathan Bossart @ 2023-07-20 16:52 UTC (permalink / raw) --- src/common/binaryheap.c | 28 ++++++++++++++++++++++++++++ src/include/lib/binaryheap.h | 3 +++ 2 files changed, 31 insertions(+) diff --git a/src/common/binaryheap.c b/src/common/binaryheap.c index 7a590eec4a..526e56bbd0 100644 --- a/src/common/binaryheap.c +++ b/src/common/binaryheap.c @@ -211,6 +211,34 @@ binaryheap_remove_first(binaryheap *heap) return result; } +/* + * binaryheap_remove_node + * + * Removes the given node from the heap. O(log n) worst case. + */ +void +binaryheap_remove_node(binaryheap *heap, int n) +{ + int cmp; + + Assert(!binaryheap_empty(heap) && heap->bh_has_heap_property); + Assert(n >= 0 && n < heap->bh_size); + + /* compare last node to the one that is being removed */ + cmp = heap->bh_compare(heap->bh_nodes[--heap->bh_size], + heap->bh_nodes[n], + heap->bh_arg); + + /* remove the last node, placing it in the vacated entry */ + heap->bh_nodes[n] = heap->bh_nodes[heap->bh_size]; + + /* sift as needed to preserve the heap property */ + if (cmp > 0) + sift_up(heap, n); + else if (cmp < 0) + sift_down(heap, n); +} + /* * binaryheap_replace_first * diff --git a/src/include/lib/binaryheap.h b/src/include/lib/binaryheap.h index 06e3878cf7..9f09aff29f 100644 --- a/src/include/lib/binaryheap.h +++ b/src/include/lib/binaryheap.h @@ -76,8 +76,11 @@ extern void binaryheap_build(binaryheap *heap); extern void binaryheap_add(binaryheap *heap, Datum d); extern Datum binaryheap_first(binaryheap *heap); extern Datum binaryheap_remove_first(binaryheap *heap); +extern void binaryheap_remove_node(binaryheap *heap, int n); extern void binaryheap_replace_first(binaryheap *heap, Datum d); #define binaryheap_empty(h) ((h)->bh_size == 0) +#define binaryheap_size(h) ((h)->bh_size) +#define binaryheap_get_node(h, n) ((h)->bh_nodes[n]) #endif /* BINARYHEAP_H */ -- 2.25.1 --qDbXVdCdHGoSgWSk Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v2-0004-use-priority-queue-for-pg_restore-ready_list.patch" ^ permalink raw reply [nested|flat] 23+ messages in thread
* [PATCH v3 7/7] Allow to print raw parse tree. @ 2023-07-26 10:49 Tatsuo Ishii <[email protected]> 0 siblings, 0 replies; 23+ messages in thread From: Tatsuo Ishii @ 2023-07-26 10:49 UTC (permalink / raw) --- src/backend/tcop/postgres.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 36cc99ec9c..c01e90f735 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -653,6 +653,10 @@ pg_parse_query(const char *query_string) } #endif + if (Debug_print_parse) + elog_node_display(LOG, "raw parse tree", raw_parsetree_list, + Debug_pretty_print); + TRACE_POSTGRESQL_QUERY_PARSE_DONE(query_string); return raw_parsetree_list; -- 2.25.1 ----Next_Part(Wed_Jul_26_21_21_34_2023_317)---- ^ permalink raw reply [nested|flat] 23+ messages in thread
* [PATCH v4 7/7] Allow to print raw parse tree. @ 2023-08-09 07:56 Tatsuo Ishii <[email protected]> 0 siblings, 0 replies; 23+ messages in thread From: Tatsuo Ishii @ 2023-08-09 07:56 UTC (permalink / raw) --- src/backend/tcop/postgres.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 36cc99ec9c..c01e90f735 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -653,6 +653,10 @@ pg_parse_query(const char *query_string) } #endif + if (Debug_print_parse) + elog_node_display(LOG, "raw parse tree", raw_parsetree_list, + Debug_pretty_print); + TRACE_POSTGRESQL_QUERY_PARSE_DONE(query_string); return raw_parsetree_list; -- 2.25.1 ----Next_Part(Wed_Aug__9_17_41_12_2023_134)---- ^ permalink raw reply [nested|flat] 23+ messages in thread
* [PATCH v5 7/7] Allow to print raw parse tree. @ 2023-09-02 06:32 Tatsuo Ishii <[email protected]> 0 siblings, 0 replies; 23+ messages in thread From: Tatsuo Ishii @ 2023-09-02 06:32 UTC (permalink / raw) --- src/backend/tcop/postgres.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index e4756f8be2..fc8efa915b 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -653,6 +653,10 @@ pg_parse_query(const char *query_string) } #endif + if (Debug_print_parse) + elog_node_display(LOG, "raw parse tree", raw_parsetree_list, + Debug_pretty_print); + TRACE_POSTGRESQL_QUERY_PARSE_DONE(query_string); return raw_parsetree_list; -- 2.25.1 ----Next_Part(Sat_Sep__2_15_52_35_2023_273)---- ^ permalink raw reply [nested|flat] 23+ messages in thread
* [PATCH v6 7/7] Allow to print raw parse tree. @ 2023-09-12 05:22 Tatsuo Ishii <[email protected]> 0 siblings, 0 replies; 23+ messages in thread From: Tatsuo Ishii @ 2023-09-12 05:22 UTC (permalink / raw) --- src/backend/tcop/postgres.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 21b9763183..3e3653816e 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -651,6 +651,10 @@ pg_parse_query(const char *query_string) } #endif + if (Debug_print_parse) + elog_node_display(LOG, "raw parse tree", raw_parsetree_list, + Debug_pretty_print); + TRACE_POSTGRESQL_QUERY_PARSE_DONE(query_string); return raw_parsetree_list; -- 2.25.1 ----Next_Part(Tue_Sep_12_15_18_43_2023_359)---- ^ permalink raw reply [nested|flat] 23+ messages in thread
* [PATCH v7 7/7] Allow to print raw parse tree. @ 2023-09-22 04:53 Tatsuo Ishii <[email protected]> 0 siblings, 0 replies; 23+ messages in thread From: Tatsuo Ishii @ 2023-09-22 04:53 UTC (permalink / raw) --- src/backend/tcop/postgres.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 21b9763183..3e3653816e 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -651,6 +651,10 @@ pg_parse_query(const char *query_string) } #endif + if (Debug_print_parse) + elog_node_display(LOG, "raw parse tree", raw_parsetree_list, + Debug_pretty_print); + TRACE_POSTGRESQL_QUERY_PARSE_DONE(query_string); return raw_parsetree_list; -- 2.25.1 ----Next_Part(Fri_Sep_22_14_16_40_2023_530)---- ^ permalink raw reply [nested|flat] 23+ messages in thread
* [PATCH v8 7/7] Allow to print raw parse tree. @ 2023-09-25 05:01 Tatsuo Ishii <[email protected]> 0 siblings, 0 replies; 23+ messages in thread From: Tatsuo Ishii @ 2023-09-25 05:01 UTC (permalink / raw) --- src/backend/tcop/postgres.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 21b9763183..3e3653816e 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -651,6 +651,10 @@ pg_parse_query(const char *query_string) } #endif + if (Debug_print_parse) + elog_node_display(LOG, "raw parse tree", raw_parsetree_list, + Debug_pretty_print); + TRACE_POSTGRESQL_QUERY_PARSE_DONE(query_string); return raw_parsetree_list; -- 2.25.1 ----Next_Part(Mon_Sep_25_14_26_30_2023_752)---- ^ permalink raw reply [nested|flat] 23+ messages in thread
* [PATCH v9 7/7] Allow to print raw parse tree. @ 2023-10-04 05:51 Tatsuo Ishii <[email protected]> 0 siblings, 0 replies; 23+ messages in thread From: Tatsuo Ishii @ 2023-10-04 05:51 UTC (permalink / raw) --- src/backend/tcop/postgres.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 21b9763183..3e3653816e 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -651,6 +651,10 @@ pg_parse_query(const char *query_string) } #endif + if (Debug_print_parse) + elog_node_display(LOG, "raw parse tree", raw_parsetree_list, + Debug_pretty_print); + TRACE_POSTGRESQL_QUERY_PARSE_DONE(query_string); return raw_parsetree_list; -- 2.25.1 ----Next_Part(Wed_Oct__4_15_03_28_2023_821)---- ^ permalink raw reply [nested|flat] 23+ messages in thread
* [PATCH v10 7/7] Allow to print raw parse tree. @ 2023-10-22 02:22 Tatsuo Ishii <[email protected]> 0 siblings, 0 replies; 23+ messages in thread From: Tatsuo Ishii @ 2023-10-22 02:22 UTC (permalink / raw) --- src/backend/tcop/postgres.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index c900427ecf..fa5d862604 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -652,6 +652,10 @@ pg_parse_query(const char *query_string) } #endif + if (Debug_print_parse) + elog_node_display(LOG, "raw parse tree", raw_parsetree_list, + Debug_pretty_print); + TRACE_POSTGRESQL_QUERY_PARSE_DONE(query_string); return raw_parsetree_list; -- 2.25.1 ----Next_Part(Sun_Oct_22_11_39_20_2023_140)---- ^ permalink raw reply [nested|flat] 23+ messages in thread
* [PATCH v11 7/7] Allow to print raw parse tree. @ 2023-11-08 06:57 Tatsuo Ishii <[email protected]> 0 siblings, 0 replies; 23+ messages in thread From: Tatsuo Ishii @ 2023-11-08 06:57 UTC (permalink / raw) --- src/backend/tcop/postgres.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 6a070b5d8c..beb528f526 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -652,6 +652,10 @@ pg_parse_query(const char *query_string) } #endif + if (Debug_print_parse) + elog_node_display(LOG, "raw parse tree", raw_parsetree_list, + Debug_pretty_print); + TRACE_POSTGRESQL_QUERY_PARSE_DONE(query_string); return raw_parsetree_list; -- 2.25.1 ----Next_Part(Wed_Nov__8_16_37_05_2023_872)---- ^ permalink raw reply [nested|flat] 23+ messages in thread
* [PATCH v12 7/7] Allow to print raw parse tree. @ 2023-12-04 11:23 Tatsuo Ishii <[email protected]> 0 siblings, 0 replies; 23+ messages in thread From: Tatsuo Ishii @ 2023-12-04 11:23 UTC (permalink / raw) --- src/backend/tcop/postgres.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 7298a187d1..b43afad0be 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -652,6 +652,10 @@ pg_parse_query(const char *query_string) } #endif + if (Debug_print_parse) + elog_node_display(LOG, "raw parse tree", raw_parsetree_list, + Debug_pretty_print); + TRACE_POSTGRESQL_QUERY_PARSE_DONE(query_string); return raw_parsetree_list; -- 2.25.1 ----Next_Part(Fri_Dec__8_10_16_13_2023_489)---- ^ permalink raw reply [nested|flat] 23+ messages in thread
* [PATCH v13 8/8] Allow to print raw parse tree. @ 2024-01-22 09:45 Tatsuo Ishii <[email protected]> 0 siblings, 0 replies; 23+ messages in thread From: Tatsuo Ishii @ 2024-01-22 09:45 UTC (permalink / raw) --- src/backend/tcop/postgres.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 1a34bd3715..68f5cf3667 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -652,6 +652,10 @@ pg_parse_query(const char *query_string) } #endif + if (Debug_print_parse) + elog_node_display(LOG, "raw parse tree", raw_parsetree_list, + Debug_pretty_print); + TRACE_POSTGRESQL_QUERY_PARSE_DONE(query_string); return raw_parsetree_list; -- 2.25.1 ----Next_Part(Mon_Jan_22_19_26_18_2024_011)---- ^ permalink raw reply [nested|flat] 23+ messages in thread
* [PATCH v14 8/8] Allow to print raw parse tree. @ 2024-02-28 13:59 Tatsuo Ishii <[email protected]> 0 siblings, 0 replies; 23+ messages in thread From: Tatsuo Ishii @ 2024-02-28 13:59 UTC (permalink / raw) --- src/backend/tcop/postgres.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 59ab812d2e..e433ddafe0 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -652,6 +652,10 @@ pg_parse_query(const char *query_string) } #endif + if (Debug_print_parse) + elog_node_display(LOG, "raw parse tree", raw_parsetree_list, + Debug_pretty_print); + TRACE_POSTGRESQL_QUERY_PARSE_DONE(query_string); return raw_parsetree_list; -- 2.25.1 ----Next_Part(Thu_Feb_29_09_19_54_2024_640)---- ^ permalink raw reply [nested|flat] 23+ messages in thread
* [PATCH v15 8/8] Allow to print raw parse tree. @ 2024-03-28 10:30 Tatsuo Ishii <[email protected]> 0 siblings, 0 replies; 23+ messages in thread From: Tatsuo Ishii @ 2024-03-28 10:30 UTC (permalink / raw) --- src/backend/tcop/postgres.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 76f48b13d2..b93000adc4 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -653,6 +653,10 @@ pg_parse_query(const char *query_string) } #endif + if (Debug_print_parse) + elog_node_display(LOG, "raw parse tree", raw_parsetree_list, + Debug_pretty_print); + TRACE_POSTGRESQL_QUERY_PARSE_DONE(query_string); return raw_parsetree_list; -- 2.25.1 ----Next_Part(Thu_Mar_28_19_59_25_2024_076)---- ^ permalink raw reply [nested|flat] 23+ messages in thread
* [PATCH v16 8/8] Allow to print raw parse tree. @ 2024-04-12 06:49 Tatsuo Ishii <[email protected]> 0 siblings, 0 replies; 23+ messages in thread From: Tatsuo Ishii @ 2024-04-12 06:49 UTC (permalink / raw) --- src/backend/tcop/postgres.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 76f48b13d2..b93000adc4 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -653,6 +653,10 @@ pg_parse_query(const char *query_string) } #endif + if (Debug_print_parse) + elog_node_display(LOG, "raw parse tree", raw_parsetree_list, + Debug_pretty_print); + TRACE_POSTGRESQL_QUERY_PARSE_DONE(query_string); return raw_parsetree_list; -- 2.25.1 ----Next_Part(Fri_Apr_12_16_09_08_2024_262)---- ^ permalink raw reply [nested|flat] 23+ messages in thread
* [PATCH v17 8/8] Allow to print raw parse tree. @ 2024-04-28 11:00 Tatsuo Ishii <[email protected]> 0 siblings, 0 replies; 23+ messages in thread From: Tatsuo Ishii @ 2024-04-28 11:00 UTC (permalink / raw) --- src/backend/tcop/postgres.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 2dff28afce..db6e91f5d6 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -653,6 +653,10 @@ pg_parse_query(const char *query_string) } #endif + if (Debug_print_parse) + elog_node_display(LOG, "raw parse tree", raw_parsetree_list, + Debug_pretty_print); + TRACE_POSTGRESQL_QUERY_PARSE_DONE(query_string); return raw_parsetree_list; -- 2.25.1 ----Next_Part(Sun_Apr_28_20_28_26_2024_444)---- ^ permalink raw reply [nested|flat] 23+ messages in thread
* [PATCH v18 8/8] Allow to print raw parse tree. @ 2024-05-11 07:11 Tatsuo Ishii <[email protected]> 0 siblings, 0 replies; 23+ messages in thread From: Tatsuo Ishii @ 2024-05-11 07:11 UTC (permalink / raw) --- src/backend/tcop/postgres.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 2dff28afce..db6e91f5d6 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -653,6 +653,10 @@ pg_parse_query(const char *query_string) } #endif + if (Debug_print_parse) + elog_node_display(LOG, "raw parse tree", raw_parsetree_list, + Debug_pretty_print); + TRACE_POSTGRESQL_QUERY_PARSE_DONE(query_string); return raw_parsetree_list; -- 2.25.1 ----Next_Part(Sat_May_11_16_23_07_2024_789)---- ^ permalink raw reply [nested|flat] 23+ messages in thread
* [PATCH v19 8/8] Allow to print raw parse tree. @ 2024-05-14 23:26 Tatsuo Ishii <[email protected]> 0 siblings, 0 replies; 23+ messages in thread From: Tatsuo Ishii @ 2024-05-14 23:26 UTC (permalink / raw) --- src/backend/tcop/postgres.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 2dff28afce..db6e91f5d6 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -653,6 +653,10 @@ pg_parse_query(const char *query_string) } #endif + if (Debug_print_parse) + elog_node_display(LOG, "raw parse tree", raw_parsetree_list, + Debug_pretty_print); + TRACE_POSTGRESQL_QUERY_PARSE_DONE(query_string); return raw_parsetree_list; -- 2.25.1 ----Next_Part(Wed_May_15_09_02_03_2024_008)---- ^ permalink raw reply [nested|flat] 23+ messages in thread
* [PATCH v20 8/8] Allow to print raw parse tree. @ 2024-05-24 02:26 Tatsuo Ishii <[email protected]> 0 siblings, 0 replies; 23+ messages in thread From: Tatsuo Ishii @ 2024-05-24 02:26 UTC (permalink / raw) --- src/backend/tcop/postgres.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 45a3794b8e..ecbf8e7999 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -653,6 +653,10 @@ pg_parse_query(const char *query_string) } #endif + if (Debug_print_parse) + elog_node_display(LOG, "raw parse tree", raw_parsetree_list, + Debug_pretty_print); + TRACE_POSTGRESQL_QUERY_PARSE_DONE(query_string); return raw_parsetree_list; -- 2.25.1 ----Next_Part(Fri_May_24_11_39_19_2024_763)---- ^ permalink raw reply [nested|flat] 23+ messages in thread
* [PATCH v21 8/8] Allow to print raw parse tree. @ 2024-08-26 04:32 Tatsuo Ishii <[email protected]> 0 siblings, 0 replies; 23+ messages in thread From: Tatsuo Ishii @ 2024-08-26 04:32 UTC (permalink / raw) --- src/backend/tcop/postgres.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 8bc6bea113..f15659bf2b 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -659,6 +659,10 @@ pg_parse_query(const char *query_string) #endif /* DEBUG_NODE_TESTS_ENABLED */ + if (Debug_print_parse) + elog_node_display(LOG, "raw parse tree", raw_parsetree_list, + Debug_pretty_print); + TRACE_POSTGRESQL_QUERY_PARSE_DONE(query_string); return raw_parsetree_list; -- 2.25.1 ----Next_Part(Mon_Aug_26_13_39_47_2024_878)---- ^ permalink raw reply [nested|flat] 23+ messages in thread
end of thread, other threads:[~2024-08-26 04:32 UTC | newest] Thread overview: 23+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2023-01-18 09:49 Re: Add proper planner support for ORDER BY / DISTINCT aggregates David Rowley <[email protected]> 2023-01-18 10:52 ` Dean Rasheed <[email protected]> 2023-01-18 15:46 ` Tom Lane <[email protected]> 2023-07-20 16:52 [PATCH v2 3/4] expand binaryheap api Nathan Bossart <[email protected]> 2023-07-26 10:49 [PATCH v3 7/7] Allow to print raw parse tree. Tatsuo Ishii <[email protected]> 2023-08-09 07:56 [PATCH v4 7/7] Allow to print raw parse tree. Tatsuo Ishii <[email protected]> 2023-09-02 06:32 [PATCH v5 7/7] Allow to print raw parse tree. Tatsuo Ishii <[email protected]> 2023-09-12 05:22 [PATCH v6 7/7] Allow to print raw parse tree. Tatsuo Ishii <[email protected]> 2023-09-22 04:53 [PATCH v7 7/7] Allow to print raw parse tree. Tatsuo Ishii <[email protected]> 2023-09-25 05:01 [PATCH v8 7/7] Allow to print raw parse tree. Tatsuo Ishii <[email protected]> 2023-10-04 05:51 [PATCH v9 7/7] Allow to print raw parse tree. Tatsuo Ishii <[email protected]> 2023-10-22 02:22 [PATCH v10 7/7] Allow to print raw parse tree. Tatsuo Ishii <[email protected]> 2023-11-08 06:57 [PATCH v11 7/7] Allow to print raw parse tree. Tatsuo Ishii <[email protected]> 2023-12-04 11:23 [PATCH v12 7/7] Allow to print raw parse tree. Tatsuo Ishii <[email protected]> 2024-01-22 09:45 [PATCH v13 8/8] Allow to print raw parse tree. Tatsuo Ishii <[email protected]> 2024-02-28 13:59 [PATCH v14 8/8] Allow to print raw parse tree. Tatsuo Ishii <[email protected]> 2024-03-28 10:30 [PATCH v15 8/8] Allow to print raw parse tree. Tatsuo Ishii <[email protected]> 2024-04-12 06:49 [PATCH v16 8/8] Allow to print raw parse tree. Tatsuo Ishii <[email protected]> 2024-04-28 11:00 [PATCH v17 8/8] Allow to print raw parse tree. Tatsuo Ishii <[email protected]> 2024-05-11 07:11 [PATCH v18 8/8] Allow to print raw parse tree. Tatsuo Ishii <[email protected]> 2024-05-14 23:26 [PATCH v19 8/8] Allow to print raw parse tree. Tatsuo Ishii <[email protected]> 2024-05-24 02:26 [PATCH v20 8/8] Allow to print raw parse tree. Tatsuo Ishii <[email protected]> 2024-08-26 04:32 [PATCH v21 8/8] Allow to print raw parse tree. Tatsuo Ishii <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox