At 13:59 09/10/99 GMT, Steven Fletcher wrote:
>Hi all.
<snip>
>mysql> Select * From companies Where ((type like 'museum%') ) AND ( add1
>LIKE 'salford%' OR add2 LIKE 'salford%' OR add3 LIKE 'salford%' OR add4
>LIKE 'salford%' OR district LIKE 'salford%' OR town LIKE 'salford%' OR
>county LIKE 'salford%' ) limit 50;
<snip>
This is totally Off Topic since its a question about database design rather
than MySQL.
Its difficult to optimize all those LIKE clauses, also MySQL has trouble
coping with ORed conditions. You have a lot of indices which will never get
used by queries like this.
Try forcing a little more structure on your address e.g.:
number_in_street,
street_name,
locality,
town,
county,
country,
postcode
Also, since you already have a large dataset which isn't in this form, try
searching on a range of postcodes. Don't use wildcards.
HTH
Colin