0

It takes too much time to load when there are greater than 100000 records

 select meal_option_id,
            order_id, price,
            display_name,
            count, 
            deliveries.id
         from deliveries 
            inner join deliveries_meals
            on deliveries.id = deliveries_meals.delivery_id
            inner join meal_options
            on deliveries_meals.meal_option_id = meal_options.id
  • 2
    You shouldn't be asking the question in the title only.. Also returning 500000 records will take (some) time if you like it or not there is not really a way to optimize it.. Also why are you displaying 500000 records on one page nobody is going to read all that? – Raymond Nijland Mar 04 '19 at 15:08
  • 4
    update your question and add your table .schema .. explain what you mean for "getting too loading" (1 minute ,, 10 minute ... 2 days) and explain wahy you load 500000 and more – ScaisEdge Mar 04 '19 at 15:09
  • 7
    Questions about query performance ALWAYS require, as a minimum, CREATE TABLE statements for ALL relevant tables, and the results of the EXPLAIN for the given query. – Strawberry Mar 04 '19 at 15:10
  • I think there isn't anything to optimise here since it's a pretty much basic query. You should try [pagination](https://stackoverflow.com/questions/3799193/mysql-data-best-way-to-implement-paging). – Bertram Gilfoyle Mar 04 '19 at 15:35
  • Follow the tips [_here_](http://mysql.rjweb.org/doc.php/index_cookbook_mysql#many_to_many_mapping_table) – Rick James Mar 10 '19 at 01:20

0 Answers0