We are doing dapp development on EOS. And it seems cost more ram than we evaluated.
How much ram will be used when stored a table record? And how to optimize the table structure to save the ram?
See the example below, how much ram will be used when create a record? and how to optimize it to save ram?
struct producer_info {
account_name owner;
double total_votes = 0;
eosio::public_key producer_key; /// a packed public key object
bool is_active = true;
std::string url;
uint32_t unpaid_blocks = 0;
uint64_t last_claim_time = 0;
uint16_t location = 0;
uint64_t primary_key()const { return owner; }
double by_votes()const { return is_active ? -total_votes : total_votes; }
bool active()const { return is_active; }
void deactivate() { producer_key = public_key(); is_active = false; }
// explicit serialization macro is not necessary, used here only to improve compilation time
EOSLIB_SERIALIZE( producer_info, (owner)(total_votes)(producer_key)(is_active)(url)
(unpaid_blocks)(last_claim_time)(location) )
};