Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mysql result times over 15 seconds!

Status
Not open for further replies.

Icoste

Technical User
Apr 18, 2007
2
GB
Hi, I am having problems with result times. I run a search from my website and it takes around 15 seconds to generate the mysql query and then 40 seconds to load the page!

Does anyone have any ideas on this because it is racking my brains!

If you would like to checkl the result times please go to and use the top search bar.

Thanks in advance.
 
hi, there are around 800,000 products in the table.

I have copied this from the php file for my header, i think this is what you reuqire, let me know if it isnt, sorry i am alittle new to mysql.

Search:&nbsp;</div>
</td>
<td width="20%"><input name="searchText" value="<?=$_GET["searchText"]?>" type="text" class="effect" size="35"></td>
<td width="5%" class="bold" align="center">&nbsp;In&nbsp;</td>
<td width="10%">
<select name="catId" onkeypress="" class="effect">
<option value="">All Products&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>
<?
$resCat = executeQuery("SELECT ID, TITLE FROM ".PREFIX."CATEGORY WHERE PARENT_ID = 0 AND ISVALID='Y' ORDER BY SORT_ORDER, TITLE");
while ( $rowCat = getRow($resCat) )
{
?> <option value="<?=$rowCat["ID"]?>"><?=$rowCat["TITLE"]?></option>
<? }
free($resCat);
?>
</select>
</td>


- UK Shopping
 
Hi

No, that PHP code is useless and confusing for us.

Do you have index on the [tt]order by[/tt] fields ? If not, create it.

Are you filling that HTML [tt]select[/tt] control with around of 800000 [tt]option[/tt]s ? I would rethink that interface as that is not user friendly.

Feherke.
 
If you are trying to pull all records, you may want to break it up alphabetically, or by 100 records with next an prev. Or at least throw a search in for the user.

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top