At 19:51 +0200 8/11/02, Benjamin Pflugmann wrote:
>Hi.
>
>On Sun 2002-08-11 at 12:07:47 -0500, [EMAIL PROTECTED] wrote:
>>  At 9:25 -0700 8/11/02, Michael Collins wrote:
>[...]
>>  >SELECT * FROM MYDB
>>  >WHERE EmailAddress=$EmailEntered AND
>>  >DECODE(LoginPassword,'MySalt')=$PasswordEntered
>>
>>  If you write the query like that, yes, it will use a complete scan.
>
>I beg to differ. If there is an index on EmailAddress it will be used
>and only all entries with the same email address (which should be one
>or only one) will be scanned.

You're right.  I was speaking only with respect to evaluation of the
condition on LoginPassword.

>
>>  But you could also use
>>
>>  ... AND LoginPassword = ENCODE($PasswordEntered,'MySalt')
>
>But that's a good idea anyhow.

You're right there, too. :-)

>
>Bye,
>
>       Benjamin.
>
>--
>[EMAIL PROTECTED]


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to