On Thu, Apr 5, 2018 at 3:39 PM, hmidi slim <hmidi.sl...@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. https://www.postgresql.org/docs/10/static/tutorial-views.html 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.