[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Surprised someone missed this one..
- To: magicmail-users@linuxmagic.com
- Subject: Surprised someone missed this one..
- From: Michael Peddemors <michael@wizard.ca>
- Date: Tue, 12 Aug 2003 17:54:05 -0700
- Delivered-to: mailing list magicmail-users@linuxmagic.com
- Mailing-list: contact magicmail-users-help@linuxmagic.com; run by ezmlm
- Organization: Wizard IT Services
- User-agent: KMail/1.5.3
SELECT ea.id, p.password
FROM email_addresses ea
, user_resources ur
, user_pwds p
WHERE ea.user_resource_id = ur.id
AND ur.user_id = p.user_id
AND p.password_type = 'MD5'
AND lower(ea.email_name)||'@'||lower(ea.domain) = '$email'"
That uses both concatanation, and the lower function. In Oracle at least, that
would prevent it from using the index. Right now that query alone is taking
15 seconds, but the query without the 'lower' is instantaneous.
Unless this is a cached query, which I doubt, it is obvious that query needs
to be fixed.
--
--
"Catch the Magic of Linux..."
--------------------------------------------------------
Michael Peddemors - Senior Consultant
LinuxAdministration - Internet Services
NetworkServices - Programming - Security
Wizard IT Services http://www.wizard.ca
Linux Support Specialist - http://www.linuxmagic.com
LinuxMagic is a Registered TradeMark of Wizard Tower TechnoServices Ltd.
--------------------------------------------------------
(604)589-0037 Beautiful British Columbia, Canada