Skip to content

Improve speed of basic API search function #5419

Open
@jywarren

Description

@jywarren

Right now, going to https://publiclab.org/search and typing "india" and pressing submit takes a long time.

https://oss.skylight.io/app/applications/GZDPChmcfm1Q/recent/6h/endpoints/Srch::Search%20%5BGET%5D%20srch%2Fall

https://oss.skylight.io/app/applications/GZDPChmcfm1Q/1554726720/12h/endpoints/Srch::Search%20%5BGET%5D%20srch%2Fall

4 seconds to 51 seconds...

Much of this is searching rusers -- ~8 seconds:

image

SELECT  DISTINCT `rusers`.* FROM `rusers` INNER JOIN `node` ON `node`.`uid` = `rusers`.`id` INNER JOIN `node_revisions` ON `node_revisions`.`nid` = `node`.`nid` WHERE (MATCH(bio, username) AGAINST(? IN BOOLEAN MODE)) AND (rusers.status = ?) AND (node_revisions.status = ?) ORDER BY node_revisions.timestamp DESC LIMIT ?

Can we optimize this query?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions