[HACKERS] CTE that result in repeated sorting of the data

2014-05-15 Thread Jon Nelson
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

Re: [HACKERS] CTE that result in repeated sorting of the data

2014-05-15 Thread David G Johnston
Jon Nelson-14 wrote 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

Re: [HACKERS] CTE that result in repeated sorting of the data

2014-05-15 Thread Jon Nelson
On Thu, May 15, 2014 at 4:50 PM, David G Johnston david.g.johns...@gmail.com wrote: Jon Nelson-14 wrote 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 -