Implications of many materialized views in Postgres?Adding an index to a system catalog in Postgrespostgres...

Insult for someone who "doesn't know anything"

When to use a QR code on a business card?

I am the person who abides by rules, but breaks the rules. Who am I?

Is it a Cyclops number? "Nobody" knows!

When an outsider describes family relationships, which point of view are they using?

What is better: yes / no radio, or simple checkbox?

Why do phishing e-mails use faked e-mail addresses instead of the real one?

Volume of hyperbola revolved about the y -axis

What would be the most expensive material to an intergalactic society?

Why is there an extra space when I type "ls" on the Desktop?

(Codewars) Linked Lists-Sorted Insert

Is there a way to make cleveref distinguish two environments with the same counter?

How do I increase the number of TTY consoles?

Too soon for a plot twist?

ESPP--any reason not to go all in?

Can one live in the U.S. and not use a credit card?

How do you make a gun that shoots melee weapons and/or swords?

How can I wire a Raspberry Pi to an 8-relay board in a tidy professional manner?

What was so special about The Piano that Ada was willing to do anything to have it?

How should I solve this integral with changing parameters?

Why aren't there more Gauls like Obelix?

Yet another question on sums of the reciprocals of the primes

Is divide-by-zero a security vulnerability?

Why restrict private health insurance?



Implications of many materialized views in Postgres?


Adding an index to a system catalog in Postgrespostgres materialized views and indexes to improve aggregate performanceTo partition or not to partition?Update column type when materialized views depend on the column?parallel pg_restore with materialized viewsPostgres: Database architecture and materialized viewsDesign: similar tables and foreign keysBloat on Materialized ViewsCreate a materialized view on commit with PIVOT function













2















I'm working on a system that includes a scheduling component, which has support for recurring events. After reading many, many posts on storing recurring events, it was suggested that they be calculated for a specific time period using a Postgres function and then stored in a materialized view to avoid having to recalculate every time.



The system I'm working on serves multiple businesses, each with their own calendar and customers. My thought was that a materialized view would be created on a per-business basis. However, if the service is successful, there could be well over a 1000 businesses using the system. That said, are there issues with having that many materialized views? And if so, is there a better pattern that would scale as the service grows?



FYI: I'm running Postgres 9.4



Thank you!










share|improve this question














bumped to the homepage by Community 7 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.




















    2















    I'm working on a system that includes a scheduling component, which has support for recurring events. After reading many, many posts on storing recurring events, it was suggested that they be calculated for a specific time period using a Postgres function and then stored in a materialized view to avoid having to recalculate every time.



    The system I'm working on serves multiple businesses, each with their own calendar and customers. My thought was that a materialized view would be created on a per-business basis. However, if the service is successful, there could be well over a 1000 businesses using the system. That said, are there issues with having that many materialized views? And if so, is there a better pattern that would scale as the service grows?



    FYI: I'm running Postgres 9.4



    Thank you!










    share|improve this question














    bumped to the homepage by Community 7 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      2












      2








      2








      I'm working on a system that includes a scheduling component, which has support for recurring events. After reading many, many posts on storing recurring events, it was suggested that they be calculated for a specific time period using a Postgres function and then stored in a materialized view to avoid having to recalculate every time.



      The system I'm working on serves multiple businesses, each with their own calendar and customers. My thought was that a materialized view would be created on a per-business basis. However, if the service is successful, there could be well over a 1000 businesses using the system. That said, are there issues with having that many materialized views? And if so, is there a better pattern that would scale as the service grows?



      FYI: I'm running Postgres 9.4



      Thank you!










      share|improve this question














      I'm working on a system that includes a scheduling component, which has support for recurring events. After reading many, many posts on storing recurring events, it was suggested that they be calculated for a specific time period using a Postgres function and then stored in a materialized view to avoid having to recalculate every time.



      The system I'm working on serves multiple businesses, each with their own calendar and customers. My thought was that a materialized view would be created on a per-business basis. However, if the service is successful, there could be well over a 1000 businesses using the system. That said, are there issues with having that many materialized views? And if so, is there a better pattern that would scale as the service grows?



      FYI: I'm running Postgres 9.4



      Thank you!







      postgresql performance materialized-view






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Oct 21 '15 at 5:26









      jdixon04jdixon04

      1263




      1263





      bumped to the homepage by Community 7 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 7 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          I know of no such limit, although I have never had more than tens of materialized views, not thousands. However a way of hedging against such a problem is to make one materialised view with the customer as a column and create an index on the customer column. That way, Postgres will be able to pick out the relevant parts of the view very quickly. You should have performance that is not significantly worse than having lots and lots of views. It will also be a lot less work to maintain.






          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "182"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f118687%2fimplications-of-many-materialized-views-in-postgres%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            I know of no such limit, although I have never had more than tens of materialized views, not thousands. However a way of hedging against such a problem is to make one materialised view with the customer as a column and create an index on the customer column. That way, Postgres will be able to pick out the relevant parts of the view very quickly. You should have performance that is not significantly worse than having lots and lots of views. It will also be a lot less work to maintain.






            share|improve this answer




























              0














              I know of no such limit, although I have never had more than tens of materialized views, not thousands. However a way of hedging against such a problem is to make one materialised view with the customer as a column and create an index on the customer column. That way, Postgres will be able to pick out the relevant parts of the view very quickly. You should have performance that is not significantly worse than having lots and lots of views. It will also be a lot less work to maintain.






              share|improve this answer


























                0












                0








                0







                I know of no such limit, although I have never had more than tens of materialized views, not thousands. However a way of hedging against such a problem is to make one materialised view with the customer as a column and create an index on the customer column. That way, Postgres will be able to pick out the relevant parts of the view very quickly. You should have performance that is not significantly worse than having lots and lots of views. It will also be a lot less work to maintain.






                share|improve this answer













                I know of no such limit, although I have never had more than tens of materialized views, not thousands. However a way of hedging against such a problem is to make one materialised view with the customer as a column and create an index on the customer column. That way, Postgres will be able to pick out the relevant parts of the view very quickly. You should have performance that is not significantly worse than having lots and lots of views. It will also be a lot less work to maintain.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered May 27 '16 at 21:18









                Max MurphyMax Murphy

                23125




                23125






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Database Administrators Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f118687%2fimplications-of-many-materialized-views-in-postgres%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Parapolítica Índice Antecedentes El escándalo Proceso judicial Consecuencias Véase...

                    How to remove border from elements in the last row?Targeting flex items on the last rowHow to vertically wrap...

                    Tecnologías entrañables Índice Antecedentes Desarrollo Tecnologías Entrañables en la...