Uploaded image for project: 'Percona Toolkit'
  1. Percona Toolkit
  2. PT-1146

LP #1220341: pt-query-digest: a lot of information is removed when doing '--no-report --output'

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: On Hold
    • Priority: Low
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None

      Description

      **Reported in Launchpad by Kenny Gryp last update 20-05-2017 09:52:53

      In this particular case, I wanted to do some more complex groupby and ordering on a large slowlog which requires a lot of memory.
      In order to be able to do this without gigabytes of memory and hours of wait time, I wanted to filter out most of the data first and create a smaller slowlog
      But unfortunately all that data is lost when doing --no-report --output slowlog

      What is lost:

      • SET TIMESTAMP
      • Time microsecond precision
      • Rows_affected
      • InnoDB_trx_id
      • hostname
      • Rows_read
      • Bytes_sent
        and many many more

      To reproduce, run:

      echo "

      1. Time: 130828 0:00:00.540005
      2. User@Host: masked[masked] @ [172.29.126.132]
      3. Thread_id: 352095 Schema: masked Last_errno: 0 Killed: 0
      4. Query_time: 0.000208 Lock_time: 0.000072 Rows_sent: 0 Rows_examined: 0 Rows_affected: 1 Rows_read: 0
      5. Bytes_sent: 11 Tmp_tables: 0 Tmp_disk_tables: 0 Tmp_table_sizes: 0
      6. InnoDB_trx_id: DF756D
      7. QC_Hit: No Full_scan: No Full_join: No Tmp_table: No Tmp_table_on_disk: No
      8. Filesort: No Filesort_on_disk: No Merge_passes: 0
      9. InnoDB_IO_r_ops: 0 InnoDB_IO_r_bytes: 0 InnoDB_IO_r_wait: 0.000000
      10. InnoDB_rec_lock_wait: 0.000000 InnoDB_queue_wait: 0.000000
      11. InnoDB_pages_distinct: 5
        SET timestamp=1377640800;
        select 'we_love_daniel';
        " | ./pt-query-digest --no-report --output slowlog

      Then you will get:

      1. Time: 130828 0:00:00
      2. User@Host: masked[masked] @ []
      3. Thread_id: 352095
      4. Query_time: 0.000208 Lock_time: 0.000072 Rows_sent: 0 Rows_examined: 0
      5. QC_Hit: No Full_scan: No Full_join: No Tmp_table: No Tmp_table_on_disk: No
      6. Filesort: No Filesort_on_disk: No Merge_passes: 0
      7. InnoDB_IO_r_ops: 0 InnoDB_IO_r_bytes: 0 InnoDB_IO_r_wait: 0.000000
      8. InnoDB_rec_lock_wait: 0.000000 InnoDB_queue_wait: 0.000000
      9. InnoDB_pages_distinct: 5
        use masked;
        select 'we_love_daniel'
        ;

        Smart Checklist

          Attachments

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              lpjirasync lpjirasync (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: