Announcement

Collapse
No announcement yet.

Long run of search getInitialResults methods

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Long run of search getInitialResults methods

    Good afternoon

    Using the admin toolbar, we add a search widget to the main page.
    After this action, the main page starts loading for 3 seconds.
    Without a widget, the page loads in 0.200 seconds.

    Search widget settings we use the following:
    HTML Code:
    widgetid = 12
    adminconfig = a:11:{s:11:"searchTitle";s:1:"2";s:19:"show_at_breakpoints";a:3:{s:7:"desktop";i:1;s:5:"sm all";i:1;s:6:"xsmall";i:1;}s:22:"module_viewpermissions";a:1:{s:4:"show";s:3:"all";}s:22:" hide_module_when_empty";s:1:"0";s:14:"resultsPerPage";s:1:"5";s:12:"hide_avatars";s:1:"0"; s:14:"hide_usernames";s:1:"0";s:13:"displayFooter";i:1;s:19:"module_filter_nodes";a:1:{s:7 :"include";a:1:{i:0;s:3:"all";}}s:10:"searchJSON";s:105:"{"date":{"from":"30"},"sort":{"re plies":"desc"},"view":"topic","exclude_type":["vBForum_PrivateMessage"]}";s:11:"widget_type";s:0:"";}
    In the logs of the database we fix the long execution of queries:
    HTML Code:
    SELECT DISTINCT node.starter AS nodeid
    FROM node as node
    LEFT JOIN node AS starter ON starter.nodeid = node.starter
    WHERE node.contenttypeid <> 30 AND node.inlist = 1 AND node.contenttypeid <> '15' AND node.protected <> '1' AND starter.lastcontent >= 1588142519
    ORDER BY starter.textcount DESC
    LIMIT 2000
    Query profiling shows that 99.95% of the time is in the “Copying To Tmp Table” state (3 seconds)

    The same problem occurs if you refuse to use widgets and receive data in the forum templates using the following commands:
    HTML Code:
    {vb:set timeOption.from, 'lastWeek'}
    {vb:set options.channel, 2}
    {vb:set options.date, {vb:raw timeOption}}
    {vb:set options.sort.replies, "desc"}
    {vb:set options.view, "topic"}
    {vb:set options.exclude_type, "vBForum_PrivateMessage"}
    {vb:data latestPosts, search, getInitialResults, {vb:raw options}, 5}

  • #2
    Make sure to set a date range for your search module. Even if you set it to 365 days, it will perform better than a search without a date range.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API - Full / Mobile
    Vote for your favorite feature requests and the bugs you want to see fixed.

    Comment

    Related Topics

    Collapse

    Working...
    X