2
PaaPsik
6y

Best eays to improve database performance?
I have a huge database table with a lot of data, 10+columns and around 5-6million rows and growing. We are thinking about optimisation methods, the data will be frequently accessed, but not in the same ways. even though caching is helping, some initial requests take 6-20secs. What are good ways to improve a relational db performance? The data is date and item based, every item can have some data back from 2016 or older and up to 1000 related rows in each day. Every day new data would be added. Right now working with php.

Comments
  • 1
    You could migrate onto a no sql database.
    These are insanely fast with varying queries against huge leads of data.

    Plus, you can facade this no sql database with GraphQL to reduce the complexity of queries and the amount of data you're returning from a database query.
  • 2
    But one of the first steps you should take on is to split this 10+ columns into separate tables, so you can make faster query responses for a greater variety of queries.

    Another idea is to cluster your stored information into separate databases for different years of data item creation or ranges of customer lastnames.

    So you can ignore millions of datasets for a query when they are irrelevant.
  • 0
    @TylerDDevRant interesting. Splitting the data would require a conditional based query with from different servers though right?
  • 0
    @TylerDDevRant i've talked with the lead dev, we could do it, but we are fully using php and relational databases right now. This would require a new stack, learning it, testing and i would be probably working in it alone, because the other devs would be working on other parts of the project
  • 0
    @zvyn we dont have %like% queries, it all pretty much exact queries. But like you imagine fetching a query: select sum(something) where this=this AND this=this this=this this=this...when there are 5-6 mil rows takes a while
  • 0
    "Just do what Netflix does."
  • 0
    @davehuk and whats that?
  • 1
    It's sarcasm. People always try to copy giant tech firms and fail most of the time.
Add Comment