Skip to content

Visits Over Time uses all available columns which causes the report generate slowly. #17941

@weixuezhang

Description

@weixuezhang

When no columns specified in parameter, Visits Over Time uses all available columns which causes report generate slowly. In this situation, it should use columns from option table record option_name of viewDataTableParameters_***_VisitsSummary.getEvolutionGraph.

Expected Behavior

When no columns specified in parameter, Visits Over Time should use columns from option table record option_name of viewDataTableParameters_***_VisitsSummary.getEvolutionGraph.

Current Behavior

Visits Over Time uses all available columns so that generate many metrics not needed and lost time.

Possible Solution

Steps to Reproduce (for Bugs)

In global.ini.php, set "log_level = DEBUG" and "log_sql_queries = 1", we can see query for segment 'done90a5a511e1974bca37613b6daec137ba' which is in Frequency plugin, whose metrics are not shown in Visits Over Time.
DEBUG CoreAdminHome[2021-08-31 03:04:55 UTC] [a58b2] Db::fetchAll() executing SQL: SELECT option_name, option_value FROM matomo_option WHERE option_name LIKE ?
DEBUG CoreAdminHome[2021-08-31 03:04:55 UTC] [a58b2] Db::fetchAll() executing SQL: SELECT arc1.idarchive, arc1.value, arc1.name, arc1.ts_archived, arc1.date1 as startDate, arc2.value as nb_visits, arc3.value as nb_visits_converted
DEBUG CoreAdminHome[2021-08-31 03:04:55 UTC] [a58b2] FROM matomo_archive_numeric_2021_08 arc1
DEBUG CoreAdminHome[2021-08-31 03:04:55 UTC] [a58b2] LEFT JOIN matomo_archive_numeric_2021_08 arc2 on arc2.idarchive = arc1.idarchive and (arc2.name = 'nb_visits')
DEBUG CoreAdminHome[2021-08-31 03:04:55 UTC] [a58b2] LEFT JOIN matomo_archive_numeric_2021_08 arc3 on arc3.idarchive = arc1.idarchive and (arc3.name = 'nb_visits_converted')
DEBUG CoreAdminHome[2021-08-31 03:04:55 UTC] [a58b2] WHERE arc1.idsite = ?
DEBUG CoreAdminHome[2021-08-31 03:04:55 UTC] [a58b2] AND arc1.date1 = ?
DEBUG CoreAdminHome[2021-08-31 03:04:55 UTC] [a58b2] AND arc1.date2 = ?
DEBUG CoreAdminHome[2021-08-31 03:04:55 UTC] [a58b2] AND arc1.period = ?
DEBUG CoreAdminHome[2021-08-31 03:04:55 UTC] [a58b2] AND (((arc1.name IN ('done90a5a511e1974bca37613b6daec137ba','done90a5a511e1974bca37613b6daec137ba.VisitsSummary'))))
DEBUG CoreAdminHome[2021-08-31 03:04:55 UTC] [a58b2]
DEBUG CoreAdminHome[2021-08-31 03:04:55 UTC] [a58b2] AND arc1.ts_archived IS NOT NULL
DEBUG CoreAdminHome[2021-08-31 03:04:55 UTC] [a58b2] ORDER BY arc1.ts_archived DESC, arc1.idarchive DESC
DEBUG CoreAdminHome[2021-08-31 03:04:55 UTC] [a58b2] Db::fetchOne() executing SQL: SELECT 1
DEBUG CoreAdminHome[2021-08-31 03:04:55 UTC] [a58b2] FROM matomo_log_visit
DEBUG CoreAdminHome[2021-08-31 03:04:55 UTC] [a58b2] WHERE idsite = ?
DEBUG CoreAdminHome[2021-08-31 03:04:55 UTC] [a58b2] AND visit_last_action_time >= ?
DEBUG CoreAdminHome[2021-08-31 03:04:55 UTC] [a58b2] AND visit_last_action_time <= ?
DEBUG CoreAdminHome[2021-08-31 03:04:55 UTC] [a58b2] LIMIT 1

Context

Your Environment

  • Matomo Version:
  • PHP Version:
  • Server Operating System:
  • Additionally installed plugins:
  • Browser:
  • Operating System:

Metadata

Metadata

Assignees

No one assigned

    Labels

    MajorIndicates the severity or impact or benefit of an issue is much higher than normal but not critical.c: PerformanceFor when we could improve the performance / speed of Matomo.not-in-changelogFor issues or pull requests that should not be included in our release changelog on matomo.org.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions