Re: Using CTE vs temporary tables

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: hmidi slim <hmidi(dot)slim2(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Using CTE vs temporary tables
Date: 2018-07-11 16:33:44
Message-ID: CAKFQuwYuTAGb4zr5M1Naj+p3tPDkJ=LZ-ZdHseoKd6GgJsMn5w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Jul 11, 2018 at 9:30 AM, hmidi slim <hmidi(dot)slim2(at)gmail(dot)com> wrote:

> Hi,
> I have a big query that used about 15 cte and its execution time is
> acceptable. I'm trying to optimize my query because it contains about 150
> lines of code and becomes hard to understand it and add new filter or
> condition easily.
> I think to change some cte with temporary tables and using indexes. I
> found this answer about performance between CTE and temp tables:
> https://dba.stackexchange.com/questions/78253/postgresql-
> common-table-expressions-vs-a-temporary-table
>
> Any suggestion will be welcome.
>
>
​Consider views and functions too.

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ravi Krishna 2018-07-11 16:35:05 Re: Using CTE vs temporary tables
Previous Message hmidi slim 2018-07-11 16:30:00 Using CTE vs temporary tables