Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8005673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:17:36+00:00 2026-06-04T17:17:36+00:00

I want to load data with 4 columns and 80 millon rows in MySQL

  • 0

I want to load data with 4 columns and 80 millon rows in MySQL on Redis, so that I can reduce fetching delay.

However, when I try to load all the data, it becomes 5 times larger.

The original data was 3gb (when exported to csv format), but when I load them on Redis, it takes 15GB… it’s too large for our system.

I also tried different datatypes –

1) ‘table_name:row_number:column_name’ -> string
2) ‘table_name:row_number’ -> hash

but all of them takes too much.

am I missing something?

added)

my data have 4 col – (user id(pk), count, created time, and a date)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T17:17:37+00:00Added an answer on June 4, 2026 at 5:17 pm

    The most memory efficient way is storing values as a json array, and splitting your keys such that you can store them using a ziplist encoded hash.

    1. Encode your data using say json array, so you have key=value pairs like user:1234567 -> [21,'25-05-2012','14-06-2010'].
    2. Split your keys into two parts, such that the second part has about 100 possibilities. For example, user:12345 and 67
    3. Store this combined key in a hash like this hset user:12345 67 <json>
    4. To retrieve user details for user id 9876523, simply do hget user:98765 23 and parse the json array
    5. Make sure to adjust the settings hash-max-ziplist-entries and hash-max-ziplist-value

    Instagram wrote a great blog post explaining this technique, so I will skip explaining why this is memory efficient.

    Instead, I can tell you the disadvantages of this technique.

    1. You cannot access or update a single attribute on a user; you have to rewrite the entire record.
    2. You’d have to fetch the entire json object always even if you only care about some fields.
    3. Finally, you have to write this logic on splitting keys, which is added maintenance.

    As always, this is a trade-off. Identify your access patterns and see if such a structure makes sense. If not, you’d have to buy more memory.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I load data in my code-behind, I find that often I want to
I want to use an HTTPService to load some data (number of columns and
We've got some data (10-50 columns, hundreds of thousands of rows) that we usually
I want to load data when the user drags the scroll bar to rhw
I have a form with a DataGridView and I want to load data from
I want to load my data on scroll down for my tableView. I have
I have a UINavigationController consisting of a tableview I want to load some data
I want to load the list of the groups as well as data into
I want to save and load my xml data using XmlReader. But I don't
I want to select some data out of a CSV file before i load

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.