Not sure why I came again to this interesting paper One WITH RECURSIVE is Worth Many GOTOs. Daily work on Greenplum makes me think and inspires me to learn knowledge in different areas of computer science. This paper was accepted in the same SIGMOD as Greenplum’s HTAP paper and I have a vague impression of it. Recently three tasks in my work made me peruse the paper:
- Fix a customer JIRA on recursive CTE
- Answer questions from my colleague on the implementation of KNN in Greenplum (I advise using lateral join with some enhancement of Optimizer)
- My own spike on
the labels as values
skill in Greenplum(Postgres)’s expression valuation
This paper uses recursive CTE, Lateral Join and Union All with filters to implement control structure such as Loop, Condition
in PLPGSQL
. So now is a good time to start a new tour.