Re: [PERFORM] Weird plan variation with recursive CTEs

2012-04-26 Thread Tom Lane
Claudio Freire writes: > On Thu, Apr 26, 2012 at 2:37 PM, Claudio Freire > wrote: >> Fun thing is, nothing in the CTE's execution really changed. The only >> change, is that now a sequential scan of overview was chosen instead >> of the index. >> Why could this be? The output (number of search v

Re: [PERFORM] Weird plan variation with recursive CTEs

2012-04-26 Thread Claudio Freire
On Thu, Apr 26, 2012 at 2:37 PM, Claudio Freire wrote: > Fun thing is, nothing in the CTE's execution really changed. The only > change, is that now a sequential scan of overview was chosen instead > of the index. > Why could this be? The output (number of search values, even the > values themselv

[PERFORM] Weird plan variation with recursive CTEs

2012-04-26 Thread Claudio Freire
Here's a strange thing. Postgres 9.1.0 on a severely underpowered test machine effective_cache_size = 128M work_mem = 48M This query: WITH RECURSIVE subordinates AS ( SELECT id, originator_id FROM partner_deliveries WHERE originator_id in (225645) UNION ALL SELECT partn