particular, SQL queries on the templatelinks table are intractably slow. Why are there no keys on tl_from or tl_title?
How are you planning to get the template parameters? Have I missed a recent schema change? I'd be interested in following your progress. I'm not extracting infobox data, but parameters of the coordinate template. Maybe a similar approach could be interesting for you:
The coordinate template stuffs all its parameters int an external link (which can easily be obtained from the externallinks table). Creating dummy links containing parameters for some infoboxes could be one way of making the data available for automatic extraction (yes, it's a hack, but I'd prefer better suggestions over flames).
The link could actually be made useful, it could point to a query page for the data in these infoboxes.
[[User:Dschwen]]