Increasing working memory in psql does not improve query performance

How to explain that I do not want to visit a country due to personal safety concern?

My adviser wants to be the first author

How to make healing in an exploration game interesting

What is the significance behind "40 days" that often appears in the Bible?

Have the tides ever turned twice on any open problem?

Does this sum go infinity?

Print a physical multiplication table

Why is a white electrical wire connected to 2 black wires?

Meme-controlled people

If I can solve Sudoku, can I solve the Travelling Salesman Problem (TSP)? If so, how?

I got the following comment from a reputed math journal. What does it mean?

Why does overlay work only on the first tcolorbox?

What's the meaning of a knight fighting a snail in medieval book illustrations?

How to deal with taxi scam when on vacation?

Why is the President allowed to veto a cancellation of emergency powers?

Fastest way to pop N items from a large dict

Are all passive ability checks floors for active ability checks?

Why do passenger jet manufacturers design their planes with stall prevention systems?

ERC721: How to get the owned tokens of an address

Simplify an interface for flexibly applying rules to periods of time

Violin - Can double stops be played when the strings are not next to each other?

Employee lack of ownership

Did Ender ever learn that he killed Stilson and/or Bonzo?

Shortcut for setting origin to vertex



Increasing working memory in psql does not improve query performance














0















I am very new to database administration and could use any advice from more expert users of PostgreSQL



My database is an AWS RDS db.m4.large whose specification are here



My queries against one of the larger tables in the database (330 million rows) are running extremely slow and/or timing out, even when I am have a query such as



SELECT(DISTINCT value) FROM mytable; 


where there are only 4 or 5 unique values in the value column. It is not indexed.



pg_size_pretty(pg_total_relation_size(relid)) shows the size of the table to be 118 GB



Even when setting work_mem to 240 MB, which should allows psql to do larger in-memory sorts, the query is equally as slow



EXPLAIN ANALYZE SELECT(DISTINCT value) FROM mytable;
also times out



What does one do to optimize memory usage for querying on a sufficiently large database? Which pg settings would I need to monitor and/or configure differently ?



Any help would be appreciated.









share



























    0















    I am very new to database administration and could use any advice from more expert users of PostgreSQL



    My database is an AWS RDS db.m4.large whose specification are here



    My queries against one of the larger tables in the database (330 million rows) are running extremely slow and/or timing out, even when I am have a query such as



    SELECT(DISTINCT value) FROM mytable; 


    where there are only 4 or 5 unique values in the value column. It is not indexed.



    pg_size_pretty(pg_total_relation_size(relid)) shows the size of the table to be 118 GB



    Even when setting work_mem to 240 MB, which should allows psql to do larger in-memory sorts, the query is equally as slow



    EXPLAIN ANALYZE SELECT(DISTINCT value) FROM mytable;
    also times out



    What does one do to optimize memory usage for querying on a sufficiently large database? Which pg settings would I need to monitor and/or configure differently ?



    Any help would be appreciated.









    share

























      0












      0








      0








      I am very new to database administration and could use any advice from more expert users of PostgreSQL



      My database is an AWS RDS db.m4.large whose specification are here



      My queries against one of the larger tables in the database (330 million rows) are running extremely slow and/or timing out, even when I am have a query such as



      SELECT(DISTINCT value) FROM mytable; 


      where there are only 4 or 5 unique values in the value column. It is not indexed.



      pg_size_pretty(pg_total_relation_size(relid)) shows the size of the table to be 118 GB



      Even when setting work_mem to 240 MB, which should allows psql to do larger in-memory sorts, the query is equally as slow



      EXPLAIN ANALYZE SELECT(DISTINCT value) FROM mytable;
      also times out



      What does one do to optimize memory usage for querying on a sufficiently large database? Which pg settings would I need to monitor and/or configure differently ?



      Any help would be appreciated.









      share














      I am very new to database administration and could use any advice from more expert users of PostgreSQL



      My database is an AWS RDS db.m4.large whose specification are here



      My queries against one of the larger tables in the database (330 million rows) are running extremely slow and/or timing out, even when I am have a query such as



      SELECT(DISTINCT value) FROM mytable; 


      where there are only 4 or 5 unique values in the value column. It is not indexed.



      pg_size_pretty(pg_total_relation_size(relid)) shows the size of the table to be 118 GB



      Even when setting work_mem to 240 MB, which should allows psql to do larger in-memory sorts, the query is equally as slow



      EXPLAIN ANALYZE SELECT(DISTINCT value) FROM mytable;
      also times out



      What does one do to optimize memory usage for querying on a sufficiently large database? Which pg settings would I need to monitor and/or configure differently ?



      Any help would be appreciated.







      postgresql psql





      share












      share










      share



      share










      asked 5 mins ago









      the_darksidethe_darkside

      12016




      12016






















          0






          active

          oldest

          votes











          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%2f232343%2fincreasing-working-memory-in-psql-does-not-improve-query-performance%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          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%2f232343%2fincreasing-working-memory-in-psql-does-not-improve-query-performance%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

          ORA-01691 (unable to extend lob segment) even though my tablespace has AUTOEXTEND onORA-01692: unable to...

          Always On Availability groups resolving state after failover - Remote harden of transaction...

          Circunscripción electoral de Guipúzcoa Referencias Menú de navegaciónLas claves del sistema electoral en...