goto :EOF rem rem Subroutine for Executing RF1s rem called from RF1 and THROUGHPUT_RF1 rem :RF1 OSQL -I -E -l 120 -d%DB% -Q"exec RF1 %2,%3,%4,%5" -o %OUTPUTPATH%\RF1_%2_%6.out :LOOP3 semaphore -release RF1 @if ERRORLEVEL 1 goto :LOOP3 goto :EOF rem rem Subroutine for Executing RF2s rem called from RF2 and THROUGHPUT_RF2 rem :RF2_LOAD set "SQLTEXT=bulk insert OLDORDERS_%2 from '%UPDATEDRIVE%%UPDATEDIR%\Delete.u%3.%2' with (FieldTerminator = '|', RowTerminator ='|',tablock)" sqlcmd -I -E -l 120 -d%DB% -Q"%SQLTEXT%" -o %OUTPUTPATH%\RF2_load_orders_%2_%3.out sqlcmd -I -E -l 120 -d%DB% -Q"insert into MOD_OLDORDERS (O_ORDERDATE, O_ORDERKEY) (select B.O_ORDERDATE, B.O_ORDERKEY from OLDORDERS_%2 A, ORDERS B where A.O_ORDERKEY = B.O_ORDERKEY)" -o %OUTPUTPATH%\RF2_insert_orders_%2_%3.out :LOOP4 semaphore -release RF2_LOAD @if ERRORLEVEL 1 goto :LOOP4 goto :EOF :RF2 OSQL -I -E -l 120 -d%DB% -Q"exec RF2 %2,%3,%4,%5" -o %OUTPUTPATH%\RF2_%2_%6.out :LOOP5 semaphore -release RF2 @if ERRORLEVEL 1 goto :LOOP5 goto :EOF :ERROR_EXIT echo Run aborted due to error echo Check output in %OUTPUTPATH% exit /B F.4. RF1_init.sql -- -- Create tables to hold RF1 input data -- if exists (select name from sysobjects where name = 'NEWORDERS') drop table NEWORDERS create table NEWORDERS (O_ORDERKEY bigint not null, O_CUSTKEY int not null, O_ORDERSTATUS char(1) not null, O_TOTALPRICE float not null, O_ORDERDATE datetime not null, O_ORDERPRIORITY char(15) not null, O_CLERK char(15) not null, O_SHIPPRIORITY int not null, O_COMMENT varchar(79) not null) on DATA_FG if exists (select name from sysobjects where name = 'NEWLINEITEM') drop table NEWLINEITEM create table NEWLINEITEM (L_ORDERKEY bigint not null, L_PARTKEY int not null, L_SUPPKEY int not null, L_LINENUMBER int not null, L_QUANTITY float not null, L_EXTENDEDPRICE float not null, L_DISCOUNT float not null, L_TAX float not null, L_RETURNFLAG char(1) not null, L_LINESTATUS char(1) not null, L_SHIPDATE datetime not null, L_COMMITDATE datetime not null, L_RECEIPTDATE datetime not null, L_SHIPINSTRUCT char(25) not null, L_SHIPMODE char(10 ) not null, L_COMMENT varchar(44) not null) on DATA_FG F.5. RF2_index.sql F.3. RF1_index.sql create clustered index NEWORDERS_CLUIDX on NEWORDERS (O_ORDERDATE) on DATA_FG create clustered index NEWLINEITEM_CLUIDX on NEWLINEITEM (L_ORDERKEY) on DATA_FG create clustered index MOD_OLDORDERS_CLUIDX on MOD_OLDORDERS (O_ORDERDATE) create index MOD_OLDORDERS_IDX on MOD_OLDORDERS (O_ORDERKEY) F.6. RF2_init.sql -- -- Create the tables to hold input data for RF2 -- declare @segment integer HP TPC-H FULL DISCLOSURE REPORT 89 July, 2010 © 2010 Hewlett-Packard Company. All rights reserved.
declare @sql nchar(1000) if exists (select name from sysobjects where name = 'MOD_OLDORDERS') drop table MOD_OLDORDERS create table MOD_OLDORDERS (O_ORDERDATE datetime, O_ORDERKEY bigint) on DATA_FG set @segment = 1 while @segment