Re: having difficulty with explain analyze output - Mailing list pgsql-general

From David Rysdam
Subject Re: having difficulty with explain analyze output
Date
Msg-id 8761re83ob.fsf@loud.llan.ll.mit.edu
Whole thread Raw
In response to Re: having difficulty with explain analyze output  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: having difficulty with explain analyze output  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Tue, 26 Nov 2013 14:51:22 -0500, Martijn van Oosterhout <kleptog@svana.org> wrote:
> The Seq Scan took 674ms and was run once (loops=1)
>
> The Materialise was run 94951 times and took, on average, 0.011ms to
> return the first row and 16ms to complete.
>
> 16.145 * 94951 = 1532983.895

OK, this is helpful. But why would Materialize run 94k times? I thought
the whole point of Materialize was to make a "virtual table" that could
speed up "parent" queries. If it has to recreate the subquery, why would
the planner choose to Materialize?

Attachment

pgsql-general by date:

Previous
From: Raymond O'Donnell
Date:
Subject: Re: tracking scripts...
Next
From: Dorian Hoxha
Date:
Subject: Complex sql, limit-for-each group by, arrays, updates