For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > July 2007 > Re: [PHP-DB] Optimizing Query









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PHP-DB] Optimizing Query
OKi98

2007-07-25, 7:58 am

Arie Nugraha napsal(a):
> Hi list,
>
> I Have a problem with my query that fetch about 22.000 records from
> database, the query is like this :
>
> SELECT SQL_CALC_FOUND_ROWS DISTINCT b.biblio_id, b.title,
> a.author_name FROMbiblio AS b LEFT
> JOIN biblio_author AS ba ON b.biblio_id=ba.biblio_id LEFT JOIN
> mst_author AS
> a ON ba.author_id=a.author_id WHERE b.biblio_id IS NOT NULL GROUP BY
> b.biblio_id ORDER BY b.input_date DESC LIMIT 0, 10
>
> it took about 6 seconds to complete the query in localhost. I already
> make
> an Indexes on each table, but still the performance is slow.
> Anyone have an idea how to optimize the query so result is faster?
>
> Thx
>

optimalisation requests should be supplied with result of explain and
table structure. Without that it is just guessing what may went wrong.

OKi98
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com