From: Edson Carlos Ericksson Richter <richter@simkorp.com.br>
To: pgsql-general@lists.postgresql.org
Subject: Re: decompose big queries
Date: Fri, 6 Apr 2018 10:06:28 -0300
Message-ID: <40cd1824-1dd0-1aad-2c8d-c34ee510b5c5@simkorp.com.br> (raw)
In-Reply-To: <CAMsqVxthr_KB_VSa6z1dY+f9DpbA=UrNgB7nMnMT5KBPpk_YAQ@mail.gmail.com>
References: <CAMsqVxthr_KB_VSa6z1dY+f9DpbA=UrNgB7nMnMT5KBPpk_YAQ@mail.gmail.com>
Em 05/04/2018 19:39, hmidi slim escreveu:
> Hi,
> I want to know what are the best practice to use in order to decompose
> a big query which contains so many joins.Is it recommended to use
> stored procedures ? or is there any other solution?
>
I don't know if there are best practices (each scenario requires its own
solution), but for plain complex SELECT queries, I do use "WITH"
queries... They work really well.
https://www.postgresql.org/docs/9.6/static/queries-with.html
Regards,
Edson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: richter@simkorp.com.br
Subject: Re: decompose big queries
In-Reply-To: <40cd1824-1dd0-1aad-2c8d-c34ee510b5c5@simkorp.com.br>
References: <CAMsqVxthr_KB_VSa6z1dY+f9DpbA=UrNgB7nMnMT5KBPpk_YAQ@mail.gmail.com> <40cd1824-1dd0-1aad-2c8d-c34ee510b5c5@simkorp.com.br>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox