I am having join query that seems fetching slowly. How can I optimize it, or it is
reasonable?
time to execute
29 total, Query took 1.6956 sec
mysql query
SELECT SQL_CALC_FOUND_ROWS
t2.AuctionID ,t2.product_name ,t3.user_name ,t1.date_time ,t1.owned_price
,t2.specific_product_id
FROM table_user_ownned_auction AS t1
INNER JOIN table_product AS t2 ON t1.specific_product_id=t2.specific_product_id
INNER JOIN table_user_information AS t3 ON t3.user_id=t1.user_id
ORDER BY ownned_id DESC
Here’s the explain output

Looking at the explain output, your problem is in

The second line: The join with table
t1.Put an index on
t1.specific_product_idandt2.specific_product_id.the first line has one 3 rows in it,
using filesorton that is actually faster than using the index because it saves on I/O-time.The following code will add an index to
t2.specific_product_id.Because you only have 29 rows of output, using the index should speed up your query to instantaneous.