Li Jin <ljin@xxxxxxxxxxxxxxx> writes: > Anyone knows why the planner is doing this? WITH is an optimization fence. This is intentional and documented. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance