(12) United States Patent (10) Patent No.: US 9,053,153 B2 Schreter (45) Date of Patent: Jun
Total Page:16
File Type:pdf, Size:1020Kb
US009053153B2 (12) United States Patent (10) Patent No.: US 9,053,153 B2 Schreter (45) Date of Patent: Jun. 9, 2015 (54) INTER-QUERY PARALLELIZATION OF 95. R. 358. RaSudevan al. et.....I707,as: al. CONSTRAINT CHECKING 7,113.953 B2 * 9/2006 Brown et al. ...... 707,615 7,240,054 B2 * 7/2007 Adiba et al. .......................... 1.1 (75) Inventor: Ivan Schreter, Malsch (DE) 8,301,934 B1 * 10/2012 Ramesh et al. ................. T14, 18 8,336,051 B2 * 12/2012 Gokulakannan ... ... 718, 101 (73) Assignee: SAP SE, Walldorf (DE) 8,375,047 B2 * 2/2013 Narayanan et al. ... 707 764 2002/01741.08 A1* 11/2002 Cotner et al. ..................... 707/3 - r 2004/0010502 A1* 1 2004 Bomfim et al. 7O7/1OO (*) Notice: Subject to any disclaimer, the term of this 2005, 0131893 A1* 6/2005 Von Glan .......................... 707/5 patent is extended or adjusted under 35 2006/0212465 A1* 9, 2006 Fish et al. ... 707/101 U.S.C. 154(b) by 12 days. 2007/0239661 A1* 10, 2007 Cattell et al. ...................... 707/2 2009/0037498 A1* 2/2009 Mukherjee et al. ........... 707,205 (21) Appl. No.: 13/525,935 2010/0005077 A1* 1/2010 Krishnamurthy et al. ........ 7O7/4 9 2011/0010330 A1 1/2011 McCline et al. .............. 707,602 1-1. 2012/0254887 A1* 10/2012 Rodriguez ... ... 718, 106 (22) Filed: Jun. 18, 2012 2012fO265728 A1* 10, 2012 Plattner et al. 707/6O7 2012/0278282 A1* 11/2012 Lu et al. ......... TO7/634 (65) Prior Publication Data 2012,0310985 A1* 12/2012 Gale et al. ... 707/792 US 2013/03393 12 A1 Dec. 19, 2013 2012,0323971 A1* 12, 2012 Pasupuleu leti .................... 707/8O2 * cited by examiner (51) Int. Cl. G06F I7/00 (2006.01) Primary Examiner —Miranda Le G06F 7/30 (2006.01) (74) Attorney, Agent, or Firm — Mintz Levin Cohn Ferris (52) U.S. Cl. Glovsky and Popeo, P.C. CPC ...... G06F 7/305 (2013.O1): G06F 7/30.445 ( ); (2013.01) (57) ABSTRACT (58) Field of Classification Search A plurality of operations are executed on tables of a database CPC ..................... G06F 17/30445; G06F 17/30348 with at least a portion of the operations being executed in USPC ................... 707/687,999.003,695, 703,704 parallel. A constraint check is performed for each operation See application file for complete search history. Subsequent to its execution to determine whether data stored in the database affected by the operation is valid, during this (56)56 References Cited constraint checking9. additional operationsp and/or constraint checks on the same table are allowed to run in parallel. Based U.S. PATENT DOCUMENTS on this constraint checking, operations for which the con 4.947.320 A * 8, 1990 Crus etal 1f1 straint check determines that the data is not valid are invali 5,706,494 A * / 1998 caneet al... i? dated. Related apparatus, systems, techniques and articles are 6,115,722 A * 9/2000 Isip et al. ......... 1/1 also described. 6,295,539 B1* 9/2001 Isip, Jr. ... ... 1/1 6,374,236 B1 * 4/2002 Chen et al. ............................ 1f1 21 Claims, 3 Drawing Sheets 300 DATASTORAGEAPPLICATION 104 \, PAGE MANAGER 314 SAVEPOINT MANAGER 316 PAGEMANAGEMENT 320 FREE BLOCK CONVERTER MANAGER 322 TABLE 342 CONVERTER SHADOW ACTIVE LOGICAL 304 PAGE PAGES PAGES 306 PAGES BUFFER LOGGER 344 PAGE STATUS PERSISTENCE INFO 324 n 112 LAYER LONGERTERM I DATA 310 STORED PAGESAT STORAGE 4 UVOLUMES PHYSICALLOCATIONS U.S. Patent Jun. 9, 2015 Sheet 1 of 3 US 9,053,153 B2 U.S. Patent Jun. 9, 2015 Sheet 2 of 3 US 9,053,153 B2 SLIOLLNETIÕESGOSNOLLWYJEdOHOWEHO-‘WHO-JAJEd (JEHLEHMENINHEIECIOLXOBHOINIVHISNOOW'NOILITOEXE OZZ U.S. Patent Jun. 9, 2015 Sheet 3 of 3 US 9,053,153 B2 US 9,053,153 B2 1. 2 INTER-QUERY PARALLELIZATION OF inter-query and intra-query constraint checks are performed CONSTRAINT CHECKING for the operations. Operations for which the constraint check determines the operation is not valid are invalidated. TECHNICAL FIELD Articles of manufacture are also described that comprise computer executable instructions permanently stored on non The subject matter described herein relates to techniques transitory computer readable media, which, when executed for parallelization of database constraint checking. by a computer, causes the computer to perform operations herein. Similarly, computer systems are also described that BACKGROUND may include a processor and a memory coupled to the pro 10 cessor. The memory may temporarily or permanently store Relational databases allow defining constraints on data, one or more programs that cause the processor to perform one Such as uniqueness check, referential integrity check or value or more of the operations described herein. In addition, opera domain checks. These constraints need to be checked during tions specified by methods can be implemented by one or insertion or update of the data in the database. Since database more data processors either within a single computing system tables are inherently shared structures, it’s not easy to paral 15 or distributed among two or more computing systems. lelize constraint checking inter-query, except simple value The subject matter described herein provides many advan domain checks, which are out-of-Scope for this application. tages. For example, the current Subject matter allows for a Checking constraints normally doesn’t pose any serious much more rapid execution of database operations by Subse problem in “normal databases, where the execution time is quently performing constraint checks which can require sig by far dominated by I/O time. However, with in-memory nificant upfront processing time (especially with in-memory databases, the situation is different. Since no disk I/O is databases). involved and CPU power is abundant, lack of inter-query The details of one or more variations of the subject matter parallelization of constraint checking can seriously hamper described herein are set forth in the accompanying drawings performance. and the description below. Other features and advantages of 25 the subject matter described herein will be apparent from the SUMMARY description and drawings, and from the claims. In one aspect, a plurality of operations are executed on DESCRIPTION OF DRAWINGS tables of a database with at least a portion of the operations being executed in parallel. A constraint check is performed 30 FIG. 1 is a diagram illustrating a system including a data for each operation Subsequent to its execution to determine storage application; whether data stored in the database affected by the operation FIG. 2 is a process flow diagram illustrating a technique for is valid. Based on this constraint intra-query parallelization of constraint checking; and checking, operations for which the constraint check deter FIG.3 is a diagram illustrating details of the system of FIG. mines that the data is not valid are invalidated. 35 1. At least a portion of the constraint checks are performed in parallel to execution of additional operations and/or con DETAILED DESCRIPTION straint checks. Rows of the database can be given monotoni cally-increasing row identifiers. The database can use multi FIG. 1 shows an example of a system 100 in which a version concurrency control. The operations can be selected 40 computing system 102, which can include one or more pro from a group consisting of insert, update, and delete opera grammable processors that can be collocated, linked over one tions. For each insert or update operation, the corresponding or more networks, etc., executes one or more modules, soft constraint check can be limited to row identifiers existing ware components, or the like of a data storage application prior to the execution of the corresponding operation. Invali 104. The data storage application 104 can include one or more dating operations can include, for example, executing the 45 of a database, an enterprise resource program, a distributed corresponding operationina Substransaction, and performing storage system (e.g. NetApp Filer available from NetApp of a Substransaction rollback for the corresponding operation in Sunnyvale, Calif.), or the like. case of a failed constraint check. The one or more modules, software components, or the like For each row in the database, it can be identified whether can be accessible to local users of the computing system 102 the row has been fully checked. In Such cases, the constraint 50 as well as to remote users accessing the computing system checks can be performed, for example, by: determining that 102 from one or more client machines 106 over a network an operation violating the constraint check against a row in connection 110. One or more user interface screens produced the database identified as being fully checked indicates a by the one or more first modules can be displayed to a user, definitive constraint violation, and determining that an opera either via a local display or via a display associated with one tion violating the constraint check against a row in the data 55 of the client machines 106. Data units of the data storage base not identified as being fully checked requires a recheck application 104 can be transiently stored in a persistence layer after the row is fully checked. The constraint checks can be 112 (e.g. a page buffer or other type oftemporary persistency repeated if the operation violated a constraint check against a layer), which can write the data, in the form of storage pages, row in the database which was not identified as being fully to one or more storages 114, for example via an input/output checked at Such time as the corresponding row is identified as 60 component 116. The one or more storages 114 can include being fully checked. one or more physical storage media or devices (e.g.