FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Speeding up of php page
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Speeding up of php page [message #178927 is a reply to message #178926] Sun, 26 August 2012 11:43 Go to previous messageGo to previous message
houghi is currently offline  houghi
Messages: 45
Registered: September 2011
Karma:
Member
The Natural Philosopher wrote:
> houghi wrote:
>> I have a page that takes 7.4 seconds to load. I believe this is due to
>> the bad way it asks for the MySQL data.
>>
>> I have moved the MySQL database from HD to SSD and even to memory, but
>> there was no significant increase in speed. This makes me believe it is
>> the way I (badly) wrote the queries and/or the building of the page.
>
>> $sql = "SELECT qconst FROM quotes WHERE tconst LIKE \"$tconst\" GROUP BY qconst";
>
> Add an index on tconst
>
> should give you about 100:1 speed up

Thanks for the pointer. The actual one was on qconst:
$sql2 = "SELECT * FROM quotes WHERE qconst LIKE \"$qconst\"";

Now speed is 0.04 seconds, so 200:1. :-D

Again thanks. Now I know what I need to read up on.

houghi
--
You can have peace. Or you can have freedom.
Don't ever count on having both at once.
-- Robert A. Heinlein
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Database Abstraction Layer
Next Topic: Using SQLite3 on 1&1 or elsewhere that does not have it installed
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 15:52:00 GMT 2024

Total time taken to generate the page: 0.04524 seconds