Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2007
    Location
    Manila, Philippines
    Posts
    132

    Cool Unanswered: slow query takes 10 min or none

    hi,
    i have to ask you guys about this problem...my frontend is php and my database is mysql...
    in my php i have a very simple query...

    SELECT
    scan_log.`Date`,
    scan_log.Job_No,
    scan_log.Job_Name,
    scan_log.Last_Name,
    user.TL,
    scan_log.Batch,
    scan_log.Page,
    scan_log.Time_Start,
    scan_log.Time_End,
    TIMEDIFF(scan_log.Time_End,scan_log.Time_Start) AS 'Time Consumed', scan_log.Records,
    scan_log.`Status`

    FROM
    scan_log INNER JOIN batch_log ON (scan_log.Job_No = batch_log.Job_Number)
    INNER JOIN user ON (scan_log.Last_Name = user.Last_Name)

    order by
    scan_log.`Date` desc,
    scan_log.Time_Start desc
    ================

    when this query is executed in my php page...it takes very long to displayed the result and sometimes it hangs...

    do i need to make adjustments with my database?tables?
    what should i do to make my query execute faster?

    pls advice...
    thanks
    Take Nothing But Pictures;
    Leave Nothing But Footprints;
    Kill Nothing But Time;

  2. #2
    Join Date
    Oct 2007
    Location
    Manila, Philippines
    Posts
    132
    i now know the problem, its the index.
    anyone who had this problem...
    just refer to this site...it helps me alot...tnx.

    http://www.mysql.com/news-and-events...2006-03-01.php

    Take Nothing But Pictures;
    Leave Nothing But Footprints;
    Kill Nothing But Time;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •