Discussion:
Question about inserting the "Sort" node into the plan
(too old to reply)
Taras
2011-04-01 05:52:28 UTC
Permalink
Hi,

I am currently testing the last part of the assignment, and once again I
see some odd behavior sometimes. I insert the Sort node after Sequential
scan based on the pathkeys (index scan, tid scan, unordered sequential
scan are all deleted for this), and when the optimizer chooses to do a
merge join on the two relations, it does not seem to recognize that the
single relation plans already produce tuples in needed order - so I see
a Sort node inserted twice in a row in the plan. Does anyone have any
clue to what might be wrong here?

Thanks,
Taras
Ken Salem
2011-04-01 16:18:14 UTC
Permalink
Not sure what's going on there. Might you be mistakenly inserting
a sort even for single-relation paths that are not ordered, e.g.,
the original single-relation paths that were generated by postgres?

That could cause the symptom you are describing.

-KMS
Post by Taras
Hi,
I am currently testing the last part of the assignment, and once again I
see some odd behavior sometimes. I insert the Sort node after Sequential
scan based on the pathkeys (index scan, tid scan, unordered sequential
scan are all deleted for this), and when the optimizer chooses to do a
merge join on the two relations, it does not seem to recognize that the
single relation plans already produce tuples in needed order - so I see
a Sort node inserted twice in a row in the plan. Does anyone have any
clue to what might be wrong here?
Thanks,
Taras
Taras
2011-04-01 22:06:51 UTC
Permalink
I disabled in the code creation of the original single-relation paths.
So for the single relations, the only paths that are created are the
ones with interesting orders.

Taras
Post by Ken Salem
Not sure what's going on there. Might you be mistakenly inserting
a sort even for single-relation paths that are not ordered, e.g.,
the original single-relation paths that were generated by postgres?
That could cause the symptom you are describing.
-KMS
Post by Taras
Hi,
I am currently testing the last part of the assignment, and once again I
see some odd behavior sometimes. I insert the Sort node after Sequential
scan based on the pathkeys (index scan, tid scan, unordered sequential
scan are all deleted for this), and when the optimizer chooses to do a
merge join on the two relations, it does not seem to recognize that the
single relation plans already produce tuples in needed order - so I see
a Sort node inserted twice in a row in the plan. Does anyone have any
clue to what might be wrong here?
Thanks,
Taras
Loading...