Thread:Talk:Requests for comment/New sites system/Database schema proposal/reply (9)

Hmmmm... ok I do see a use for those. (Although I don't know if a column is necessary for 1 or 5, and 2-4 are almost the same thing)

How would you handle protocol then?

site_url is basically a user-inputted string not only can can it be    it can also be protocol relative   and technically there is nothing stopping someone from adding   so they can make irc links like    in fact that's already being done!!!).

So using site_url to do things by-domain might not work so well.

How about this instead.

We store the url data inside of site_data. A type class has a method that returns the domain of a site (we can probably make a trick default implementation that calls  and then uses wfParseUrl to get the domain). Using that method we store a new site_domain column we index and use in queries.

And if you really do want to make it so we can use this in the ui instead of storing the raw domain name we'll store a reverse-dot-postfixed domain like "org.mediawiki.www." so that we can optimize queries like. The reversal keeps the heaviest information at the start properly inside the index data and the trailing dot lets us make a  query match   without matching   in the same query or requiring a separate test for complete equality.