Tim Starling wrote:
> Whenever you do a join with a limit, MySQL gets the query plan wrong.
> It scans the small table and filesorts the large table. You have to
> use FORCE INDEX on the small table to suppress the scan. We've seen
> this many times. It's very difficult to detect during code review and
> frequently crashes the site.
> 
> Does anyone know a DBMS where joining with limits actually works?
> Because I'm sick of this crap.

Would it help to do it in a way similar to what you have to do in DBMSes 
without limit:

select a.* from (
   select * from recentchanges
   left join tag_summary on ts_rc_id=rc_id
   order by rc_timestamp desc
) a limit 50

or is MySQL's parser too smart for its own good?

_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to