EP3047397B1

Mirroring, in memory, data from disk to improve query performance

Abstract

This record has no abstract on file.

EP3047397B1, drawing sheet 1
Sheet 1 of 11

Term

8 yearsleft in the term

Expires 15 September 2034.

  1. Priority and filed
  2. Granted
  3. Today
  4. Expires

15 claims: 3 independent, 12 dependent

  1. 1
    A method comprising:maintaining, on persistent storage (110), a database that is accessible to a database server (120);wherein the database includes persistent-format data (112), stored in a persistent format;wherein a copy of all data items from the persistent-format data (112) is stored on the persistent storage (110);converting at least a portion of the persistent-format data (112) to a mirror format to produce mirror-format data (104);wherein the mirror format is different from and independent of the persistent format;maintaining the mirror-format data (104) in volatile memory (102, 502, 504) accessible to the database server (120);wherein each data item in the mirror-format data (104) is a copy of a corresponding data item in the persistent-format data (112);within the volatile memory (102, 502, 504), as the database server (120) executes database operations that make changes to the persistent-format data (112), the database server (120) maintaining the mirror-format data (104) transactionally consistent with the persistent-format data (112) in that any data items provided to a transaction from the mirror-format data (104) will be the same version that would have been provided if the data items were provided to the transaction from the persistent-format data (112);determining, by the database server (120), that a scan operation of a table of the database which has at least a portion of its data in volatile memory (102, 502, 504) as mirror-format data (104) is to be performed;in response to said determination, the database server (120) performing a scan operation on the table in which a first set of data items for the scan operation are obtained from the mirror-format data (104) and a second set of data items for the scan operation are obtained from the persistent-format data (112).
  2. 2
    The method of Claim 1 further comprising:receiving, by the database server (120), a further request to execute a database command that requires a required set of data items;in response to receiving the further request, the database server (120) determining whether obtaining a first subset of data items, of the required set of data items, for execution of the database command, from the persistent-format data (112) would be more efficient than obtaining the first subset of data items, for execution of the database command, from the mirror-format data (104), wherein the data items of the first subset of data items reside in both the persistent-format data (112) and the mirror-format data (104);responsive to the database server (120) determining that obtaining the first subset of data items from the persistent-format data (112) would be more efficient, the database server (120) obtaining the first subset of data items from the persistent-format data (112);and responsive to the database server (120) determining that obtaining the first subset of data items from the mirror-format data (104) would be more efficient, the database server (120) obtaining the first subset of data items from the mirror-format data (104).
  3. 3
    The method of Claim 2 wherein:within the database, data items that belong to the persistent-format data (112) are stored in a particular order;and the method further comprises, within volatile memory (102, 502, 504), ordering data items that belong to the mirror-format data (104) in a manner that reflects said particular order.
  4. 4
    The method of Claim 1 wherein the mirror format is a column-major format and/or the mirror format is a compressed format.
  5. 5
    The method of Claim 1 wherein:the mirror format is a column-major format and the persistent format is a row-major format;or when a particular data item in the persistent-format data (112) is updated as part of a transaction, and the particular data item is also in the mirror-format data (104), then the particular data item is also updated in the mirror-format data (104) as part of the same transaction.
  6. 6
    The method of Claim 2 wherein:the database server (120) determines that obtaining the first subset of data items from the persistent-format data (112) would be efficient, and that obtaining a second subset of data items, of the required set of data items, from the mirror-format data (104) would be efficient;and during execution of the database command, the database server (120) obtains the first subset of data items from the persistent-format data (112), and obtains the second subset of data items from the mirror-format data (104).
  7. 7
    The method of Claim 1 wherein the step of maintaining the mirror-format data (104) transactionally consistent with the persistent-format data (112) includes implicitly making changes to data items that belong to the mirror-format data (104), without directly making the changes to data items that belong to the mirror-format data (104), by recording the changes in journals (304) stored in the volatile memory (102, 502, 504).
  8. 8
    The method of Claim 7 further comprising:in response to a change, made as part of a transaction, to a data item that belongs to the persistent-format data (112), performing the steps of: before the transaction is committed, storing a record of the change in a private journal (312, 314, 316, 662, 664, 666) that is only visible to the transaction;and in response to the transaction committing, moving the record of the change to a global journal (310, 602) that is visible to other transactions.
  9. 9
    The method of Claim 8 further comprising merging at least some changes indicated in the global journal (310, 602) into the mirror-format data (104); wherein, in some embodiments, the mirror format is a compressed format and the step of merging comprises:decompressing at least a portion of the mirror-format data (104) to produce uncompressed data;updating the uncompressed data to produce updated uncompressed data that reflects said at least some changes;and compressing the updated uncompressed data.
  10. 10
    The method of Claim 1 further comprising:receiving, by the database server (120), a further request to execute a database command that requires data items, from the database, that satisfy certain criteria;in response to receiving the further request, the database server (120) performing the steps of: using the mirror-format data (104) to determine which data items, from the database, satisfy the certain criteria;and obtaining the data items that satisfy the certain criteria from the persistent-format data (112).
  11. 11
    The method of Claim 10 wherein:the mirror-format data (104) includes a column vector (220, 222) for a particular column;the certain criteria include whether values from the particular column satisfy a condition;and using the mirror-format data (104) to determine which data items, from the database, satisfy the certain criteria comprises identifying which values, within the column vector (220, 222), satisfy the condition.
  12. 12
    The method of Claim 1 wherein:a first portion of the mirror-format data (104) is compressed at a first level;and a second portion of mirror-format data (104) is compressed at a second level that is different from the first level;and wherein, in some embodiments, either (i) the first level and the second level are specified by a user, or (ii) the first level and the second level are automatically determined based on access patterns to the mirror-format data (104).
  13. 13
    The method of Claim 1 wherein:the scan operation requires a particular data item;the persistent-format data (112) includes a first copy of the particular data item that is in the persistent format;the mirror-format data (104) includes a second copy of the particular data item that is in the mirror format;a data cache (106), residing in the volatile memory (102, 502, 504), includes a third copy of the particular data item that is in the persistent format;and the method further comprises, when performing the scan operation, the database server (120) obtaining the third copy of the particular data item from the data cache (106), and not from the persistent-format data (112) or mirror-format data (104).
  14. 14
    A system comprising:one or more processors executing a database server (120);persistent storage (110) having stored thereon a database that is accessible to the database server (120);wherein the system is adapted for performing a method recited in any one of Claims 1-13.
  15. 15
    One or more computer-readable media storing instructions which, when executed by one or more processors, cause performance of a method recited in any one of Claims 1-13.