Thread:Extension talk:RecentPages/Database inefficiencies

Oh dear, it's doing a separate BedellPenDragon::renderGetBpdProp for every item, plus it's doing a separate getDisplayTitle for every item. Not only that, BedellPenDragon::renderRandomPageInCat does the same thing. Not a big deal, except on templates like ChildWiki:More new articles or ChildWiki:More featured articles. I believe this would be called an O(n) situation. It could get pretty ugly, if the number of articles were to get pretty high.

Probably the most potential for savings is when it's a query that can be done as a LIMIT x (e.g. a new pages feed) or selecting everything in a category, rather than having a WHERE with a bunch of individual pages to select from all over the table (as in the case of random pages). But I'm not sure. I'm no expert on database optimization. Maybe JOINs would make it more efficient; maybe not. Too bad I also know nothing about profiling.