I’m trying to search e.g. for all articles, linking to a special wikipedia article. E.g. how many articles point to “Carsharing”. On the “real” Wiki pages, I can do this by clicking “What links here”, found in the “toolbox” category. The time needed for this request is low.
But when I try to do this kind of query programmatically on my local installed Wiki database by searching the “page links” table e.g. by doing this SELECT * FROM `pagelinks` WHERE `pl_title` = 'Carsharing', it needs at least 1 minute (on a really fast local system).
Is there any way to do get the results as fast as on the “real” Wiki pages?
Creating an index on the pl_title column (if not present) can significantly improve the preformance of your query, changing a O(n) lookup to a O(log(n)) lookup.