[GENERAL] Re: [GENERAL] Puzzling table scan in a CTE

2013-11-25 Thread slapo
tgresql.org" Dátum: 22.11.2013 20:25 Predmet: Re: [GENERAL] Puzzling table scan in a CTE "sl...@centrum.sk" wrote: I have a recursive CTE where a table scan occurs, even though there doesn't seem to be a good reason for it. Do you have effective_cache_size set to 50% to 75% of

[GENERAL] Re: [GENERAL] Puzzling table scan in a CTE

2013-11-25 Thread slapo
haven't defined anywhere (see previously posted plan).   Cheers. :-)   Peter Slapansky   __ Od: Elliot Komu: , Dátum: 22.11.2013 19:58 Predmet: Re: [GENERAL] Puzzling table scan in a CTE CC: "Elliot" On 2013-11-22 12:49

Re: [GENERAL] Puzzling table scan in a CTE

2013-11-22 Thread Kevin Grittner
"sl...@centrum.sk" wrote: > I have a recursive CTE where a table scan occurs, even though > there doesn't seem to be a good reason for it. Do you have effective_cache_size set to 50% to 75% of machine RAM? Do you have cpu_tuple_cost set to between 0.03 and 0.05?  If not, do changes to these set

Re: [GENERAL] Puzzling table scan in a CTE

2013-11-22 Thread Elliot
On 2013-11-22 12:49, sl...@centrum.sk wrote: Thanks for the suggestion. I've tried it with seqscan set to off, but there's still a bitmap heap scan going on: http://explain.depesz.com/s/zIJl I have random_page_cost set to 1.5 at the moment, as the database is on a solid state disk. Every

[GENERAL] Re: [GENERAL] Puzzling table scan in a CTE

2013-11-22 Thread slapo
AND ups1.var_id <> ur2.id ) ) SELECT var_id, var_id_user_parent, var_login, var_login_parent, var_sort_order FROM user_subordinates_united ORDER BY var_sort_order,        var_id,              var_id_user_parent ;   ______________ Od: Elliot Kom

Re: [GENERAL] Puzzling table scan in a CTE

2013-11-22 Thread Elliot
On 2013-11-22 11:54, sl...@centrum.sk wrote: Good day, I have a recursive CTE where a table scan occurs, even though there doesn't seem to be a good reason for it. It seems the planner came to the conclusion that columns that are not actually used in the output, joins or a where clause are