During the first call domain_domains() produces many sql queries, if you have many subdomains created.
One query for one domain (call domain_lookup() for each domain). In my site this produces 30 extra queries on every page and will be more in future.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | reduce_queries_domain_domains-1170608-5.patch | 872 bytes | gdud |
| #1 | reduce_queries_domain_domains-1170608-1.patch | 878 bytes | gdud |
Comments
Comment #1
gdud commentedI prepared simple patch on domain_domains() function which fetch all informations in one query.
Comment #2
agentrickardMakes a lot of sense. Does it break any of the API calls?
Comment #3
croryx commentedThe patch applied cleanly to my dev site running Domain Alias, Domain Conf, Domain Settings, Domain Theme, and Domain Views without breaking anything.
There is trailing whitespace on lines 17 and 18 of the patch.
Comment #4
agentrickard@croryx Thanks for the helpful review!
Whitespace can be fixed pretty easily.
One more review and we're good-to-go.
Comment #5
gdud commentedWhitespaces is my oversight. Sorry for that :-)
Comment #6
agentrickardNice work! Committed to 6 and porting to 7.
Comment #7
agentrickardDoesn't really seem to have much effect in D7. What we need is #1179622: Create domain_load_multiple() for domain lookups.
Closing as fixed in D6.