Re: [PHP] Slow searches in large database
From: Rory McKinley (rorym_at_nebula.co.za)
Date: 10/14/03
- Next message: Jed R. Brubaker: "Foreach Array Help"
- Previous message: Davy Obdam: "Re: [PHP] what is the best PHP editor?"
- In reply to: Adrian Teasdale: "Slow searches in large database"
- Next in thread: Cesar Cordovez: "Re: [PHP] Slow searches in large database"
- Reply: Cesar Cordovez: "Re: [PHP] Slow searches in large database"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: <adrian@justcompete.com>, <php-general@lists.php.net> Date: Tue, 14 Oct 2003 08:54:25 +0200
Hi Adrian
Somewhere in the back of my mind..I remember reading that if you are using
LIKE putting in wildcards for and aft e.g %string% slows down queries
somewhat....
I will have a look at my mySQL stuff and see if I can confirm...but if I
recall correctly, is there any way you can do away with one of the
wildcards?
Rory McKinley
Nebula Solutions
+27 82 857 2391
rorym@nebula.co.za
"There are 10 kinds of people in this world,
those who understand binary and those who don't" (Unknown)
----- Original Message -----
From: "Adrian Teasdale" <adrian@justcompete.com>
To: <php-general@lists.php.net>
Sent: Tuesday, October 14, 2003 12:54 AM
Subject: [PHP] Slow searches in large database
> Hi there
>
> Wondering if someone could help or give some advice.
>
> We have a mysql database that has approximately 20,000 records and has a
> total size of 125mb There are approximately 25 fields that we need to
> search each time that someone performs a search. We have installed
> TurckMMCache onto the server which speeded up the searching, but it
> still takes around 15 seconds for the results to be displayed.
>
> An example of one of our search strings is:
>
> select docs.* from docs where 1 and CY IN ('GB') and (TI like
> '%searchstring%' or PD like '%searchstring%' or ND like '%searchstring%'
> or DR like '%searchstring%' or DS like '%searchstring%' or DD like
> '%searchstring%' or DT like '%searchstring%' or RN like '%searchstring%'
> or HD like '%searchstring%' or TD like '%searchstring%' or NC like
> '%searchstring%' or PR like '%searchstring%' or RP like '%searchstring%'
> or AA like '%searchstring%' or TY like '%searchstring%' or AC like
> '%searchstring%' or PC like '%searchstring%' or RC like '%searchstring%'
> or RG like '%searchstring%' or AU like '%searchstring%' or TW like
> '%searchstring%' or CO like '%searchstring%' or AB like '%searchstring%'
> or TX like '%searchstring%')
>
> Basically, is there anything that anyone can immediately suggest that we
> need to do to speed things up?
>
> Thanks
>
> Ade
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
- Next message: Jed R. Brubaker: "Foreach Array Help"
- Previous message: Davy Obdam: "Re: [PHP] what is the best PHP editor?"
- In reply to: Adrian Teasdale: "Slow searches in large database"
- Next in thread: Cesar Cordovez: "Re: [PHP] Slow searches in large database"
- Reply: Cesar Cordovez: "Re: [PHP] Slow searches in large database"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|