Changeset 960 for trunk/common


Ignore:
Timestamp:
11/20/08 23:32:07 (4 years ago)
Author:
bogdan2412
Message:

Optimize job_get_next_job

Reviewed http://reviewboard.infoarena.ro/r/39

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/common/db/job.php

    r942 r960  
    4242       `job`.`eval_message`, `job`.`score`, `job`.`file_contents` 
    4343    FROM `ia_job` AS `job` 
    44     WHERE (`status` != 'done') 
    45     ORDER BY `submit_time` ASC LIMIT 1 
     44    WHERE `job`.`id` = ( 
     45        SELECT MIN(id) 
     46        FROM `ia_job` 
     47        WHERE (`status` IN ('waiting', 'proceessing')) 
     48    ) 
    4649SQL; 
    4750    return db_fetch($query); 
Note: See TracChangeset for help on using the changeset viewer.