Aurora Version: 5.7.mysql_aurora.2.04.5
Params modified:
- aurora_lab_mode = 0
- performance_schema = 1
- performance_schema_consumer_events_statements_history_long = 1
- performance_schema_consumer_statements_digest = 1
I'm using a small Golang app where I loop through a number of sample queries 100 times and loop through all 3 times. I'm using the sample Sakila and Employees databases. Although I've mostly been testing with this app, I've also done some smaller runs manually using the mysql command line and got similar results.
The problem I'm seeing is that the values in events_statements_summary_by_digest aren't counting for each iteration of the queries running. There are some queries in my app that do count accurately with others that don't and I can't find any pattern as to why. I've also checked to ensure the table isn't coming close to being filled.
Query ran 300 times:
select city as c from sakila.city where country_id = 2;
I tried a new connection with the same exact query 300 more times and got the same result of still showing a count of 1.
Query ran 300 times:
select city as c from sakila.city where country_id = 3;
As you can see I've changed the value of country_id to 3. Even though the query ran 300 times, it only added 1 to the count.
Again I ran the same query with a new connection with the country_id = 3 and the count didn't increase and stayed at 2.
Query ran 300 times:
select city as c from sakila.city where country_id = 4;
Changed country_id = 4. Once again only added 1 to the count.
Ran again with country_id = 4 with a new connection and count stayed as 3.
Query ran 300 times:
select city as c from sakila.city where country_id = 2;
I changed country_id back to 2 which is the same value from the first run. As you can see the count stays at 3.
These queries below run without issues and the counts are accurate. Both of these queries are running in the exact same manner from the same Go app and against the exact same db.
select first_name from sakila.actor where last_name = 1
update sakila.staff set active = 'Yes' where staff_id = 1
Here are a few more that don't count accurately.
select concat(first_name, ' ', last_name) as n from sakila.actor where last_update > 2006-02-16 limit 1
select concat(e.first_name, ' ', e.last_name) as current_employee from employees.departments as d inner join employees.dept_manager as dm on d.dept_no = dm.dept_no inner join employees.employees as man ON dm.emp_no = man.emp_no inner join employees.dept_emp as de ON dm.dept_no = de.dept_no inner join employees.employees as e ON de.emp_no = e.emp_no where d.dept_no = 'd009' and de.to_date > '2021-06-01' and concat(e.first_name, ' ', e.last_name) = 'Aamer Cyre' group by dept_name, current_employee order by dept_name, current_employee limit 1000
select concat(e.first_name, ' ', e.last_name) as current_employee from employees.departments as d inner join employees.dept_manager as dm on d.dept_no = dm.dept_no inner join employees.employees as man ON dm.emp_no = man.emp_no inner join employees.dept_emp as de ON dm.dept_no = de.dept_no inner join employees.employees as e ON de.emp_no = e.emp_no where d.dept_no = 'd009' and de.to_date > '2021-06-01' and concat(e.first_name, ' ', e.last_name) = 'Aamer Cyre' group by dept_name, current_employee order by dept_name, current_employee