Is there a need to remove entries from mapping?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I am adding approximately 3 ~ 5 new entries into the mapping, while the old one will be obsolete after a week.



If the mapping grow larger, is it going to consume more gasses?



Is there a need for me to remove them since they are no longer needed.







share|improve this question
























    up vote
    1
    down vote

    favorite












    I am adding approximately 3 ~ 5 new entries into the mapping, while the old one will be obsolete after a week.



    If the mapping grow larger, is it going to consume more gasses?



    Is there a need for me to remove them since they are no longer needed.







    share|improve this question






















      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I am adding approximately 3 ~ 5 new entries into the mapping, while the old one will be obsolete after a week.



      If the mapping grow larger, is it going to consume more gasses?



      Is there a need for me to remove them since they are no longer needed.







      share|improve this question












      I am adding approximately 3 ~ 5 new entries into the mapping, while the old one will be obsolete after a week.



      If the mapping grow larger, is it going to consume more gasses?



      Is there a need for me to remove them since they are no longer needed.









      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 19 at 6:27









      s k

      2119




      2119




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          3
          down vote













          You pass gas to store the value in the first place. There are no future charges for keeping the data there.



          That said, you can get a gas refund for deleting the existing data. That can only offset gas used for a new transaction. So if you can manage to delete the old ones while adding the new ones in the same transaction, you'll save gas (and thus ether) by doing so.






          share|improve this answer




















          • smarx, thanks for the answer. So adding an entry into a mapping (regardless if it has 0 or 1000000 entries) will always consume the same amount of gas right?
            – s k
            Aug 19 at 14:05










          • That's correct.
            – smarx
            Aug 19 at 15:18










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "642"
          ;
          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',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fethereum.stackexchange.com%2fquestions%2f56853%2fis-there-a-need-to-remove-entries-from-mapping%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          3
          down vote













          You pass gas to store the value in the first place. There are no future charges for keeping the data there.



          That said, you can get a gas refund for deleting the existing data. That can only offset gas used for a new transaction. So if you can manage to delete the old ones while adding the new ones in the same transaction, you'll save gas (and thus ether) by doing so.






          share|improve this answer




















          • smarx, thanks for the answer. So adding an entry into a mapping (regardless if it has 0 or 1000000 entries) will always consume the same amount of gas right?
            – s k
            Aug 19 at 14:05










          • That's correct.
            – smarx
            Aug 19 at 15:18














          up vote
          3
          down vote













          You pass gas to store the value in the first place. There are no future charges for keeping the data there.



          That said, you can get a gas refund for deleting the existing data. That can only offset gas used for a new transaction. So if you can manage to delete the old ones while adding the new ones in the same transaction, you'll save gas (and thus ether) by doing so.






          share|improve this answer




















          • smarx, thanks for the answer. So adding an entry into a mapping (regardless if it has 0 or 1000000 entries) will always consume the same amount of gas right?
            – s k
            Aug 19 at 14:05










          • That's correct.
            – smarx
            Aug 19 at 15:18












          up vote
          3
          down vote










          up vote
          3
          down vote









          You pass gas to store the value in the first place. There are no future charges for keeping the data there.



          That said, you can get a gas refund for deleting the existing data. That can only offset gas used for a new transaction. So if you can manage to delete the old ones while adding the new ones in the same transaction, you'll save gas (and thus ether) by doing so.






          share|improve this answer












          You pass gas to store the value in the first place. There are no future charges for keeping the data there.



          That said, you can get a gas refund for deleting the existing data. That can only offset gas used for a new transaction. So if you can manage to delete the old ones while adding the new ones in the same transaction, you'll save gas (and thus ether) by doing so.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Aug 19 at 6:30









          smarx

          15.8k1515




          15.8k1515











          • smarx, thanks for the answer. So adding an entry into a mapping (regardless if it has 0 or 1000000 entries) will always consume the same amount of gas right?
            – s k
            Aug 19 at 14:05










          • That's correct.
            – smarx
            Aug 19 at 15:18
















          • smarx, thanks for the answer. So adding an entry into a mapping (regardless if it has 0 or 1000000 entries) will always consume the same amount of gas right?
            – s k
            Aug 19 at 14:05










          • That's correct.
            – smarx
            Aug 19 at 15:18















          smarx, thanks for the answer. So adding an entry into a mapping (regardless if it has 0 or 1000000 entries) will always consume the same amount of gas right?
          – s k
          Aug 19 at 14:05




          smarx, thanks for the answer. So adding an entry into a mapping (regardless if it has 0 or 1000000 entries) will always consume the same amount of gas right?
          – s k
          Aug 19 at 14:05












          That's correct.
          – smarx
          Aug 19 at 15:18




          That's correct.
          – smarx
          Aug 19 at 15:18












           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fethereum.stackexchange.com%2fquestions%2f56853%2fis-there-a-need-to-remove-entries-from-mapping%23new-answer', 'question_page');

          );

          Post as a guest













































































          這個網誌中的熱門文章

          How to combine Bézier curves to a surface?

          Mutual Information Always Non-negative

          Why am i infinitely getting the same tweet with the Twitter Search API?