1/*
2 * Legal Notice
3 *
4 * This document and associated source code (the "Work") is a part of a
5 * benchmark specification maintained by the TPC.
6 *
7 * The TPC reserves all right, title, and interest to the Work as provided
8 * under U.S. and international laws, including without limitation all patent
9 * and trademark rights therein.
10 *
11 * No Warranty
12 *
13 * 1.1 TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THE INFORMATION
14 * CONTAINED HEREIN IS PROVIDED "AS IS" AND WITH ALL FAULTS, AND THE
15 * AUTHORS AND DEVELOPERS OF THE WORK HEREBY DISCLAIM ALL OTHER
16 * WARRANTIES AND CONDITIONS, EITHER EXPRESS, IMPLIED OR STATUTORY,
17 * INCLUDING, BUT NOT LIMITED TO, ANY (IF ANY) IMPLIED WARRANTIES,
18 * DUTIES OR CONDITIONS OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR
19 * PURPOSE, OF ACCURACY OR COMPLETENESS OF RESPONSES, OF RESULTS, OF
20 * WORKMANLIKE EFFORT, OF LACK OF VIRUSES, AND OF LACK OF NEGLIGENCE.
21 * ALSO, THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT,
22 * QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR NON-INFRINGEMENT
23 * WITH REGARD TO THE WORK.
24 * 1.2 IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THE WORK BE LIABLE TO
25 * ANY OTHER PARTY FOR ANY DAMAGES, INCLUDING BUT NOT LIMITED TO THE
26 * COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST PROFITS, LOSS
27 * OF USE, LOSS OF DATA, OR ANY INCIDENTAL, CONSEQUENTIAL, DIRECT,
28 * INDIRECT, OR SPECIAL DAMAGES WHETHER UNDER CONTRACT, TORT, WARRANTY,
29 * OR OTHERWISE, ARISING IN ANY WAY OUT OF THIS OR ANY OTHER AGREEMENT
30 * RELATING TO THE WORK, WHETHER OR NOT SUCH AUTHOR OR DEVELOPER HAD
31 * ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.
32 *
33 * Contributors:
34 * Gradient Systems
35 */
36#ifndef CONSTANTS_H
37#define CONSTANTS_H
38/***
39*** Multi-table/Global Defines
40***/
41#define DATA_START_DATE "1998-01-01" /* earliest date in the data set */
42#define DATA_END_DATE "2003-12-31" /* latest date in the data set */
43#define LINES_PER_ORDER 16 /* max number of lineitems per order for all channels */
44
45/***
46*** C_xxx Cutomer Defines
47***/
48#define C_PREFERRED_PCT 50
49
50/***
51 *** CC_xxx Call Center Defines
52 ***/
53#define CC_EMPLOYEE_MAX 7 /* rises ~ scale ^ 2 */
54
55/***
56 *** CP_xxx Catalog Page Defines
57 ***/
58#define CP_CATALOGS_PER_YEAR 18
59#define CP_SK(c, s, p) (c * s + p)
60
61/***
62*** CR_xxx Catalog Returns Defines
63***/
64#define CR_RETURN_PCT 10 /* percentage of catalog sales that are returned */
65
66/***
67*** CS_xxx Customer Sales Defines
68***/
69#define CS_QUANTITY_MAX "100"
70#define CS_MARKUP_MAX "2.00"
71#define CS_DISCOUNT_MAX "1.00"
72#define CS_WHOLESALE_MAX "100.00"
73#define CS_COUPON_MAX "0.50"
74#define CS_MIN_SHIP_DELAY 2 /* minimum days from order to ship */
75#define CS_MAX_SHIP_DELAY 90 /* maximum days from order to ship */
76#define CS_ITEMS_PER_ORDER 10 /* number of items in each order */
77#define CS_GIFT_PCT 10 /* ship-to != bill-to */
78
79/*
80 * DATE SETTINGS
81 *
82 * The benchmarks sense of "today". Should this be a sliding scale/parameter?
83 */
84#define CURRENT_YEAR 2003
85#define CURRENT_MONTH 1
86#define CURRENT_DAY 8
87#define CURRENT_QUARTER 1
88#define CURRENT_WEEK 2
89#define DATE_MINIMUM "1998-01-01"
90#define DATE_MAXIMUM "2002-12-31"
91#define YEAR_MINIMUM 1998
92#define YEAR_MAXIMUM 2002
93#define WAREHOUSE_LOAD_DATE "2001-07-18"
94#define UPDATE_INTERVAL 30 /* refresh interval in days */
95#define TODAYS_DATE "2003-01-08"
96
97/***
98 *** INV_xxx Inventory Defines
99 ***/
100#define INV_QUANTITY_MIN 0
101#define INV_QUANTITY_MAX 1000
102
103/***
104 *** ITEM_xxx Item Defines
105 ***/
106#define ITEM_DESC_LEN 5
107#define ITEM_NAME_LEN 10
108#define ITEM_MANFACTURER_COUNT 1000 /* number of brands handled by a particular manufacturer */
109
110/***
111 *** PROMO_xxx Promotions Defines
112 ***/
113#define PROMO_NAME_LEN 5
114#define PROMO_START_MIN -720
115#define PROMO_START_MAX 100
116#define PROMO_START_MEAN 0
117#define PROMO_LEN_MIN 1
118#define PROMO_LEN_MAX 60
119#define PROMO_LEN_MEAN 0
120#define PROMO_DETAIL_LEN_MIN 20
121#define PROMO_DETAIL_LEN_MAX 60
122
123/***
124*** SR_xxx Store Returns Defines
125***/
126#define SR_RETURN_PCT 10 /* percentage of store sales that are returned */
127
128/***
129*** SS_xxx Store Sales Defines
130***/
131#define SS_MIN_SHIP_DELAY 2 /* minimum days from order to ship */
132#define SS_MAX_SHIP_DELAY 90 /* maximum days from order to ship */
133#define SS_QUANTITY_MAX "100"
134#define SS_MARKUP_MAX "1.00"
135#define SS_DISCOUNT_MAX "1.00"
136#define SS_WHOLESALE_MAX "100.00"
137#define SS_COUPON_MAX "0.50"
138
139/***
140*** WP_xxx Web Page Defines
141***/
142#define WP_AUTOGEN_PCT 30
143#define WP_LINK_MIN 2
144#define WP_LINK_MAX 25
145#define WP_IMAGE_MIN 1
146#define WP_IMAGE_MAX 7
147#define WP_AD_MIN 0
148#define WP_AD_MAX 4
149#define WP_MAX_REC_DURATION \
150 1000 /* maximum time from start to end of record \
151 */
152#define WP_IDLE_TIME_MAX 100 /* maximum time since last page access */
153
154/***
155*** W_xxx Warehouse Defines
156***/
157#define W_DESC_MIN 5
158#define W_SQFT_MIN 50000
159#define W_SQFT_MAX 1000000
160#define W_NAME_MIN 10
161
162/***
163*** WR_xxx Web Returns Defines
164***/
165#define WR_RETURN_PCT 10 /* percentage of web sales that are returned */
166#define WR_SHIP_LAG_MIN 2 /* lag time between receiving and returning */
167#define WR_SHIP_LAG_MAX 12
168
169/***
170*** WEB_xxx Web Site Defines
171***/
172#define WEB_START_DATE \
173 DATE_MINIMUM /* range of open/close dates; actual dates can exceed these \
174 values */
175#define WEB_END_DATE DATE_MAXIMUM /* due to staggered start of each site */
176#define WEB_DATE_STAGGER 17 /* time between site creation on leading/trailing edge */
177#define WEB_PAGES_PER_SITE 123 /* number of pages on a web site */
178/* some of the web sites are completely replaced in the date range. */
179#define WEB_MORTALITY 50 /* percentage of sites that "die" between start and end */
180#define WEB_IS_REPLACED(j) ((j % (100 / WEB_MORTALITY)) == 0) /* does this site get replaced? */
181#define WEB_IS_REPLACEMENT(j) ((j / (100 / WEB_MORTALITY)) % 2) /* is this the replacement? */
182
183/***
184 *** SOURCE SCHEMA CONSTANTS
185 ***/
186#define DAYS_PER_UPDATE 3
187
188/***
189*** RS_xxx: Row and column sizes
190***/
191/* sizes used in various tables */
192#define RS_BKEY 16
193/* table-specific sizes */
194
195#define RS_BRND_NAME 50
196#define RS_C_SALUTATION 5
197#define RS_C_FIRST_NAME 20
198#define RS_C_LAST_NAME 30
199#define RS_C_BIRTH_COUNTRY 20
200#define RS_C_LOGIN 13
201#define RS_C_PASSWORD 13
202#define RS_C_EMAIL 50
203#define RS_C_PRIMARY_MACHINE_ID 15
204#define RS_C_SECONDARY_MACHINE_ID 15
205#define RS_CA_SUITE_NUMBER 10
206#define RS_CA_STREET_NAME 60
207#define RS_CA_STREET_TYPE 15
208#define RS_CA_CITY 60
209#define RS_CA_COUNTY 30
210#define RS_CA_STATE 2
211#define RS_CA_COUNTRY 20
212#define RS_CA_ZIP 10
213#define RS_CA_LOCATION_TYPE 20
214#define RS_CATG_DESC 20
215#define RS_CC_NAME 50
216#define RS_CC_CLASS 50
217#define RS_CC_HOURS 20
218#define RS_CC_MANAGER 40
219#define RS_CC_MARKET_MANAGER 40
220#define RS_CC_MARKET_CLASS 50
221#define RS_CC_MARKET_DESC 100
222#define RS_CC_DIVISION_NAME 50
223#define RS_CC_COMPANY_NAME 60
224#define RS_CC_SUITE_NUM 10
225#define RS_CC_STREET_NAME 60
226#define RS_CC_STREET_TYPE 15
227#define RS_CC_CITY 60
228#define RS_CC_COUNTY 30
229#define RS_CC_STATE 2
230#define RS_CC_COUNTRY 20
231#define RS_CC_ZIP 10
232#define RS_CD_GENDER 1
233#define RS_CD_MARITAL_STATUS 1
234#define RS_CD_EDUCATION_STATUS 20
235#define RS_CD_CREDIT_RATING 10
236#define RS_CP_DEPARTMENT 20
237#define RS_CLAS_DESC 100
238#define RS_CMPY_NAME 50
239#define RS_CP_DESCRIPTION 100
240#define RS_CP_TYPE 100
241#define RS_CTGR_NAME 25
242#define RS_CTGR_DESC 100
243#define RS_CUST_CREDIT 100
244#define RS_D_DAY_NAME 4
245#define RS_D_QUARTER_NAME 4
246#define RS_DVSN_NAME 50
247#define RS_HD_BUY_POTENTIAL 7
248#define RS_I_ITEM_DESC 200
249#define RS_I_BRAND 50
250#define RS_I_SUBCLASS 50
251#define RS_I_CLASS 50
252#define RS_I_SUBCATEGORY 50
253#define RS_I_CATEGORY 50
254#define RS_I_MANUFACT 50
255#define RS_I_SIZE 20
256#define RS_I_FORMULATION 20
257#define RS_I_FLAVOR 20
258#define RS_I_UNITS 10
259#define RS_I_CONTAINER 10
260#define RS_I_PRODUCT_NAME 50
261#define RS_MANF_NAME 50
262#define RS_MNGR_NAME 50
263#define RS_P_PROMO_NAME 50
264#define RS_P_CHANNEL_DETAILS 100
265#define RS_P_PURPOSE 15
266#define RS_PB_DESCRIPTION 100
267#define RS_PLIN_COMMENT 100
268#define RS_PROD_NAME 100
269#define RS_PROD_TYPE 100
270#define RS_R_REASON_DESCRIPTION 100
271#define RS_STORE_NAME 50
272#define RS_STORE_HOURS 20
273#define RS_S_STORE_MANAGER 40
274#define RS_S_GEOGRAPHY_CLASS 100
275#define RS_S_MARKET_DESC 100
276#define RS_S_MARKET_MANAGER 40
277#define RS_S_DIVISION_NAME 50
278#define RS_S_COMPANY_NAME 50
279#define RS_S_SUITE_NUM 10
280#define RS_S_STREET_NAME 60
281#define RS_S_STREET_TYPE 15
282#define RS_S_CITY 60
283#define RS_S_STATE 2
284#define RS_S_COUNTY 30
285#define RS_S_COUNTRY 30
286#define RS_S_ZIP 10
287#define RS_SM_TYPE 30
288#define RS_SM_CODE 10
289#define RS_SM_CONTRACT 20
290#define RS_SM_CARRIER 20
291#define RS_SBCT_NAME 100
292#define RS_SBCT_DESC 100
293#define RS_SUBC_NAME 100
294#define RS_SUBC_DESC 100
295#define RS_T_AM_PM 2
296#define RS_T_SHIFT 20
297#define RS_T_SUB_SHIFT 20
298#define RS_T_MEAL_TIME 20
299#define RS_W_WAREHOUSE_NAME 20
300#define RS_W_STREET_NAME 60
301#define RS_W_SUITE_NUM 10
302#define RS_W_STREET_TYPE 15
303#define RS_W_CITY 60
304#define RS_W_COUNTY 30
305#define RS_W_STATE 2
306#define RS_W_COUNTRY 20
307#define RS_W_ZIP 10
308#define RS_WEB_MANAGER 50
309#define RS_WEB_NAME 50
310#define RS_WEB_CLASS 50
311#define RS_WEB_MARKET_CLASS 50
312#define RS_WEB_MARKET_DESC 100
313#define RS_WEB_MARKET_MANAGER 40
314#define RS_WEB_COMPANY_NAME 100
315#define RS_WEB_SUITE_NUMBER 10
316#define RS_WEB_STREET_NAME 60
317#define RS_WEB_STREET_TYPE 15
318#define RS_WEB_CITY 60
319#define RS_WEB_COUNTY 30
320#define RS_WEB_STATE 2
321#define RS_WEB_COUNTRY 20
322#define RS_WEB_ZIP 10
323#define RS_WP_URL 100
324#define RS_WEB_TYPE 50
325#define RS_WRHS_DESC 100
326#define RS_WORD_COMMENT 100
327#define RS_ZIPG_ZIP 5
328#endif /* CONSTANTS_H */
329