Using GROUP BY and ORDER BY, the query takes a long time to execute
If you use GROUP BY and ORDER BY as shown below, the query will take a long time (3000-5000ms), but if you delete either of them again, it will finish in about 40msThe reason for using GROUP BY is to avoid duplication of dataUsing DISTINCT is very time consuming, so we try to use GROUP BYSELECT “videos_video”.”id” FROM…