Skip to content

Some members request custom reports for billable deposits, which must be manually run

Where?

What's the situation?

E.g.

SELECT   lcs.TYPE, ci.doi, ci.ownerprefix, ci.journalciteid, ci.bookciteid, ci.seriestitleid, ci.srctype
, ci.srcsubtype, cmh.TYPE AS dep_type, cmh.datetime AS dep_date, cmh.depositorid
FROM              atypon.log_citation_submission lcs
               JOIN
                  atypon.citation_info ci
               ON ci.citationid = lcs.citationid
            JOIN
               atypon.remote_user ru
            ON ru.userid = lcs.depositorid
         LEFT JOIN
            xref.crossmark_history cmh
         ON (    cmh.citationid = ci.citationid
             AND cmh.submissionid = lcs.submissionid
             AND cmh.depositorid = ru.userid
             AND cmh.datetime BETWEEN :1 AND :2)
WHERE    lcs.submissiondate BETWEEN :3 AND :4 AND ru.login = :5

This query took 2 hours to run and was responsible for 8.5% of total CPU time.

What does it make more difficult?

How can we improve it?

Edited by Joe Wass
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information