Re: [PERFORM] Performance penalty when using WITH

2011-08-04 Thread Li Jin
lin Moncure wrote: >> On Sat, Jul 30, 2011 at 8:10 AM, Robert Klemme >> wrote: >>> On Thu, Jul 28, 2011 at 11:00 PM, Li Jin wrote: >>>> I met with the problem that when I was using WITH clause to reuse a >>>> subquery, I got a huge performance penalty be

[PERFORM] Performance penalty when using WITH

2011-07-29 Thread Li Jin
Hi guys, I met with the problem that when I was using WITH clause to reuse a subquery, I got a huge performance penalty because of query planner. Here are the details, the original query is EXPLAIN ANALYZE WITH latest_identities AS ( SELECT DISTINCT ON (memberid) memberid, username, change