Closed (fixed)
Project:
Drupal core
Component:
base system
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
24 Jan 2004 at 20:41 UTC
Updated:
9 Feb 2004 at 19:20 UTC
Jump to comment: Most recent file
I installed the dev module to take a look at the performance of a module I'm working on, and I noticed 72 instances of "SELECT * FROM url_alias"... which I found a bit odd (since I don't have the path module active).
I traced it to the drupal_get_path_alias() function being called in url()... every time you call l() you're generating a query regardless of wether you have the path module active.
I wrote a one line patch that just adds a module_exist("path") in there before calling drupal_get_path_alias()... no more unnecessary queries.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | alias-set-map.patch | 280 bytes | dries |
| #1 | alias_count_entries.patch | 573 bytes | matt westgate |
| skip.path-module-check.patch | 554 bytes | skip |
Comments
Comment #1
matt westgate commentedSome modules such as project rely on url aliasing whether or not the path module is enabled. In otherwards the path module can be used internally even if it isn't enabled. So a cleaner patch would be to check if any alias entries exist in the database instead.
Thanks for pointing this out.
Comment #2
dries commentedI don't see how the suggested approach is any better. A better approach is to set
$mapto be non-null. See my attached patch, which I just committed to HEAD and backported to the DRUPAL-4-3 branch.Comment #3
gábor hojtsyDries, you patch does not seem to solve anything to me... You have added a $map variable to a function, where no $map variable was used... That does not seem to change the behaviour of anything...
Comment #4
dries commentedYou're right. I reverted the patch in the DRUPAL-4-3 branch.
Comment #5
gábor hojtsyNot fixed.
Comment #6
dries commentedCan you be more specific? I fixed the issue in HEAD, and it does not appear to be a bug in DRUPAL-4-3.
Comment #7
(not verified) commented