• nelson@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    This is very true. You don’t need a bigger database server, you need an index on that table you query all the time that’s doing full table scans.

    • GenosseFlosse@feddit.org
      link
      fedilink
      English
      arrow-up
      0
      ·
      edit-2
      2 months ago

      You never worked on old code. It’s never that simple in practice when you have to make changes to existing code without breaking or rewriting everything.

      Sometimes the client wants a new feature that cannot easily implement and has to do a lot of different DB lookups that you can not do in a single query. Sometimes your controller loops over 10000 DB records, and you call a function 3 levels down that suddenly must spawn a new DB query each time it’s called, but you cannot change the parent DB query.