Using CTE vs temporary tables

From: hmidi slim <hmidi(dot)slim2(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Using CTE vs temporary tables
Date: 2018-07-11 16:30:00
Message-ID: CAMsqVxv2OuK0YBh7zNfz8tNwaxXGu2ih+DC6D_2Z8=Zt-EjgkQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.
Best regards.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2018-07-11 16:33:44 Re: Using CTE vs temporary tables
Previous Message Mathieu Fenniak 2018-07-11 14:24:47 Optimizing execution of expensive subqueries