Good point, I don't need the second "xx_namespace IN (banned NSs)" :)
We still need to do it by the page title, not pageIDs for two reasons: 1) an extra query is needed to resolve whitelist into pageids (can be memcached, but why?) 2) only 'page' table has both the ns+title and the pageid, and queries against any other table need to filter by title (e.g. pagelinks - the fromid will be verified before querying, but the ns & title still need to be checked).
--Yurik
On 7/10/07, Simetrical Simetrical+wikilist@gmail.com wrote:
On 7/10/07, Yuri Astrakhan yuriastrakhan@gmail.com wrote:
The very important part is that no hook should be able to dynamically say that a page cannot be viewed. As for whitelists, I am not sure it's efficient to pass a list of whitelisted items in every query:
SELECT ... WHERE ... AND ( xx_namespace NOT IN (banned NSs) OR (xx_namespace IN (banned NSs) AND (xx_title IN (whitelist) )
Instead of just "xx_namespace NOT IN (bannedr NSs)".
It would only need to be xx_namespace NOT IN (banned NSes) OR xx_id IN (whitelist). See, those logic classes are good for something:
!p || (p && q) <=> (!p || p) && (!p || q) <=> !p || q
I shouldn't imagine that would be any less efficient than what you currently do. You should probably look at EXPLAIN and see.
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/wikitech-l