RDS Performance Insights doesn't seem to be recording TOP SQL stats for prepared statements

0

I am currently facing an issue where my TOP SQL stats are displayed as "-" for all my queries. I am using an Aurora Mysql 8.0.mysql_aurora.3.04.0 database.

After further investigation I came to the conclusion that this is only happening for prepared statements. I am using a NodeJS ORM for database communication which uses prepared statements for all their queries.

Reproducing this issue is easy:

  1. Call a prepared statement like the following:
PREPARE stmt_name FROM 'SELECT * FROM my_table WHERE column1 = ?';
SET @param_value = 'some_value';
EXECUTE stmt_name USING @param_value;
DEALLOCATE PREPARE stmt_name;
  1. Notice that the query FROM 'SELECT * FROM my_table WHERE column1 = ?' gets logged in performance insights but its stats are not set.
  2. Now execute the query without using a prepared statement:
SELECT * FROM my_table WHERE column1 = <value>
  1. Notice how the query gets logged in performance insights with the stats values present.

I suspect that this has something to do with the way mysql records performance data from prepared statements as they are not recorded in performance_schema.events_statements_summary_by_digest table but instead on performance_schema.prepared_statements_instances table. Maybe RDS Performance Insights is having some issues pulling the stats data from the latter.

Any help is greatly appreciated, thanks!

질문됨 9달 전134회 조회
답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠