Spent 2 days optimizing SQL queries, and then I learned a valuable lesson.

If your database size is bigger than the RAM of the machine it’s running on, every query will take 5+ seconds ☹️

  • 2
    But at least you tried..
  • 7
    It depends on the database.

    Our db is more than three times total ram and most queries finish in milliseconds.

    The real factor is often the size of the indexes used.

    But if you do not have index it will be the size of tables , which could be the same as the db.

    So first question, do you have relevant indexes for the query?

    And what sql are you using?
  • 0
    @Voxera wow! This comment! Thanks, you sent me on a googling journey... learned a lot!
  • 0
    @arturgrigio glad I could help :)
Add Comment