RU2647648C1 - Method of organizing storage of historical deltas of records - Google Patents

Method of organizing storage of historical deltas of records Download PDF

Info

Publication number
RU2647648C1
RU2647648C1 RU2016146592A RU2016146592A RU2647648C1 RU 2647648 C1 RU2647648 C1 RU 2647648C1 RU 2016146592 A RU2016146592 A RU 2016146592A RU 2016146592 A RU2016146592 A RU 2016146592A RU 2647648 C1 RU2647648 C1 RU 2647648C1
Authority
RU
Russia
Prior art keywords
record
deltas
page
records
data
Prior art date
Application number
RU2016146592A
Other languages
Russian (ru)
Inventor
Никита Сергеевич Печенкин
Андрей Александрович Коротченко
Дмитрий Владимирович Васюков
Original Assignee
Общество с ограниченной ответственностью "Научно-технический центр РЕЛЭКС" (ООО "НТЦ РЕЛЭКС")
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Общество с ограниченной ответственностью "Научно-технический центр РЕЛЭКС" (ООО "НТЦ РЕЛЭКС") filed Critical Общество с ограниченной ответственностью "Научно-технический центр РЕЛЭКС" (ООО "НТЦ РЕЛЭКС")
Priority to RU2016146592A priority Critical patent/RU2647648C1/en
Application granted granted Critical
Publication of RU2647648C1 publication Critical patent/RU2647648C1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1873Versioning file systems, temporal file systems, e.g. file system supporting different historic versions of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2308Concurrency control

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

FIELD: computer engineering.
SUBSTANCE: invention relates to computer technology, in particular to methods of storing data, and can be used in a database management system (DBMS). Method for storing historical deltas of records in which at least one database record is created that contains data and a header; save the above-formed at least one entry in the page-organized file on the storage device, in which each data page contains a header and a data area for storing records; modifying at least one record on the page on the storage device; determine the delta of the record sufficient to restore the recording state to a modification; add the delta entry defined in the previous step to an ordered set of deltas, which is stored as part of the record.
EFFECT: technical result is to increase the performance of the DBMS by storing the deltas of the record together with the record.
7 cl, 6 dwg, 3 tbl

Description

ОБЛАСТЬ ТЕХНИКИFIELD OF TECHNOLOGY

[1] Данное техническое решение относится к области вычислительной техники, в частности к способам хранения данных, и может быть использовано в системе управления базами данных (СУБД).[1] This technical solution relates to the field of computer technology, in particular to data storage methods, and can be used in a database management system (DBMS).

УРОВЕНЬ ТЕХНИКИBACKGROUND

[2] Из уровня техники известна заявка на патент на изобретение US 20150039559 A1 «Compressing a multi-version database», патентообладатель International Business Machines Corp, в котором предлагается размещать исторические дельты изменений (DELTA CHANGES) на отдельном твердотельном накопителе (SSD). Дельты записей при этом накапливаются в т.н. дельта-блоке (DELTA BLOCKS) и лишь после его наполнения преобразуются и сохраняются на страницу данных. Дельты не являются частью оригинальной записи.[2] The patent application US 20150039559 A1, Compressing a multi-version database, patent holder of International Business Machines Corp, proposes to place historical change deltas (DELTA CHANGES) on a separate solid-state drive (SSD). In this case, deltas of records accumulate in the so-called delta block (DELTA BLOCKS) and only after filling it are converted and saved to the data page. Deltas are not part of the original recording.

[3] Также известна заявка на патент на изобретение US 20150046413 А1 «Delta store giving row-level versioning semantics to a non-row-level versioning underlying store», патентообладатель SAP SE, в котором предлагается обеспечивать конкурентный доступ к данным путем создания хранилища дельт (delta store) в ОЗУ, а основное хранилище (main store) не допускает параллельных транзакций на хранящихся данных и не хранит исторических дельт.[3] Also known is the patent application US 20150046413 A1, “Delta store giving row-level versioning semantics to a non-row-level versioning underlying store”, patentee SAP SE, which proposes to provide competitive access to data by creating a delta storage (delta store) in RAM, and the main store (main store) does not allow parallel transactions on stored data and does not store historical deltas.

СУЩНОСТЬ ИЗОБРЕТЕНИЯSUMMARY OF THE INVENTION

[4] Данное техническое решение направлено на устранение недостатков, присущих существующим решениям хранения данных.[4] This technical solution is aimed at eliminating the disadvantages inherent in existing data storage solutions.

[5] Технической задачей или проблемой, поставленной в данном решении, является организация хранения исторических дельт записи при модификации записи.[5] The technical task or problem posed in this solution is the organization of storage of historical record deltas during record modification.

[6] Технический результат, проявляющий при решении вышеуказанной задачи, заключается в повышении производительности системы управления базами данных за счет уменьшения расхода емкости ЗУ и хранения дельт записи вместе с записью.[6] The technical result when solving the above problem is to increase the performance of the database management system by reducing the memory capacity and storing the deltas of the record along with the record.

[7] Также дополнительным техническим результатом является повышение скорости операций, связанных с поиском, чтением и модификацией исторических дельт записи, хранящихся вместе с записью.[7] Also an additional technical result is an increase in the speed of operations associated with the search, reading and modification of historical record deltas stored with the record.

[8] Дополнительно при решении вышеуказанной задачи рационально используется оперативная память в техническом решении. Также хранение массива исторических дельт как части записи позволяет уменьшить накладные вычислительные расходы, связанные с адресацией и поиском исторической дельты по сравнению с конкурирующими решениями.[8] Additionally, in solving the above problem, RAM is used rationally in a technical solution. Also, storing an array of historical deltas as part of a record can reduce the computational overhead associated with addressing and searching for a historic delta compared to competing solutions.

[9] Вышеуказанный технический результат достигается посредством осуществления способа организации хранения исторических дельт записей, в котором формируют, по меньшей мере, одну запись базы данных, которая содержит данные и заголовок; сохраняют сформированную выше, по меньшей мере, одну запись в странично-организованный файл на запоминающем устройстве, в котором каждая страница данных содержит заголовок и область данных для хранения записей; осуществляют модификацию, по меньшей мере, одной записи на странице на запоминающем устройстве; определяют дельту записи, достаточную для восстановления состояния записи до модификации; добавляют определенную на предыдущем шаге дельту записи в упорядоченный набор дельт записи, который хранится как часть записи.[9] The above technical result is achieved by implementing a method for organizing the storage of historical deltas of records in which at least one database record is formed that contains data and a header; storing the at least one record formed above into a page-organized file on a storage device in which each data page contains a title and a data area for storing records; modifying at least one entry on a page on a storage device; determining a recording delta sufficient to restore the recording state prior to modification; add the record delta defined in the previous step to the ordered set of record deltas, which is stored as part of the record.

[10] В некоторых вариантах осуществления технического решения выбор страницы данных, в которую будет помещена запись, происходит с учетом соответствия совокупных размеров уже размещенных записей и/или их частей пороговым значениям.[10] In some embodiments of the technical solution, the selection of the data page in which the record will be placed takes into account the correspondence of the total sizes of already placed records and / or their parts to threshold values.

[11] В некоторых вариантах осуществления технического решения осуществляют модификацию записи по запросу пользователя и/или служебной операции СУБД, и/или при выполнении хранимых процедур, и/или при срабатывании триггеров, и/или исполнении определенных пользователем функций (UDF).[11] In some embodiments of the technical solution, the record is modified at the request of the user and / or DBMS service operation, and / or when performing stored procedures, and / or when triggers are triggered, and / or performing user-defined functions (UDF).

[12] В некоторых вариантах осуществления технического решения при осуществлении модификации записи контролируют соответствие совокупных размеров записей и/или их частей на странице пороговым значениям.[12] In some embodiments of the technical solution, when the record is modified, the compliance of the total sizes of the records and / or their parts on the page with threshold values is controlled.

[13] В некоторых вариантах осуществления технического решения дельта записи содержит атрибут или поле записи, и ее старое значение.[13] In some embodiments of the technical solution, the recording delta contains an attribute or field of the recording and its old value.

[14] В некоторых вариантах осуществления технического решения набор дельт записи упорядочен в хронологическом порядке.[14] In some embodiments of the technical solution, the set of record deltas is ordered in chronological order.

[15] В некоторых вариантах осуществления технического решения запоминающим устройством является ОЗУ, и/или ПЗУ, и/или магнитная память, и/или флэш-память, и/или магнитный диск и/или оптический диск.[15] In some embodiments of the technical solution, the storage device is RAM, and / or ROM, and / or magnetic memory, and / or flash memory, and / or a magnetic disk and / or optical disk.

КРАТКОЕ ОПИСАНИЕ ЧЕРТЕЖЕЙBRIEF DESCRIPTION OF THE DRAWINGS

[16] Признаки и преимущества настоящего изобретения станут очевидными из приведенного ниже подробного описания изобретения и прилагаемых чертежей, на которых:[16] The features and advantages of the present invention will become apparent from the following detailed description of the invention and the accompanying drawings, in which:

[17] На Фиг. 1 схематически изображена структура записи, где 101 - заголовок, 102 - тело записи, 103 - массив исторических дельт 104-106. 104 - последняя добавленная историческая дельта, а 106 - первая.[17] In FIG. 1 schematically shows the recording structure, where 101 is the header, 102 is the body of the record, 103 is an array of historical deltas 104-106. 104 is the last historical delta added, and 106 is the first.

[18] На Фиг. 2 изображена страница данных (201) с заголовком (202) и областью данных (203), представлены пороги PDS (206), PDH (207) и записи (204, 205).[18] In FIG. Figure 2 shows a data page (201) with a header (202) and a data area (203); thresholds PDS (206), PDH (207) and records (204, 205) are presented.

[19] На Фиг. 3 изображены состояния записи (301, 301', 301'') в моменты времени t0 (312), t1 (313), t2 (314) в каждый из которых добавлялась новая историческая дельта (307, 308, 309 соответственно). В момент времени t0 и t1 запись (301, 301') целиком находится на странице (315) данных. Будем считать, что добавление следующей исторической дельты (309) привело бы к превышению порога PHL, следовательно, ранее добавленные исторические дельты (308', 307'') перенесены в сегмент исторических данных (316). Если в момент времени t3>t2 нет транзакций, заинтересованных в сохранении исторических дельт 308' и 307'', сегмент версионных данных (316) может быть освобожден.[19] In FIG. Figure 3 shows the recording states (301, 301 ', 301' ') at time instants t0 (312), t1 (313), t2 (314) into each of which a new historical delta was added (307, 308, 309, respectively). At time t0 and t1, the record (301, 301 ') is entirely on the data page (315). We assume that adding the next historical delta (309) would lead to exceeding the PHL threshold, therefore, previously added historical deltas (308 ', 307' ') were transferred to the historical data segment (316). If at time t3> t2 there are no transactions interested in saving the historical deltas 308 'and 307' ', the version data segment (316) can be freed.

[20] На Фиг. 4 переведена блок-схема, иллюстрирующая вариант реализации размещения новой записи на странице.[20] In FIG. 4, a block diagram has been translated illustrating an embodiment of placing a new record on a page.

[21] На Фиг. 5 переведена блок-схема, иллюстрирующая вариант реализации обновления существующей записи.[21] In FIG. 5 is a flowchart illustrating an embodiment of updating an existing record.

[22] На Фиг. 6 переведена блок-схема, иллюстрирующая вариант реализации удаления существующей записи.[22] In FIG. 6 is a flowchart illustrating an embodiment of deleting an existing record.

ПОДРОБНОЕ ОПИСАНИЕ ИЗОБРЕТЕНИЯDETAILED DESCRIPTION OF THE INVENTION

[23] Ниже будут описаны понятия и определения, необходимые для подробного раскрытия осуществляемого изобретения.[23] Below will be described the concepts and definitions necessary for the detailed disclosure of the invention.

[24] Запись - набор значений различных типов, предназначенный к хранению в ЗУ.[24] Record - a set of values of various types, intended for storage in memory.

[25] База данных, database - представленная в объективной форме совокупность самостоятельных материалов (статей, расчетов, нормативных актов, судебных решений и иных подобных материалов), систематизированных таким образом, чтобы эти материалы могли быть найдены и обработаны с помощью электронной вычислительной машины (ЭВМ).[25] Database, database - a set of independent materials (articles, calculations, normative acts, court decisions and other similar materials) presented in an objective form, systematized so that these materials can be found and processed using an electronic computer (computer) )

[26] Система управления базами данных, Database Management System, СУБД, DBMS - совокупность программных и лингвистических средств общего или специального назначения, обеспечивающих управление созданием и использованием баз данных.[26] Database management system , Database Management System, DBMS, DBMS - a set of software and linguistic tools for general or special purposes, providing management of the creation and use of databases.

[27] Управление конкурентным доступом с помощью многоверсионности, MultiVersion Concurrency Control, MVCC - механизм обеспечения одновременного конкурентного доступа к базе данных, заключающийся в предоставлении каждому пользователю т.н. снимка (snapshot) БД, обладающего тем свойством, что вносимые пользователем изменения в БД невидимы другим пользователям до момента фиксации транзакции.[27] Competitive access control using multi-versioning, MultiVersion Concurrency Control, MVCC - a mechanism for ensuring simultaneous competitive access to a database, which consists in providing each user with a so-called a snapshot of a database that has the property that user-made changes to the database are not visible to other users until the transaction is committed.

[28] Транзакция - группа последовательных операций с базой данных, которая представляет собой логическую единицу работы с данными. Транзакция может быть выполнена либо целиком и успешно, соблюдая целостность данных и независимо от параллельно идущих других транзакций, либо не выполнена вообще и тогда она не должна произвести никакого эффекта.[28] A transaction is a group of sequential operations with a database, which is a logical unit of work with data. A transaction can be executed either entirely and successfully, observing data integrity and regardless of other transactions running in parallel, or not executed at all and then it should not have any effect.

[29] Историческая дельта записи или дельта записи (англ. delta record) - описание изменения записи, достаточное для восстановления ее исходного содержимого.[29] Historical record delta or record delta (English delta record) - a description of a record change that is sufficient to restore its original contents.

[30] Устаревшая историческая дельта записи - историческая дельта записи, предназначенная для восстановления содержимого записи в такое состояние, которое, согласно выбранной модели изоляции БД, не может быть больше востребовано ни одной неоконченной транзакцией.[30] An outdated historical record delta is a historical record delta designed to restore the contents of a record to a state that, according to the selected database isolation model, can no longer be claimed by any unfinished transaction.

[31] Согласно Фиг. 1, способ организации хранения исторических дельт записей осуществляется следующим образом.[31] According to FIG. 1, a method of organizing the storage of historical deltas of records is as follows.

[32] Шаг 101: формируют, по меньшей мере, одну запись базы данных, которая содержит данные и заголовок;[32] Step 101 : forming at least one database record that contains data and a header;

[33] Вновь созданная запись (Фиг. 1) состоит из данных (102') и заголовка (101') и не имеет ни одного элемента в массиве исторических дельт.[33] The newly created record (Fig. 1) consists of data (102 ') and a header (101') and has no elements in the array of historical deltas.

[34] Шаг 102: сохраняют сформированную выше, по меньшей мере, одну запись в странично-организованный файл на запоминающем устройстве, в котором каждая страница данных содержит заголовок и область данных для хранения записей;[34] Step 102 : save the at least one record generated above into a page-organized file on a storage device in which each data page contains a header and a data area for storing records;

[35] Записи хранятся в странично организованном файле, в котором каждая страница с данными состоит из области данных и заголовка. Область данных используется для хранения записей, а часть области данных зарезервирована под возможное расширение существующих записей при обновлении и под хранение исторических дельт записи.[35] Records are stored in a page-organized file in which each data page consists of a data area and a header. The data area is used to store records, and part of the data area is reserved for the possible extension of existing records during updating and for storage of historical record deltas.

[36] Выбор страницы данных, в которую будет помещена запись, происходит с учетом (Фиг. 4) соответствия совокупных размеров уже размещенных записей и/или их частей следующим пороговым значениям:[36] The selection of the data page into which the record will be placed takes into account (Fig. 4) the correspondence of the total sizes of already placed records and / or their parts to the following threshold values:

PDH (page data hard limit) - максимально допустимый совокупный размер всех записей на странице, при достижении данного значения запрещается (406) вставка новых записей на страницу;PDH (page data hard limit) - the maximum allowable total size of all records on the page; upon reaching this value, it is forbidden (406) to insert new records on the page;

PDS (page data soft limit) - максимально допустимый совокупный размер всех записей на странице без учета их исторических дельт, причем при достижении значения PDS запрещается (406) вставка новых записей на страницу.PDS (page data soft limit) - the maximum permissible total size of all records on a page without taking into account their historical deltas, and upon reaching a value of PDS it is forbidden (406) to insert new records on a page.

[37] Осуществление добавления новой записи (Фиг. 4) производится только при условии, что не превышен ни порог PDH (402), ни порог PDS(403).[37] Adding a new record (Fig. 4) is carried out only under the condition that neither the threshold PDH (402) nor the threshold PDS (403) is exceeded.

[38] При этом в отличие от модификации, для страниц, которые не выполняют условия порогов, не производится какая-либо оптимизация пространства, поиск и удаления устаревших записей. Данный подход применяется для минимизации времени вставки новой записи.[38] At the same time, unlike the modification, for pages that do not fulfill the threshold conditions, no space optimization, search or removal of outdated records is performed. This approach is used to minimize the insertion time of a new record.

[39] Шаг 103: осуществляют модификацию, по меньшей мере, одной записи на странице на запоминающем устройстве;[39] Step 103 : modifying at least one entry on a page on a storage device;

[40] Причиной модификации записи могут являться: запросы пользователя, служебные операции СУБД, выполнение хранимых процедур, срабатывание триггеров, исполнение определенных пользователем функций (UDF) и пр.[40] The reason for the modification of a record may be: user requests, DBMS service operations, execution of stored procedures, triggering of triggers, execution of user-defined functions (UDF), etc.

[41] Пусть в момент времени Т=1 база данных имеет следующее состояние:[41] Suppose that at time moment T = 1 the database has the following state:

Figure 00000001
Figure 00000001

[42] Транзакция Т0 выполнила операции Объект1=«Foo» и Объект2=«Bar», после чего транзакция Т1 выполнила операцию Объект1=«Hello». Объект1 будет хранить свое старое значение «Foo» до тех пор, пока не завершатся все транзакции ТХ созданные в промежутке времени 0<Х<1, поскольку они «видят» только значение «Foo».[42] Transaction T0 performed the operations Object1 = “Foo” and Object2 = “Bar”, after which the transaction T1 performed the operation Object1 = “Hello”. Object1 will keep its old value “Foo” until all TX transactions created in the interval 0 <X <1 are completed, because they only see the value “Foo”.

[43] В случае модификации записи для обеспечения управления конкурентным доступом с помощью MVCC необходимо обеспечить хранение как нового состояния и значения записи, так и информации о предыдущем ее [записи] состоянии и значении. Текущее значение записи хранится явно в теле записи (102), а для восстановления какого-либо из предыдущих состояний записи используются дельты из массива исторических дельт (103). Каждая новая дельта добавляется при модификации записи и содержит информацию достаточную для полного восстановления предыдущего состояния записи после применения к текущему значению записи. Формат хранения дельт не является ограничивающим фактором и может быть любым.[43] If a record is modified to ensure concurrent access control using MVCC, it is necessary to ensure storage of both the new state and value of the record, as well as information about its previous [record] state and value. The current value of the record is stored explicitly in the body of the record (102), and deltas from the array of historical deltas (103) are used to restore any of the previous states of the record. Each new delta is added when a record is modified and contains information sufficient to completely restore the previous record state after applying to the current record value. The storage format of the deltas is not a limiting factor and can be any.

[44] При модификации записи в данном техническом решении производят контроль соответствия совокупных размеров записей и/или их частей на странице (Фиг. 2, Фиг. 5) пороговым значениям PDH (см. описание выше) и PDL.[44] When modifying the record in this technical solution, a check is made on the correspondence of the total sizes of the records and / or their parts on the page (Fig. 2, Fig. 5) to the threshold values PDH (see description above) and PDL.

[45] PHL (page history limit) - максимально допустимый совокупный размер всех исторических дельт всех записей на странице, при достижении этого порога на странице производится поиск устаревших исторических дельт (508) и их удаление (510) и/или перенос (509) части исторических дельт в отдельную область ЗУ - сегмент версионных данных.[45] PHL (page history limit) - the maximum permissible total size of all historical deltas of all records on a page; upon reaching this threshold, a page searches for obsolete historical deltas (508) and removes them (510) and / or transfer (509) parts historical deltas in a separate area of the memory - a segment of versioned data.

[46] В случае превышения вышеуказанных порогов при модификации записи производится оптимизация использования свободного пространства на странице. Для этого, в случае превышения порога PDH (502), во всех массивах исторических дельт всех записей на странице производят поиск дельт, которые предназначены для восстановления состояний, которые не «нужны» ни одной незаконченной транзакции. Такие дельты называются устаревшими и могут быть удалены (510), что освободит некоторое пространство на странице.[46] If the above thresholds are exceeded when the record is modified, the use of free space on the page is optimized. To do this, if the threshold PDH (502) is exceeded, in all arrays of historical deltas of all records on the page, they search for deltas that are designed to restore states that are not “needed” by any unfinished transaction. Such deltas are called obsolete and can be removed (510), which will free up some space on the page.

[47] Если и после удаления всех устаревших дельт на странице пороговое значение PDH остается превышенным, то часть исторических дельт (самые «старые» из тех, что остались) переносятся (509) в специальную область на запоминающем устройстве - сегмент версионных данных.[47] If even after deleting all obsolete deltas on the page, the threshold value of PDH remains exceeded, some historical deltas (the “oldest” ones that remain) are transferred (509) to a special area on the storage device — the version data segment.

[48] Сегмент версионных данных (Фиг. 3) организован как одна или более связанных страниц в странично организованном файле, которые предназначены для хранения только исторических дельт, каждый сегмент версионных данных связан не более чем с одной страницей данных. Сегмент версионных данных для страницы создается в том случае, когда операция над записями на странице данных приведет к превышению порогового значения PHL, сегмент существует до тех пор, пока содержит хотя бы одну не устаревшую историческую дельту. Величины порогов задаются при создании таблицы.[48] The versioned data segment (Fig. 3) is organized as one or more linked pages in a page-organized file that are designed to store only historical deltas, each versioned data segment is associated with no more than one data page. A versioned data segment for a page is created when an operation on records on a data page results in the PHL threshold being exceeded; a segment exists as long as it contains at least one historical obsolete delta. The threshold values are set when creating the table.

[49] В случае удаления записи (Фиг. 6) непосредственно всю запись с данными и устаревшими дельтами можно удалять со страницы только в том случае, если не осталось ни одной транзакции, начавшейся раньше удаления, а все дельты являются устаревшими. Поскольку вероятность такой ситуации достаточно низкая при существовании большого числа одновременных транзакций в СУБД, то вместо удаления запись помечается (603) как удаленная. Физическое удаление записи произойдет при модификации записи в странице, и/или будет превышен один из порогов. В этом случае при поиске устаревших данных на странице запись будет найдена и удалена со страницы.[49] In the case of deleting a record (Fig. 6), directly the entire record with data and outdated deltas can be deleted from the page only if there are no transactions left that started before the deletion, and all deltas are obsolete. Since the likelihood of such a situation is quite low when there are a large number of simultaneous transactions in the DBMS, instead of deleting, the record is marked (603) as deleted. Physical deletion of a record will occur when a record in a page is modified, and / or one of the thresholds is exceeded. In this case, when searching for outdated data on the page, the record will be found and deleted from the page.

[50] Шаг 104: определяют дельту записи, достаточную для восстановления состояния записи до модификации;[50] Step 104 : determine a recording delta sufficient to restore the recording state prior to modification;

[51] Формат хранения дельты записи может быть реализован различными способами. В простейшем случае в дельтах хранят указание атрибута (поля) записи и ее старого значения. Пусть, например, некий объект с атрибутами ID и STR менялся в ходе работы СУБД следующим образом:[51] The storage format of the recording delta can be implemented in various ways. In the simplest case, the deltas store the indication of the attribute (field) of the record and its old value. Suppose, for example, an object with the attributes ID and STR changed during the DBMS operation as follows:

Figure 00000002
Figure 00000002

тогда запись можно условно представить следующим образом:then the record can be arbitrarily represented as follows:

{id:2,str:«Hello3»} [str:«Hello»→«Hello3»}][Id:{1->2}][str:{«Foo»}→«Hello»}][id:{->1}, id{->«Foo»}], где {id:2,str:«Hello3»} - последнее (текущее) значение объекта, а в скобках приведены исторические дельты. Самая первая дельта описывает создание записи, поэтому указано только добавленное значение, поскольку предыдущего не существовало на тот момент.{id: 2, str: "Hello3"} [str: "Hello" → "Hello3"}] [Id: {1-> 2}] [str: {"Foo"} → "Hello"}] [id: {-> 1}, id {-> "Foo"}], where {id: 2, str: "Hello3"} is the last (current) value of the object, and historical deltas are given in brackets. The very first delta describes the creation of the record, so only the added value is indicated, since the previous one did not exist at that time.

[52] Шаг 105: добавляют определенную на предыдущем шаге дельту записи в упорядоченный набор дельт записи, который хранится как часть записи.[52] Step 105 : add the recording delta defined in the previous step to the ordered set of recording deltas, which is stored as part of the recording.

[53] Упорядоченное хранение необходимо для упрощения освобождения (удаления) устаревших записей. Пусть запись[53] Orderly storage is necessary to simplify the release (deletion) of obsolete records. Let the record

[54] {id:2,str:«Hello3»}[str:{«Hello»→«Hello3»}][Id:{1->2}][str:{«Foo»→«Hello»}][id:{->1},id{->«Foo»}][54] {id: 2, str: "Hello3"} [str: {"Hello" → "Hello3"}] [Id: {1-> 2}] [str: {"Foo" → "Hello"}] [id: {-> 1}, id {-> "Foo"}]

[55] Описывает изменения последовательными (или сериализованными) транзакциями Т0, Т1, Т2, Т3 совершенными в моменты времени 0, 1, 2, 3 соответственно. Тогда, если на момент поиска и удаления устаревших дельт записи известно, что в системе нет незавершенных транзакций, созданных раньше момента времени 3, то дельты записи, описывающие более ранние состояния, уже не могут быть кем-либо затребованными, и являются устаревшими и будут удалены без каких-либо дополнительных проверок, после чего запись примет вид:[55] Describes changes in sequential (or serialized) transactions T0, T1, T2, T3 committed at time points 0, 1, 2, 3, respectively. Then, if at the time of searching and deleting obsolete record deltas, it is known that the system does not have incomplete transactions created earlier than time point 3, then record deltas describing earlier states can no longer be requested by anyone and are outdated and will be deleted without any additional checks, after which the entry will take the form:

{id:2,str:«Hello3»}[str:{«Hello»→«Hello3»}][][][]{id: 2, str: "Hello3"} [str: {"Hello" → "Hello3"}] [] [] []

[56] Освободившееся пространство в «хвосте» записи будет повторно использовано для сдвига дельт при добавлении новой дельты записи:[56] The free space in the “tail” of the record will be reused to shift the deltas when a new record delta is added:

{id:2,str:«NEW»}[str:{«Hello3»→«NEW»}][str:{«Hello»→«Hello3»}][][]{id: 2, str: "NEW"} [str: {"Hello3" → "NEW"}] [str: {"Hello" → "Hello3"}] [] []

[57] Кроме того, как было указано выше - самые старые дельты записи при определенных условиях могут быть перенесены на другую страницу в сегмент версионных данных. Обращение к дополнительной странице несет определенные накладные расходы, но, как показывает практика, чем «старее» дельта, тем ниже вероятность того, что она кому-либо будет необходима, а значит целесообразно более «востребованные» дельты хранить на той же странице, что и запись, а более старые - переносить при необходимости. Это еще один аргумент хранить дельты упорядоченно по времени добавления.[57] In addition, as indicated above, the oldest record deltas, under certain conditions, can be transferred to another page in the versioned data segment. Access to the additional page carries certain overhead costs, but, as practice shows, the “older” the delta, the lower the likelihood that someone will need it, which means it is advisable to store more “popular” deltas on the same page as record, and older - transfer if necessary. This is another argument to keep deltas in order of time.

[58] Каждая запись, к которой осуществляется конкурентный доступ, помимо непосредственно данных и заголовков (Фиг. 1, позиции 101 и 102) на данном шаге дополнительно содержит массив исторических дельт записи - набор исторических дельт записи (Фиг. 1, позиции 104, 105 и 106), упорядоченный в обратном хронологическом порядке: первый элемент содержит дельту, полученную последней, а последний элемент - полученную первой.[58] Each record that is competitively accessed, in addition to directly the data and headers (Fig. 1, positions 101 and 102) at this step additionally contains an array of historical record deltas - a set of historical record deltas (Fig. 1, positions 104, 105 and 106), ordered in reverse chronological order: the first element contains the delta received last, and the last element received the first.

Пусть Объект1 менялся в ходе работы СУБД следующим образом:Let Object1 change during the DBMS operation as follows:

Figure 00000003
Figure 00000003

тогда согласно осуществлению изобретения запись можно условно представить как «Hello3»[«2»→«3»][«o»→«o2»][«Foo»→«Hello»][→«Foo»],then, according to an embodiment of the invention, the record can be arbitrarily represented as “Hello3” [“2” → “3”] [“o” → “o2”] [“Foo” → “Hello”] [→ “Foo”],

т.е. хранится последнее значение («Hello3») и цепочка изменений в обратном хронологическом порядке от Т3 к Т0.those. the last value is stored (“Hello3”) and the chain of changes in reverse chronological order from T3 to T0.

[59] Пусть для записи из вышеописанного примера выполняется условие, что нет ни одной транзакции Tn, для которой выполнялось бы условие Т0<Tn<Т3, то запись можно упростить до следующей: «Hello3»[→«Foo»].[59] Let the following condition be satisfied for the record from the above example, that there is no transaction Tn for which the condition Т0 <Tn <Т3 is satisfied, then the record can be simplified to the following: “Hello3” [→ “Foo”].

Claims (12)

1. Способ организации хранения исторических дельт записей, включающий следующие шаги:1. A method of organizing the storage of historical deltas of records, including the following steps: - формируют, по меньшей мере, одну запись базы данных, которая содержит данные и заголовок;- form at least one database record that contains data and a header; - сохраняют сформированную выше, по меньшей мере, одну запись в странично-организованный файл на запоминающем устройстве, в котором каждая страница данных содержит заголовок и область данных для хранения записей;- save the above-formed at least one record in a page-organized file on a storage device in which each data page contains a header and a data area for storing records; - осуществляют модификацию, по меньшей мере, одной записи на странице на запоминающем устройстве;- carry out the modification of at least one entry on the page on the storage device; - определяют дельту записи, достаточную для восстановления состояния записи до модификации;- determine the recording delta sufficient to restore the recording state before modification; - добавляют определенную на предыдущем шаге дельту записи в упорядоченный набор дельт записи, который хранится как часть записи.- add the record delta defined in the previous step to the ordered set of record deltas, which is stored as part of the record. 2. Способ по п. 1, характеризующийся тем, что выбор страницы данных, в которую будет помещена запись, происходит с учетом соответствия совокупных размеров уже размещенных записей и/или их частей пороговым значениям.2. The method according to p. 1, characterized in that the selection of the data page in which the record will be placed, taking into account the compliance of the total dimensions of the already posted records and / or their parts with threshold values. 3. Способ по п. 1, характеризующийся тем, что осуществляют модификацию записи по запросу пользователя и/или служебной операции СУБД, и/или при выполнении хранимых процедур, и/или при срабатывании триггеров, и/или исполнении определенных пользователем функций (UDF).3. The method according to claim 1, characterized in that the record is modified at the request of the user and / or DBMS service operation, and / or when performing stored procedures, and / or when triggers are triggered, and / or performing user-defined functions (UDF) . 4. Способ по п. 1, характеризующийся тем, что при осуществлении модификации записи контролируют соответствие совокупных размеров записей и/или их частей на странице пороговым значениям.4. The method according to p. 1, characterized in that during the modification of the record control the compliance of the total size of the records and / or their parts on the page with threshold values. 5. Способ по п. 1, характеризующийся тем, что дельта записи содержит атрибут или поле записи и ее старое значение.5. The method according to claim 1, characterized in that the recording delta contains an attribute or field of the record and its old value. 6. Способ по п. 1, характеризующийся тем, что набор дельт записи упорядочен в хронологическом порядке.6. The method according to p. 1, characterized in that the set of record deltas is ordered in chronological order. 7. Способ по п. 1, характеризующийся тем, что запоминающим устройством является ОЗУ, и/или ПЗУ, и/или магнитная память, и/или флэш-память, и/или магнитный диск, и/или оптический диск.7. The method according to p. 1, characterized in that the storage device is RAM, and / or ROM, and / or magnetic memory, and / or flash memory, and / or magnetic disk, and / or optical disk.
RU2016146592A 2017-04-13 2017-04-13 Method of organizing storage of historical deltas of records RU2647648C1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
RU2016146592A RU2647648C1 (en) 2017-04-13 2017-04-13 Method of organizing storage of historical deltas of records

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
RU2016146592A RU2647648C1 (en) 2017-04-13 2017-04-13 Method of organizing storage of historical deltas of records

Publications (1)

Publication Number Publication Date
RU2647648C1 true RU2647648C1 (en) 2018-03-16

Family

ID=61629482

Family Applications (1)

Application Number Title Priority Date Filing Date
RU2016146592A RU2647648C1 (en) 2017-04-13 2017-04-13 Method of organizing storage of historical deltas of records

Country Status (1)

Country Link
RU (1) RU2647648C1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019226387A1 (en) * 2018-05-25 2019-11-28 Microsoft Technology Licensing, Llc Persistent version storage for relational database management system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050108294A1 (en) * 2003-11-18 2005-05-19 Hartmut Koerner Delta-mechanism for integration of OLAP-based planning and reporting
RU2391697C2 (en) * 2004-09-09 2010-06-10 Майкрософт Корпорейшн Method, system and device for creation of architecture model to generate reliable and easy-to-control applications for data protection in system of data protection
US20150039559A1 (en) * 2013-07-31 2015-02-05 International Business Machines Corporation Compressing a multi-version database
US20150278281A1 (en) * 2014-03-28 2015-10-01 Futurewei Technologies, Inc. Efficient Methods and Systems for Consistent Read in Record-Based Multi-Version Concurrency Control
US9467338B2 (en) * 2010-04-01 2016-10-11 Blackberry Limited Method for communicating device management data changes

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050108294A1 (en) * 2003-11-18 2005-05-19 Hartmut Koerner Delta-mechanism for integration of OLAP-based planning and reporting
RU2391697C2 (en) * 2004-09-09 2010-06-10 Майкрософт Корпорейшн Method, system and device for creation of architecture model to generate reliable and easy-to-control applications for data protection in system of data protection
US9467338B2 (en) * 2010-04-01 2016-10-11 Blackberry Limited Method for communicating device management data changes
US20150039559A1 (en) * 2013-07-31 2015-02-05 International Business Machines Corporation Compressing a multi-version database
US20150278281A1 (en) * 2014-03-28 2015-10-01 Futurewei Technologies, Inc. Efficient Methods and Systems for Consistent Read in Record-Based Multi-Version Concurrency Control

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019226387A1 (en) * 2018-05-25 2019-11-28 Microsoft Technology Licensing, Llc Persistent version storage for relational database management system
US11379433B2 (en) 2018-05-25 2022-07-05 Microsoft Technology Licensing, Llc Persistent version storage for relational database management system

Similar Documents

Publication Publication Date Title
US10656859B2 (en) Efficient deduplication for storage systems
US10262013B2 (en) Efficient full delete operations
US10564850B1 (en) Managing known data patterns for deduplication
US6567928B1 (en) Method and apparatus for efficiently recovering from a failure in a database that includes unlogged objects
US10769134B2 (en) Resumable and online schema transformations
EP3170106B1 (en) High throughput data modifications using blind update operations
Levandoski et al. LLAMA: A cache/storage subsystem for modern hardware
RU2672719C2 (en) Extended storage without locks for multiple access methods
EP3418883B1 (en) Apparatus and method for read optimized bulk data storage
US9155320B2 (en) Prefix-based leaf node storage for database system
US6834275B2 (en) Transaction processing system using efficient file update processing and recovery processing
US7418544B2 (en) Method and system for log structured relational database objects
US8560500B2 (en) Method and system for removing rows from directory tables
CN107038206B (en) LSM tree establishing method, LSM tree data reading method and server
Mei et al. SifrDB: A unified solution for write-optimized key-value stores in large datacenter
EP1548598A1 (en) Database re-organizing system and database
CN109800185B (en) Data caching method in data storage system
CN110209528B (en) Data backup method, device, server and storage medium
US11755427B2 (en) Fast recovery and replication of key-value stores
TW201514734A (en) Database managing method, database managing system, and database tree structure
US20180011897A1 (en) Data processing method having structure of cache index specified to transaction in mobile environment dbms
RU2647648C1 (en) Method of organizing storage of historical deltas of records
CN112965939A (en) File merging method, device and equipment
KR101419428B1 (en) Apparatus for logging and recovering transactions in database installed in a mobile environment and method thereof
WO2020238750A1 (en) Data processing method and apparatus, electronic device, and computer storage medium

Legal Events

Date Code Title Description
PD4A Correction of name of patent owner