Skip to content

Commit

Permalink
Merge pull request #55 from postgrespro/PGPRO-10932
Browse files Browse the repository at this point in the history
Correcting confusion in variables.
  • Loading branch information
sokolcati authored Sep 5, 2024
2 parents b54b0dd + ec52e0a commit 90399a9
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 24 deletions.
7 changes: 3 additions & 4 deletions patches/runtime_explain_11.0.patch
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,9 @@ index 16a80a0ea1..b12906b005 100644

/* count the number of source rows */
- total = mtstate->mt_plans[0]->instrument->ntuples;
- other_path = mtstate->ps.instrument->ntuples2;
other_path = mtstate->ps.instrument->ntuples2;
- insert_path = total - other_path;
+ other_path = mtstate->ps.instrument->nfiltered2;
+

+ /*
+ * Insert occurs after extracting row from subplan and in runtime mode
+ * we can appear between these two operations - situation when
Expand All @@ -227,7 +226,7 @@ index 16a80a0ea1..b12906b005 100644
+ insert_path = total - other_path;
+ ExplainPropertyFloat("Tuples Inserted", NULL, insert_path, 0, es);
+ }
+
- ExplainPropertyFloat("Tuples Inserted", NULL,
- insert_path, 0, es);
ExplainPropertyFloat("Conflicting Tuples", NULL,
Expand Down
7 changes: 3 additions & 4 deletions patches/runtime_explain_12.0.patch
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,9 @@ index 92969636b75..fab4267a2c1 100644

/* count the number of source rows */
- total = mtstate->mt_plans[0]->instrument->ntuples;
- other_path = mtstate->ps.instrument->ntuples2;
other_path = mtstate->ps.instrument->ntuples2;
- insert_path = total - other_path;
+ other_path = mtstate->ps.instrument->nfiltered2;
+

+ /*
+ * Insert occurs after extracting row from subplan and in runtime mode
+ * we can appear between these two operations - situation when
Expand All @@ -240,7 +239,7 @@ index 92969636b75..fab4267a2c1 100644
+ insert_path = total - other_path;
+ ExplainPropertyFloat("Tuples Inserted", NULL, insert_path, 0, es);
+ }
+
- ExplainPropertyFloat("Tuples Inserted", NULL,
- insert_path, 0, es);
ExplainPropertyFloat("Conflicting Tuples", NULL,
Expand Down
7 changes: 3 additions & 4 deletions patches/runtime_explain_13.0.patch
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,9 @@ index 20708db9f12..866948bd0c1 100644

/* count the number of source rows */
- total = mtstate->mt_plans[0]->instrument->ntuples;
- other_path = mtstate->ps.instrument->ntuples2;
other_path = mtstate->ps.instrument->ntuples2;
- insert_path = total - other_path;
+ other_path = mtstate->ps.instrument->nfiltered2;
+

+ /*
+ * Insert occurs after extracting row from subplan and in runtime mode
+ * we can appear between these two operations - situation when
Expand All @@ -237,7 +236,7 @@ index 20708db9f12..866948bd0c1 100644
+ insert_path = total - other_path;
+ ExplainPropertyFloat("Tuples Inserted", NULL, insert_path, 0, es);
+ }

+
- ExplainPropertyFloat("Tuples Inserted", NULL,
- insert_path, 0, es);
ExplainPropertyFloat("Conflicting Tuples", NULL,
Expand Down
7 changes: 3 additions & 4 deletions patches/runtime_explain_14.0.patch
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,9 @@ index 10644dfac4..7106ed4257 100644

/* count the number of source rows */
- total = outerPlanState(mtstate)->instrument->ntuples;
- other_path = mtstate->ps.instrument->ntuples2;
other_path = mtstate->ps.instrument->ntuples2;
- insert_path = total - other_path;
+ other_path = mtstate->ps.instrument->nfiltered2;
+

+ /*
+ * Insert occurs after extracting row from subplan and in runtime mode
+ * we can appear between these two operations - situation when
Expand All @@ -237,7 +236,7 @@ index 10644dfac4..7106ed4257 100644
+ insert_path = total - other_path;
+ ExplainPropertyFloat("Tuples Inserted", NULL, insert_path, 0, es);
+ }
+
- ExplainPropertyFloat("Tuples Inserted", NULL,
- insert_path, 0, es);
ExplainPropertyFloat("Conflicting Tuples", NULL,
Expand Down
7 changes: 3 additions & 4 deletions patches/runtime_explain_15.0.patch
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,9 @@ index 10644dfac4..7106ed4257 100644

/* count the number of source rows */
- total = outerPlanState(mtstate)->instrument->ntuples;
- other_path = mtstate->ps.instrument->ntuples2;
other_path = mtstate->ps.instrument->ntuples2;
- insert_path = total - other_path;
+ other_path = mtstate->ps.instrument->nfiltered2;
+

+ /*
+ * Insert occurs after extracting row from subplan and in runtime mode
+ * we can appear between these two operations - situation when
Expand All @@ -237,7 +236,7 @@ index 10644dfac4..7106ed4257 100644
+ insert_path = total - other_path;
+ ExplainPropertyFloat("Tuples Inserted", NULL, insert_path, 0, es);
+ }
+
- ExplainPropertyFloat("Tuples Inserted", NULL,
- insert_path, 0, es);
ExplainPropertyFloat("Conflicting Tuples", NULL,
Expand Down
7 changes: 3 additions & 4 deletions patches/runtime_explain_16.0.patch
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,9 @@ index 6c2e5c8a4f..74be3944d1 100644

/* count the number of source rows */
- total = outerPlanState(mtstate)->instrument->ntuples;
- other_path = mtstate->ps.instrument->ntuples2;
other_path = mtstate->ps.instrument->ntuples2;
- insert_path = total - other_path;
+ other_path = mtstate->ps.instrument->nfiltered2;
+

+ /*
+ * Insert occurs after extracting row from subplan and in runtime mode
+ * we can appear between these two operations - situation when
Expand All @@ -237,7 +236,7 @@ index 6c2e5c8a4f..74be3944d1 100644
+ insert_path = total - other_path;
+ ExplainPropertyFloat("Tuples Inserted", NULL, insert_path, 0, es);
+ }
+
- ExplainPropertyFloat("Tuples Inserted", NULL,
- insert_path, 0, es);
ExplainPropertyFloat("Conflicting Tuples", NULL,
Expand Down

0 comments on commit 90399a9

Please sign in to comment.