On 29-Jun-01 [EMAIL PROTECTED] wrote:
<the usual>
eat this & die a horrible death: database,sql,query,table.
... damn robot POS (ghrrr).
>
>
> On 29-Jun-01 Kris Amy wrote:
>> yes i search on phone number. it's indexed(7) and the format of the phone
>> data is (XX) XXXX XXXX.
>>
>> is there anyway this could be optimized. I will eventually remove the
>> spaces
>> and the first 4 characters from the input data and reload it in
>>
>> Kris Amy
>
> Yes, if you know it'll always format '(01) 2345-6789',
> then store as it as a INT(10) UNSIGNED ZEROFILL. ( -> 0123456789)
>
> An index on an INT is about as fast as it gets.
>
> The redundant characters '() -' are eating key spsace without giving
> you any benefit.
>
> ---
>
> In the US (no 'merkin jokes, please) the norm is (012) 345-6789.
> I tend to code this as:
>
> ph_areacode smallint(3) unsigned zerofill,
> ph_number float(7,4) zerofill,
> // int(7) unsigned will do slightly better ...
>
> key idx_ph (ph_number,ph_areacode) // search on number or ac+number
>
>
> and then have the application handle the formating.
>
> Regards,
> --
> Don Read [EMAIL PROTECTED]
> -- It's always darkest before the dawn. So if you are going to
> steal the neighbor's newspaper, that's the time to do it.
---------------------------------------------------------------------
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