Re: having difficulty with explain analyze output

From: David Rysdam <drysdam(at)ll(dot)mit(dot)edu>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: having difficulty with explain analyze output
Date: 2013-11-27 11:49:56
Message-ID: 8761re83ob.fsf@loud.llan.ll.mit.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 26 Nov 2013 14:51:22 -0500, Martijn van Oosterhout <kleptog(at)svana(dot)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?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dorian Hoxha 2013-11-27 12:51:53 Complex sql, limit-for-each group by, arrays, updates
Previous Message Raymond O'Donnell 2013-11-27 10:22:25 Re: tracking scripts...