Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#1739 closed Bug (fixed)

Spurious SQL conditions creating excessive mySQL warnings

Reported by: DriverDan Owned by:
Priority: normal Milestone: Piwik 1.1
Component: Core Keywords:
Cc: Sensitive: no

Description

At least one of the queries that updates a visit has an unnecessary LIMIT that causes mySQL warnings when using replication. For a busy installation this grows the log file excessively. It also appears to have extra WHERE conditions that aren't required.

Example:

100929 11:32:53 [Warning] Statement may not be safe to log in statement format. Statement: /* SHARDING_ID_SITE = 87 */
                                                UPDATE piwik_log_visit
                                                SET visit_total_actions = visit_total_actions + 1,  visit_exit_idaction_url = '52003', visit_last_action_time = '2010-09-29 15:32:53', visit_total_time = '10'
                                                WHERE idsite = '87'
                                                        AND idvisit = '8235537'
                                                        AND visitor_idcookie = 'efa9f489fa1263fcd2ae1f6a36054dc6'
                                                LIMIT 1

Since idvisit is unique there is no reason to have a limit, idsite or visitor_cookie in the query. At the very least, removing the LIMIT will prevent the mySQL warning.

Change History (2)

comment:1 Changed 4 years ago by vipsoft (robocoder)

  • Resolution set to fixed
  • Status changed from new to closed

(In [3195]) fixes #1739 - remove LIMIT clause; leaving the WHERE clause intact until we address #409

comment:2 Changed 4 years ago by vipsoft (robocoder)

  • Keywords mySQL removed
  • Milestone set to 1.1 - Piwik 1.1
Note: See TracTickets for help on using tickets.