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 #178934 is a reply to message #178928] Sun, 26 August 2012 17:34 Go to previous messageGo to previous message
houghi is currently offline  houghi
Messages: 45
Registered: September 2011
Karma:
Member
Norman Peelman wrote:
> #1 - Why are you calling the database twice?

Because I have no idea on how to do it differently. :-(

> #2 - If you already have the movie id (tconst) then drop the LIKE and
> just use '='. Using LIKE causes a full table scan, in your example a
> full table scan is performed 338 times (how big is your db?)

Thanks. phpMyAdmin tells me about quotes:
~69,655 total, Query took 0.0003 sec

> Set up indexes on qconst and tconst and try:
>
> $sql = "SELECT char, nconst, stage, quote FROM quotes WHERE tconst =
> '$tconst' GROUP BY qconst";
<snip>

Thanks. Will look into it.


> #3
> I see 4 tables here:
>
> movies
> ------
>
> quotes
> ------
>
> person
> ------
>
> character
> ---------
>
> Properly linked, it should only require one call to the database to
> retrieve your data.

Where could I get information about this? What would be the search I
need to enter into google? The problem is that I learned by copy and
paste, so I have often no idea what the names are of what I am looking
for.


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: Fri Nov 22 16:23:22 GMT 2024

Total time taken to generate the page: 0.04916 seconds