Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

infoschema, util: Add more fields to table events_statements_summary_by_digest (#13484) #14151

Merged
merged 3 commits into from
Dec 20, 2019

Conversation

djshow832
Copy link
Contributor

@djshow832 djshow832 commented Dec 20, 2019

conflicting files: statement_summary.go

release-3.0 doesn't include `GetMoreThanOnceSelect()`.

What problem does this PR solve?

Add more fields to system table events_statements_summary_by_digest. These fields are mostly copied from slow log.

What is changed and how it works?

  • Add more fields in related structures.
  • Defer unlock, to avoid that unlocking is bypassed due to panic.

Check List

Tests

  • Unit test
  • Manual test (add detailed scripts or steps below)
*************************** 1. row ***************************
              SCHEMA_NAME: performance_schema
                   DIGEST: 688edff0859079e96540c6161b08dde9ab5f8654bd2755a0dbca27de5e06f93e
              DIGEST_TEXT: select * from events_statements_summary_by_digest
                TABLE_IDS: NULL
              INDEX_NAMES: NULL
                     USER: root@127.0.0.1
               EXEC_COUNT: 1
              SUM_LATENCY: 908412
              MAX_LATENCY: 908412
              MIN_LATENCY: 908412
              AVG_LATENCY: 908412
        AVG_PARSE_LATENCY: 37964
        MAX_PARSE_LATENCY: 37964
      AVG_COMPILE_LATENCY: 472427
      MAX_COMPILE_LATENCY: 472427
             COP_TASK_NUM: 0
     AVG_COP_PROCESS_TIME: 0
     MAX_COP_PROCESS_TIME: 0
  MAX_COP_PROCESS_ADDRESS: NULL
        AVG_COP_WAIT_TIME: 0
        MAX_COP_WAIT_TIME: 0
     MAX_COP_WAIT_ADDRESS: NULL
         AVG_PROCESS_TIME: 0
         MAX_PROCESS_TIME: 0
            AVG_WAIT_TIME: 0
            MAX_WAIT_TIME: 0
         AVG_BACKOFF_TIME: 0
         MAX_BACKOFF_TIME: 0
           AVG_TOTAL_KEYS: 0
           MAX_TOTAL_KEYS: 0
       AVG_PROCESSED_KEYS: 0
       MAX_PROCESSED_KEYS: 0
        AVG_PREWRITE_TIME: 0
        MAX_PREWRITE_TIME: 0
          AVG_COMMIT_TIME: 0
          MAX_COMMIT_TIME: 0
   AVG_GET_COMMIT_TS_TIME: 0
   MAX_GET_COMMIT_TS_TIME: 0
  AVG_COMMIT_BACKOFF_TIME: 0
  MAX_COMMIT_BACKOFF_TIME: 0
    AVG_RESOLVE_LOCK_TIME: 0
    MAX_RESOLVE_LOCK_TIME: 0
AVG_LOCAL_LATCH_WAIT_TIME: 0
MAX_LOCAL_LATCH_WAIT_TIME: 0
           AVG_WRITE_KEYS: 0
           MAX_WRITE_KEYS: 0
           AVG_WRITE_SIZE: 0
           MAX_WRITE_SIZE: 0
     AVG_PREWRITE_REGIONS: 0
     MAX_PREWRITE_REGIONS: 0
            AVG_TXN_RETRY: 0
            MAX_TXN_RETRY: 0
            BACKOFF_TYPES: NULL
                  AVG_MEM: 0
                  MAX_MEM: 0
        AVG_AFFECTED_ROWS: 0
               FIRST_SEEN: 2019-11-14 20:43:30
                LAST_SEEN: 2019-11-14 20:43:30
        QUERY_SAMPLE_TEXT: select * from events_statements_summary_by_digest

Code changes

  • Has exported function/method change

Side effects

  • Possible performance regression
  • Increased code complexity
  • Breaking backward compatibility

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation

Release note

  • Add more fields to system table events_statements_summary_by_digest.

@djshow832
Copy link
Contributor Author

/run-all-tests

@AilinKid AilinKid changed the title infoschema, util: Add more fields to table `events_statements_summary… infoschema, util: Add more fields to table events_statements_summary_by_digest (#13484) Dec 20, 2019
Copy link
Contributor

@crazycs520 crazycs520 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@AilinKid AilinKid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@djshow832
Copy link
Contributor Author

/run-unit-test

@zimulala zimulala merged commit 620a6c0 into pingcap:release-3.0 Dec 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants