AtlasOfLivingAustralia / logger-service

Atlas event logging
https://logger.ala.org.au
1 stars 8 forks source link

Wrong values in event_summary_breakdown_email_entity table #11

Open nickdos opened 8 years ago

nickdos commented 8 years ago

Doing a select * from event_summary_breakdown_email_entity limit 10; returns:

+--------+-------------------+---------------------+------------+------------------+--------------+
| month  | log_event_type_id | user_email_category | entity_uid | number_of_events | record_count |
+--------+-------------------+---------------------+------------+------------------+--------------+
| 201411 |              1000 | unspecified         | dp42       |            53030 |        53030 |
| 201411 |              1000 | unspecified         | in4        |            62729 |        62729 |
| 201411 |              1000 | unspecified         | dp20       |           191831 |       191831 |
| 201411 |              1000 | unspecified         | co80       |             3454 |         3454 |
| 201411 |              1000 | unspecified         | co114      |            11733 |        11733 |
| 201411 |              1000 | unspecified         | co118      |             1254 |         1254 |
| 201411 |              1000 | unspecified         | in16       |            30140 |        30140 |
| 201411 |              1000 | unspecified         | in22       |            14999 |        14999 |
| 201411 |              1000 | unspecified         | co56       |             2496 |         2496 |
| 201411 |              1000 | unspecified         | dp36       |           392424 |       392424 |
+--------+-------------------+---------------------+------------+------------------+--------------+

The problem is the number_of_events and record_count columns contain the same values. It appears the record_count values are probably correct.

nickdos commented 3 years ago

Latest values in this table look OK but historical values are wrong (same as above):

mysql> select * from event_summary_breakdown_email_entity where month = '202103' limit 10;
+--------+-------------------+---------------------+------------+------------------+--------------+
| month  | log_event_type_id | user_email_category | entity_uid | number_of_events | record_count |
+--------+-------------------+---------------------+------------+------------------+--------------+
| 202103 |              1002 | other               | co10       |                6 |         8666 |
| 202103 |              1002 | other               | co111      |                1 |            1 |
| 202103 |              1002 | other               | co117      |                6 |         7812 |
| 202103 |              1002 | other               | co118      |                1 |            1 |
| 202103 |              1002 | other               | co12       |                2 |          117 |
| 202103 |              1002 | other               | co122      |                5 |         2517 |
| 202103 |              1002 | other               | co125      |                5 |         3460 |
| 202103 |              1002 | other               | co139      |                4 |         1334 |
| 202103 |              1002 | other               | co140      |                1 |            1 |
| 202103 |              1002 | other               | co153      |                5 |         8213 |
+--------+-------------------+---------------------+------------+------------------+--------------+
10 rows in set (0.01 sec)

and first 10 rows show:

ysql> select * from event_summary_breakdown_email_entity limit 10;
+--------+-------------------+---------------------+------------+------------------+--------------+
| month  | log_event_type_id | user_email_category | entity_uid | number_of_events | record_count |
+--------+-------------------+---------------------+------------+------------------+--------------+
| 201911 |              1000 | unspecified         | co118      |                8 |            8 |
| 201911 |              1000 | unspecified         | co12       |                5 |            5 |
| 201911 |              1000 | unspecified         | co121      |                2 |            2 |
| 201911 |              1000 | unspecified         | co16       |                3 |            3 |
| 201911 |              1000 | unspecified         | co55       |                6 |            6 |
| 201911 |              1000 | unspecified         | co60       |               12 |           12 |
| 201911 |              1000 | unspecified         | co75       |                2 |            2 |
| 201911 |              1000 | unspecified         | dp20       |               13 |           13 |
| 201911 |              1000 | unspecified         | dp31       |               19 |           19 |
| 201911 |              1000 | unspecified         | dp36       |               25 |           25 |
+--------+-------------------+---------------------+------------+------------------+--------------+
10 rows in set (0.00 sec)