小编Jon*_*ert的帖子

Brain-Dead MySQL选择优化(使用临时,使用Filesort)

我目前正在开展涉及专利的项目拉动USPTO网站,作为该项目的一部分,我正在使用伊利诺伊大学人员创建的数据库
(论文:http://abel.lis.illinois.edu/UPDC /USPTOPatentsDatabaseConstruction.pdf)
(我正在使用的表略有过时的模式,只缺少非索引/键值:http://i.imgur.com/44LHS3L.png)

现在标题说我正在尝试优化查询:

SELECT 
        PN,
        AN,
        grants.GrantID,
        grants.FileDate,
        grants.IssueDate,
        grants.Kind,
        grants.ApplicationID,
        assignee_g.OrgName,
        GROUP_CONCAT(DISTINCT CONCAT_WS(', ', assignee_g.City, assignee_g.State, assignee_g.Country) separator ';') as Assignee,
        GROUP_CONCAT(DISTINCT CONCAT_WS(', ', inventor_g.FirstName, inventor_g.LastName) separator ';') as Inventor,
        GROUP_CONCAT(DISTINCT CONCAT_WS(', ', inventor_g.City, inventor_g.State, inventor_g.Country) separator ';') as Inventor_address,
        GROUP_CONCAT(DISTINCT CONCAT_WS(', ', usclass_g.Class, usclass_g.Subclass) separator ';') as USClass,
        intclass_g.Section,
        intclass_g.Class,
        intclass_g.Subclass,
        intclass_g.MainGroup,
        intclass_g.SubGroup
FROM
    (
    SELECT grants.GrantID as CitingID, CitedID as PN, grants2.ApplicationID AS AN
    FROM
        gracit_g, grants, …
Run Code Online (Sandbox Code Playgroud)

mysql database query-optimization database-performance

5
推荐指数
1
解决办法
375
查看次数