CTE that result in repeated sorting of the data - Mailing list pgsql-hackers

From Jon Nelson
Subject CTE that result in repeated sorting of the data
Date
Msg-id CAKuK5J38hi5GE0b38wSyPJEG3A0H-EhqXvazWRa0xY9b6v82=A@mail.gmail.com
Whole thread Raw
Responses Re: CTE that result in repeated sorting of the data  (David G Johnston <david.g.johnston@gmail.com>)
List pgsql-hackers
I was watching a very large recursive CTE get built today and this CTE
involves on the order of a dozen or so "loops" joining the initial
table against existing tables. It struck me that - every time through
the loop the tables were sorted and then joined and that it would be
much more efficient if the tables remained in a sorted state and could
avoid being re-sorted each time through the loop. Am I missing
something here? I am using PG 8.4 if that matters.

-- 
Jon



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: pg_recvlogical tests
Next
From: Alvaro Herrera
Date:
Subject: Re: Proposal for CSN based snapshots