Re: Using CTE vs temporary tables

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Ravi Krishna <sravikrishna3(at)gmail(dot)com>
Cc: hmidi slim <hmidi(dot)slim2(at)gmail(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Using CTE vs temporary tables
Date: 2018-07-11 16:41:09
Message-ID: CAKFQuwaYortq=bLUdNCsCS9+f9Ub+E_a0TH9168XyPnWCKaLxw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Jul 11, 2018 at 9:35 AM, Ravi Krishna <sravikrishna3(at)gmail(dot)com>
wrote:

> ​Does temp tables also suffer from optimization fence we see in CTE.​
>
>>
​I suppose it depends on how they end up being referenced in the query. It
is not possible for the auto-vacuum daemon to vacuum/analyze them so if you
aren't doing that manually there will be a different kind of problem (bad
stats) preventing the query from being executed efficiently. But in terms
of the "barrier", no, they are no different than any other table added to a
query FROM list.

David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adam Brusselback 2018-07-11 16:59:42 Re: Using CTE vs temporary tables
Previous Message Ravi Krishna 2018-07-11 16:35:05 Re: Using CTE vs temporary tables