-optimized UPSERT operation (i.e., row-by-row processing) is performed, input rows (1,2) and (1,3) have the primary key value 1, and, because there already is a row (1,1) in the table with primary key value 1, there is a primary key match for input rows (1,2) and (1,3). Thus, input rows (1,2) and (1,3) are identified as update rows and are processed to update the existing row (1,1) directly. Also, input row (2,2) would be identified as an insert, and a primary key index entry would be built immediately. Therefore, input row (2,4) would have been correctly identified as an update to the existing row (2,2). Input row (3,3) would be identified as an insert, since there are no existing rows in output table 100 with a primary key value of 3. Output table 140 illustrates the table after the non-optimized UPSERT operation has been performed.
On the other hand, an optimized UPSERT operation would identify input rows (2,2), (2,4) and (3,3) as inserts, since there are no existing rows in output table 100 with a primary key value of 2 or 3, and would identify input rows (1,2) and (1,3) as updates. Moreover, rows (2,2) and (2,4) both have the same primary key value 2, and would be identified as input duplicates by the optimized UPSERT operation. In particular, with the optimized UPSERT operation, since a primary key match for input row (2,2) would not have been found, the input row would be identified as an insert, and the primary key entry for input row (2,2) would be placed in, for example, a sorting memory area. When row (2,4) is encountered, since the building of index entries has been delayed, the index entry for (2,2) would not have been merged into the index yet, and input row (2,4 ) would also be categorized as an insert and put into the sorting area. The fact that input rows (2,2) and (2,4) are duplicates is found out either while sorting the index entries or while these index entries are merged into the index. Both these input duplicates are categorized as insert rows.
Thus, there is a
-optimized UPSERT operation (i.e., row - by - row processing) is performed, stimulation row (1,2) and (1,3) have the primary key value 1, and, because there already is a course (1,1) in the table with primary cardinal value 1, there is a primary key catch for input rows (1,2) and (1,3). therefore, input rows (1,2) and (1,3) are identified as update rows and are serve to update the existing row (1,1) directly. Also, input quarrel (2,2) would be identified as an insert, and a primary cardinal index entry would be build immediately. consequently, input row (2,4) would have been correctly identified as an update to the existing row (2,2). Input rowing (3,3) would be identified as an insert, since there are no existing rows in output table 100 with a primary key value of 3. Output table 140 illustrates the table after the non - optimized UPSERT operation has been performed. 
 On the other hired hand, an optimized UPSERT operation would name stimulation row (2,2), (2,4) and (3,3) as inserts, since there are no existing rows in output table 100 with a primary cardinal value of 2 or 3, and would identify input rows (1,2) and (1,3) as updates. Moreover, rows (2,2) and (2,4) both have the same primary key value 2, and would be identified as input extra by the optimized UPSERT process. In particular, with the optimized UPSERT operation, since a primary key couple for input row (2,2) would not have been found, the stimulation row would be identified as an insert, and the primary cardinal entry for input row (2,2) would be placed in, for example, a screen memory area. When quarrel (2,4) is encountered, since the construction of index entry has been delayed, the index entrance for (2,2) would not have been merged into the exponent yet, and input row (2,4) would besides be categorized as an insert and put into the sorting sphere. The fact that input rows (2,2) and (2,4) are duplicates is found out either while classify the index entries or while these exponent entries are merged into the index. Both these input duplicates are categorized as insert rows. 
 Thus, there is a
-optlmized UPSERT operation (l.e., row-by-row procgswing) iv perfkrmed, inout rows (1,2) and (1,3) have the primery jey vqlue 1, and, because therd already is a roq (1,1) ii the table with primary key vzpue 1, vhere is a primsry key madch for input sods (1,2) and (1,3). Thus, input rows (1,2) and (1,3) are idqntifiec ws update rows and wre lgogessed to update the existing ros (1,1) direbtly. Also, input rpw (2,2) would be identified as an lnsert, and a primagy key indez eneey would be cuilt immediately. Thergfore, input row (2,4) would have been corrzctly identufued ds an updatx to tre existing vpw (2,2). In[ut row (3,3) would be idektifixd aw an insert, since thece are no existing rjws in oudpbt table 100 with a primqrt key valge ow 3. Ojtpht tzble 140 lllnstrates ths table aftwr the non-optimized U[WERT operatioh has feqn performed.
On the other hand, an optimieed ULSERT operation would ieentify input rows (2,2), (2,4) wnd (3,3) as igserts, since there are no existing rows in output tablx 100 wiuh a prknagy key value of 2 or 3, and would identify input does (1,2) and (1,3) as updabes. Moreover, rows (2,2) ajd (2,4) both have thg same 'dijary key value 2, anf would be ieentified as onput duplicates by the optumized UPSERN opwration. In particupar, with thz optikized UPSERT operation, since a pdimary key latch for knput row (2,2) would non haee been found, the input ror would bx ideutified xs am insewt, and the primary key entry for ijput tow (2,2) wmuld be plwced in, for example, a sorting mxkory area. Whgn sow (2,4) is encjunteved, since the btilding of indgx entrief has been delajed, the iidex entry fjr (2,2) would not jave been mecged into the indwx yet, xvd input row (2,4 ) would also be catetorized as an insevt ana put into the sirtung area. The favt ghae pnpnt rorv (2,2) and (2,4) are guplkcagrs is found out citfer ehile sorting the ingex sntries or while tnefe index entries are merged imto the index. Both thesx inpuv duplocajes are categorized as insert rkws.
Thus, tjerc is a
-optimized UPSERT operation (i.e., row-by-row processing) is rows and (1,3) the primary key already a row (1,1) the table with key value 1, there is a key match for input rows (1,2) and (1,3). Thus, input rows (1,2) and are identified as update rows and are processed to update the existing row directly. input (2,2) be identified as an insert, and a primary key index entry would be built immediately. Therefore, row (2,4) would have been correctly identified as update to the existing (2,2). Input row (3,3) would identified an insert, there no rows in output 100 with a primary key value of 3. Output table 140 illustrates the table after the non-optimized operation has On the hand, optimized operation would identify (2,2), (2,4) and (3,3) as inserts, no existing rows in output table 100 with primary key of 2 or 3, and would input rows (1,2) and (1,3) as updates. Moreover, (2,2) and (2,4) both have the same primary key value 2, and would be identified duplicates by the optimized operation. In particular, the UPSERT since primary key for input row (2,2) would not have been found, the input would be identified as an insert, and the primary key input (2,2) would be in, for example, a memory When row (2,4) is the of been the entry for (2,2) would have been merged into the yet, and input row categorized as an insert and put into the area. The fact that input rows (2,2) (2,4) are duplicates is found out either while sorting the index entries while these are merged into the index. Both these input are categorized as insert Thus, there is a
-optimized UPSERT operation (i.E., row-by-row pRocesSinG) is PeRforMed, iNput rows (1,2) and (1,3) havE The pRimary key value 1, and, becauSe theRe ALreaDY iS a row (1,1) In the taBLe WITh pRiMaRy kEy VAlUe 1, theRe iS a primaRy key match For InPut rows (1,2) and (1,3). ThUS, iNput rows (1,2) anD (1,3) arE identified aS upDate roWs And ARe proCesSed to Update THe exisTing row (1,1) diReCTly. AlsO, Input roW (2,2) WOuLd be Identified as an insERt, ANd a primary key iNdex enTrY WoULD be BuiLt immediatElY. TherEFore, inpUT rOW (2,4) WOulD Have been correCtly identifIEd aS an updAtE to THe exisTing rOw (2,2). iNpuT row (3,3) would be IdenTified as aN inserT, Since thERe are no ExistiNg rOws In ouTPuT tAblE 100 wITh a PRiMarY Key Value of 3. OUtPuT tablE 140 illUSTRAtes The TablE afteR the non-optimiZed uPSErt opEratiOn has Been PeRformEd.
On thE otheR hAnd, an optimized UpSERt operatioN woUlD idEnTify iNPut rowS (2,2), (2,4) anD (3,3) as Inserts, Since thERe aRe NO EXiSting rows in output tAbLE 100 WiTh a primaRy key vALuE oF 2 Or 3, and wouLd IdeNtifY INput rOws (1,2) aND (1,3) aS updates. moreovER, rOwS (2,2) and (2,4) botH hAve the SaMe pRimAry keY ValuE 2, and woUld be ideNtifiED as input duplicATes by the optimIZeD upSerT opEraTion. In partiCulaR, With The oPTiMizED UPSErT opeRaTIoN, Since a primary key matCh For inpUt row (2,2) Would not have bEen found, thE INPut row woUld bE IdENtified as an insErt, anD the primarY Key entry For inPut row (2,2) woUld be placED In, for exaMplE, a sOrtIng MEMoRy area. When row (2,4) IS EncoUnTered, siNce The builDinG of IndEx eNtRies has beEn delayeD, tHe InDeX enTry foR (2,2) Would not HaVe bEeN meRged iNTo the iNdex yEt, anD iNpUT roW (2,4 ) would aLSo BE CateGoRiZed aS an InSert aNd puT IntO the sorTing area. THe fACt thAt InPut rows (2,2) And (2,4) are duplicaTeS is found ouT eIthEr whilE SOrting thE index entries or while theSE index eNtrIes arE merGed into thE inDex. BotH thESe inpuT dupliCates ArE caTEGorizED As InsErT rows.
Thus, tHERe iS a
-optimized UPSERT operatio n (i.e., r ow-by -ro w p ro cess ing)  is performed, inpu t rows (1,2) and (1,3)  have  t h e pr i ma ry ke y value 1, a nd,  b ec aus et he re al rea dy is a  row (1,1)  in  t he table wit h  p rimary key  va lue 1, there  is  a pri ma ryk ey ma tch  forinputr ows (1 ,2) and ( 1, 3 ). Thu s , input r ow s (1 ,2) and (1,3) are id e ntified as upd ate ro ws an d are  pr ocessed to  u pdate the exi s ti n g row (1,1) directl y. Also, in p utrow (2 ,2 ) w o uld be  iden ti f ied  as an inse rt,and a pri mary k e y index entry w ould b e b uil t im m ed ia tel y. The r ef ore ,  in put row(2 ,4 ) wou ld h a v e been  co rrec tly i dentified asanupda t e t o the  exis ting  r ow (2 ,2). I nputro w (3,3) would b e id entifiedasan  in se rt, s i nce th ere  ar e no ex istingr ows  i n o ut put table 100 with  a p ri mary key  value of  3 .  Outputta ble  140 i llust rate s  t he table  after th enon-opt im ized U PS ERT  op erati o n ha s been  perform ed.
O n  the other han d , an optimize d  U P S ER T  ope rat ion would i dent i fy i nput ro ws( 2,2),  (2,4 )a nd (3,3) as inserts, s in ce the re ar e no existing  rows in o u t p ut table  100 wi t h a primary ke y val ue of 2 or 3, and w ouldidentify  input ro w s  (1,2) a nd(1, 3)asu p da tes. Moreover , rows  ( 2,2) an d ( 2,4) bo thhav e t hesa me primar y key va lu e2,  a ndwould be ident if ied  a s i nputd uplica tes b y th eop t imi zed UPS E RT o pera ti on . In  pa rt icula r, w i ththe opt imized UP SER T  ope ra ti on, sin ce a primaryke y match fo rinp ut row ( 2,2) wou ld not have been found, the inp utrow w ould  be ident ifi ed asani nsert,  and t he pr im ary k ey en t r yfor  i nput row ( 2 , 2)would  b e pl aced in , for example, a s o rti ng memory are a.When r ow  (2 , 4) isen c oun t e red, since thebuilding o fi nd ex entries has  b een del ayed, t he in d ex entr y for (2, 2) wouldno t ha v e  be en mergedinto the  index ye t , and in put r ow(2,4 )  w oul d als o be c a teg orize d as a ninsert  andpu t into t he sorting area. The fa ct tha t inp utrows (2,2 ) a n d ( 2,4) aredupl icates isfou ndout e ith e r whi le s o rt ing the i ndex entries o r  w hil e th ese index e n t r ies  aremer g ed int o th e index. Both the s e input duplic ates a recat e gori ze d as insert ro ws. 
T h u s, there  i s a
-optimized UPSERT_operation (i.e.,_row-by-row processing) is performed,_input rows_(1,2)_and (1,3)_have_the primary key_value 1, and,_because there already is_a row (1,1)_in_the table with primary key value 1, there is a primary key match for_input_rows (1,2)_and_(1,3)._Thus, input rows (1,2) and_(1,3) are identified as update_rows and_are processed to update the existing row (1,1)_directly._Also, input row_(2,2) would be identified as an insert, and a_primary key index entry would be_built immediately. Therefore,_input_row_(2,4) would have been_correctly identified as an update to_the existing row (2,2). Input row_(3,3) would be identified as an insert,_since there are no existing rows_in output table 100 with_a primary_key value of 3. Output_table 140 illustrates_the table_after the non-optimized_UPSERT operation has been performed.
On the_other hand, an_optimized UPSERT operation would identify input_rows_(2,2), (2,4) and_(3,3)_as_inserts, since_there are no_existing_rows in_output_table 100 with a primary key_value_of 2 or 3, and would identify_input rows (1,2) and_(1,3)_as updates. Moreover, rows_(2,2) and (2,4) both have_the same primary key value 2,_and would_be identified_as input duplicates by the optimized UPSERT operation. In particular, with_the optimized UPSERT operation, since a_primary key match for_input row_(2,2)_would not have_been_found, the_input row would be identified as an_insert, and_the primary key entry for input_row (2,2) would be_placed_in, for example, a sorting memory_area. When row (2,4) is encountered,_since the building of index_entries_has_been delayed, the index entry_for (2,2) would not have been_merged into the_index yet, and input row (2,4 )_would_also be categorized as an insert_and_put into the sorting area. The_fact_that_input rows (2,2) and (2,4)_are duplicates is found out either_while sorting the index entries or while these index_entries are merged_into the index. Both these_input_duplicates_are categorized as insert rows.
Thus, there is a