Re: what does "initplan" operation in explain output mean?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mark Rostron <mrostron@xxxxxxx> writes:
> This message is a request for information about the "initplan" operation in explain plan.

An initplan is a sub-SELECT that only needs to be executed once because it
has no dependency on the immediately surrounding query level.  The cases
you show here are from sub-SELECTs like this:

	(select min(wu_id) from work_active limit 1)

which yields a value that's independent of anything in the outer query.
If there were an outer reference in there, you'd get a SubPlan instead,
because the subquery would need to be done over again for each row of
the outer query.

BTW, adding LIMIT 1 to an aggregate query is pretty pointless.

			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


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux