[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EP-tech] SQl queries



Hi

Our mysqld was rather swamped today, when I looked at the queries waiting to run, most were of the form below.
It seems to only select the eprintid, while the where clause itself contains the eprintid it is trying to retrieve, and contains quite a number of sub-select queries.
Is there a reason for these queries (does it confirm the existence / validity of a record by selecting all the relevant sub-tables)?


SELECT `eprint`.`eprintid` FROM `eprint`,
                        (SELECT `eprint`.`eprintid` AS `eprintid` FROM `eprint`,
                                                (SELECT `eprint`.`eprintid` AS `eprintid`
                                                                        FROM `eprint`, `eprint_divisions` AS `eprint_divisions`, `subject_ancestors` AS `243327284subject_ancestors`
                                                                        WHERE `eprint`.`eprintid`=`eprint_divisions`.`eprintid`
                                                                                                AND `eprint_divisions`.`divisions`=`243327284subject_ancestors`.`subjectid`
                                                                                                AND `243327284subject_ancestors`.`ancestors` = 's921'
                                                                                                UNION SELECT `eprint`.`eprintid` AS `eprintid`
                                                                                                                        FROM `eprint`, `eprint_divisions` AS `eprint_divisions`, `subject_ancestors` AS `243401584subject_ancestors`
                                                                                                                        WHERE `eprint`.`eprintid`=`eprint_divisions`.`eprintid`
                                                                                                                                                AND `eprint_divisions`.`divisions`=`243401584subject_ancestors`.`subjectid`
                                                                                                                                                AND `243401584subject_ancestors`.`ancestors` = 'd881'
                                                                                                                                                UNION SELECT `eprint`.`eprintid` AS `eprintid`
                                                                                                                                                FROM `eprint`, `eprint_divisions` AS `eprint_divisions`, `subject_ancestors` AS `243264652subject_ancestors`
                                                                                                                                                WHERE `eprint`.`eprintid`=`eprint_divisions`.`eprintid`
                                                                                                                                                AND `eprint_divisions`.`divisions`=`243264652subject_ancestors`.`subjectid`
                                                                                                                                                AND `243264652subject_ancestors`.`ancestors` = 'd2011'
                                                                                                                                                UNION SELECT `eprint`.`eprintid` AS `eprintid`
                                                                                                                                                FROM `eprint`, `eprint_divisions` AS `eprint_divisions`, `subject_ancestors` AS `243315308subject_ancestors`
                                                                                                                                                WHERE `eprint`.`eprintid`=`eprint_divisions`.`eprintid`
                                                                                                                                                AND `eprint_divisions`.`divisions`=`243315308subject_ancestors`.`subjectid`
                                                                                                                                                AND `243315308subject_ancestors`.`ancestors` = 'd2791'
                                                                                                                                                UNION SELECT `eprint`.`eprintid` AS `eprintid`
                                                                                                                                                FROM `eprint`, `eprint_divisions` AS `eprint_divisions`, `subject_ancestors` AS `243676804subject_ancestors`
                                                                                                                                                WHERE `eprint`.`eprintid`=`eprint_divisions`.`eprintid`
                                                                                                                                                AND `eprint_divisions`.`divisions`=`243676804subject_ancestors`.`subjectid` AND `243676804subject_ancestors`.`ancestors` = 'd2012'
                                                                                                                                                UNION SELECT `eprint`.`eprintid` AS `eprintid`
                                                                                                                                                FROM `eprint`, `eprint_divisions` AS `eprint_divisions`, `subject_ancestors` AS `243713020subject_ancestors`
                                                                                                                                                WHERE `eprint`.`eprintid`=`eprint_divisions`.`eprintid`
                                                                                                                                                AND `eprint_divisions`.`divisions`=`243713020subject_ancestors`.`subjectid` AND `243713020subject_ancestors`.`ancestors` = 'd904'
                                                                                                                                                UNION SELECT `eprint`.`eprintid` AS `eprintid`
                                                                                                                                                FROM `eprint`, `eprint_divisions` AS `eprint_divisions`, `subject_ancestors` AS `243472156subject_ancestors`
                                                                                                                                                WHERE `eprint`.`eprintid`=`eprint_divisions`.`eprintid` AND `eprint_divisions`.`divisions`=`243472156subject_ancestors`.`subjectid`
                                                                                                                                                AND `243472156subject_ancestors`.`ancestors` = 'd239')
                        AS `or_243378268`
                        WHERE `eprint`.`eprintid`=`or_243378268`.`eprintid`)
AS `and_181190360_0`
WHERE `eprint`.`eprintid`=`and_181190360_0`.`eprintid` AND `eprint`.`eprintid` = 41985
GROUP BY `eprint`.`eprintid`



Chris Keene  - Technical Development Manager, University of Sussex Library
Contact: http://www.sussex.ac.uk/profiles/150000

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20121112/62259cb1/attachment-0001.html