Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-9662

The LogMiner minable logs query can be optimized to remove the left join

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 3.4.0.Beta1
    • None
    • oracle-connector
    • None

      In SqlUtils#allMinableLogsQuery, we construct a query that combines two distinct subqueries: one that retrieves the redo logs and another that retrieves the archive logs.

      The portion of this query that retrieves the redo logs performs a left join against the archive log table to remove from the result set any online logs that may match sequence numbers; however, this left join can be expensive in some environments that maintain substantial amounts of archive log history.

      To optimize this query and make sure we do not break connector behavior, we need to perform the following changes:

      1. Remove the LEFT JOIN on V$ARCHIVED_LOG and any WHERE-clause predicates
      2. Change the query to specify L.STATUS = 'CURRENT' rather than L.STATUS != 'UNUSED'
      3. In LogFileCollector's deduplicateLogFiles, invert the behavior, favoring archive logs and removing redo log entries if there are matching archive logs.

              ccranfor@redhat.com Chris Cranford
              ccranfor@redhat.com Chris Cranford
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: