Re: decompose big queries - Mailing list pgsql-general

From David G. Johnston
Subject Re: decompose big queries
Date
Msg-id CAKFQuwZfJL=WfTK_9wO4gNbY=6KgX-0_JKnLSVK9XW_ww5N2vQ@mail.gmail.com
Whole thread Raw
In response to decompose big queries  (hmidi slim <hmidi.slim2@gmail.com>)
List pgsql-general
On Thu, Apr 5, 2018 at 3:39 PM, hmidi slim <hmidi.slim2@gmail.com> wrote:
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?

Views are another solution.


Though while "building views upon views" is not uncommon, and it does increase the readability of each individual view, it add update fragility to the system.

Encapsulating high-level API concepts in functions and then writing queries within those functions with the benefit of views is one possibility.  Your client access needs and general data model are necessary to choose a preferred design.

David J.

pgsql-general by date:

Previous
From: hmidi slim
Date:
Subject: decompose big queries
Next
From: Alexandre Arruda
Date:
Subject: ERROR: found multixact from before relminmxid