skip to Main Content

ORDER BY COUNT is slow – Mysql

A table (phototag) consists of two foreign key columns (photoid, tagid). I want to get the most related photos based on their tags. There are 4 million photos with 5-10 tags. For example, the photoid 10009 has 6 tags. I…

VIEW QUESTION

Index mysql key select

I need help for performance this query SELECT * FROM transactions WHERE created_at BETWEEN '2022-08-25 01:03:21' AND '2022-12-13 01:03:21' AND ((transaction_reason IN ('ORIGINAL','REVERSAL_OF_ADJUSTMENT') AND type = 'DEPOSIT') OR (transaction_reason IN ('ADJUSTMENT','REVERSAL_OF_ORIGINAL') AND type = 'WITHDRAWAL') ) ORDER BY transaction_id ASC…

VIEW QUESTION
Back To Top
Search