├── .gitignore ├── BUGS ├── HISTORY ├── PORTING.NOTES ├── README ├── answers ├── q1.out ├── q10.out ├── q11.out ├── q12.out ├── q13.out ├── q14.out ├── q15.out ├── q16.out ├── q17.out ├── q18.out ├── q19.out ├── q2.out ├── q20.out ├── q21.out ├── q22.out ├── q3.out ├── q4.out ├── q5.out ├── q6.out ├── q7.out ├── q8.out └── q9.out ├── bcd2.c ├── bcd2.h ├── bm_utils.c ├── build.c ├── check_answers ├── README ├── cmpall.sh ├── cmpq.pl ├── colprecision.txt └── pairs.sh ├── column_split.sh ├── config.h ├── dbgen.dsp ├── dists.dss ├── driver.c ├── dss.ddl ├── dss.h ├── dss.ri ├── dsstypes.h ├── load_stub.c ├── makefile ├── makefile.suite ├── permute.c ├── permute.h ├── print.c ├── qgen.c ├── qgen.vcproj ├── queries ├── 1.sql ├── 10.sql ├── 11.sql ├── 12.sql ├── 13.sql ├── 14.sql ├── 15.sql ├── 16.sql ├── 17.sql ├── 18.sql ├── 19.sql ├── 2.sql ├── 20.sql ├── 21.sql ├── 22.sql ├── 3.sql ├── 4.sql ├── 5.sql ├── 6.sql ├── 7.sql ├── 8.sql └── 9.sql ├── reference ├── README.txt ├── cmd_base_sf1 ├── cmd_base_sf100 ├── cmd_base_sf1000 ├── cmd_base_sf10000 ├── cmd_base_sf100000 ├── cmd_base_sf300 ├── cmd_base_sf3000 ├── cmd_base_sf30000 ├── cmd_base_small ├── cmd_qgen_sf1 ├── cmd_qgen_sf100 ├── cmd_qgen_sf1000 ├── cmd_qgen_sf10000 ├── cmd_qgen_sf100000 ├── cmd_qgen_sf300 ├── cmd_qgen_sf3000 ├── cmd_qgen_sf30000 ├── cmd_update_sf1 ├── cmd_update_sf100 ├── cmd_update_sf1000 ├── cmd_update_sf10000 ├── cmd_update_sf100000 ├── cmd_update_sf300 ├── cmd_update_sf3000 ├── cmd_update_sf30000 ├── do_base.sh ├── do_qgen.sh ├── do_update.sh └── trim_updates.sh ├── release.h ├── rnd.c ├── rnd.h ├── rng64.c ├── rng64.h ├── shared.h ├── speed_seed.c ├── tests ├── check55.sh ├── check_dirs.sh ├── dop.sh ├── gen_tasks.sh ├── last_row.sh ├── load_balance.sh └── new55.sh ├── text.c ├── tpcd.h ├── tpch.dsw ├── tpch.sln ├── tpch.vcproj ├── variants ├── 12a.sql ├── 13a.sql ├── 14a.sql ├── 15a.sql └── 8a.sql └── varsub.c /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | dbgen 3 | qgen 4 | *.tbl 5 | -------------------------------------------------------------------------------- /answers/q1.out: -------------------------------------------------------------------------------- 1 | l|l|sum_qty |sum_base_price |sum_disc_price |sum_charge |avg_qty |avg_price |avg_disc |count_order 2 | A|F|37734107.00|56586554400.73|53758257134.87|55909065222.83|25.52|38273.13|0.05| 1478493 3 | N|F|991417.00|1487504710.38|1413082168.05|1469649223.19|25.52|38284.47|0.05| 38854 4 | N|O|74476040.00|111701729697.74|106118230307.61|110367043872.50|25.50|38249.12|0.05| 2920374 5 | R|F|37719753.00|56568041380.90|53741292684.60|55889619119.83|25.51|38250.85|0.05| 1478870 6 | -------------------------------------------------------------------------------- /answers/q10.out: -------------------------------------------------------------------------------- 1 | c_custkey |c_name |revenue |c_acctbal |n_name |c_address |c_phone |c_comment 2 | 57040|Customer#000057040 |734235.25|632.87|JAPAN |Eioyzjf4pp |22-895-641-3466|sits. slyly regular requests sleep alongside of the regular inst 3 | 143347|Customer#000143347 |721002.69|2557.47|EGYPT |1aReFYv,Kw4 |14-742-935-3718|ggle carefully enticing requests. final deposits use bold, bold pinto beans. ironic, idle re 4 | 60838|Customer#000060838 |679127.31|2454.77|BRAZIL |64EaJ5vMAHWJlBOxJklpNc2RJiWE |12-913-494-9813| need to boost against the slyly regular account 5 | 101998|Customer#000101998 |637029.57|3790.89|UNITED KINGDOM |01c9CILnNtfOQYmZj |33-593-865-6378|ress foxes wake slyly after the bold excuses. ironic platelets are furiously carefully bold theodolites 6 | 125341|Customer#000125341 |633508.09|4983.51|GERMANY |S29ODD6bceU8QSuuEJznkNaK |17-582-695-5962|arefully even depths. blithely even excuses sleep furiously. foxes use except the dependencies. ca 7 | 25501|Customer#000025501 |620269.78|7725.04|ETHIOPIA | W556MXuoiaYCCZamJI,Rn0B4ACUGdkQ8DZ |15-874-808-6793|he pending instructions wake carefully at the pinto beans. regular, final instructions along the slyly fina 8 | 115831|Customer#000115831 |596423.87|5098.10|FRANCE |rFeBbEEyk dl ne7zV5fDrmiq1oK09wV7pxqCgIc|16-715-386-3788|l somas sleep. furiously final deposits wake blithely regular pinto b 9 | 84223|Customer#000084223 |594998.02|528.65|UNITED KINGDOM |nAVZCs6BaWap rrM27N 2qBnzc5WBauxbA |33-442-824-8191| slyly final deposits haggle regular, pending dependencies. pending escapades wake 10 | 54289|Customer#000054289 |585603.39|5583.02|IRAN |vXCxoCsU0Bad5JQI ,oobkZ |20-834-292-4707|ely special foxes are quickly finally ironic p 11 | 39922|Customer#000039922 |584878.11|7321.11|GERMANY |Zgy4s50l2GKN4pLDPBU8m342gIw6R |17-147-757-8036|y final requests. furiously final foxes cajole blithely special platelets. f 12 | 6226|Customer#000006226 |576783.76|2230.09|UNITED KINGDOM |8gPu8,NPGkfyQQ0hcIYUGPIBWc,ybP5g, |33-657-701-3391|ending platelets along the express deposits cajole carefully final 13 | 922|Customer#000000922 |576767.53|3869.25|GERMANY |Az9RFaut7NkPnc5zSD2PwHgVwr4jRzq |17-945-916-9648|luffily fluffy deposits. packages c 14 | 147946|Customer#000147946 |576455.13|2030.13|ALGERIA |iANyZHjqhyy7Ajah0pTrYyhJ |10-886-956-3143|ithely ironic deposits haggle blithely ironic requests. quickly regu 15 | 115640|Customer#000115640 |569341.19|6436.10|ARGENTINA |Vtgfia9qI 7EpHgecU1X |11-411-543-4901|ost slyly along the patterns; pinto be 16 | 73606|Customer#000073606 |568656.86|1785.67|JAPAN |xuR0Tro5yChDfOCrjkd2ol |22-437-653-6966|he furiously regular ideas. slowly 17 | 110246|Customer#000110246 |566842.98|7763.35|VIETNAM |7KzflgX MDOq7sOkI |31-943-426-9837|egular deposits serve blithely above the fl 18 | 142549|Customer#000142549 |563537.24|5085.99|INDONESIA |ChqEoK43OysjdHbtKCp6dKqjNyvvi9 |19-955-562-2398|sleep pending courts. ironic deposits against the carefully unusual platelets cajole carefully express accounts. 19 | 146149|Customer#000146149 |557254.99|1791.55|ROMANIA |s87fvzFQpU |29-744-164-6487| of the slyly silent accounts. quickly final accounts across the 20 | 52528|Customer#000052528 |556397.35|551.79|ARGENTINA |NFztyTOR10UOJ |11-208-192-3205| deposits hinder. blithely pending asymptotes breach slyly regular re 21 | 23431|Customer#000023431 |554269.54|3381.86|ROMANIA |HgiV0phqhaIa9aydNoIlb |29-915-458-2654|nusual, even instructions: furiously stealthy n 22 | -------------------------------------------------------------------------------- /answers/q12.out: -------------------------------------------------------------------------------- 1 | l_shipmode|high_line_count |low_line_count 2 | MAIL | 6202| 9324 3 | SHIP | 6200| 9262 4 | -------------------------------------------------------------------------------- /answers/q13.out: -------------------------------------------------------------------------------- 1 | c_count |custdist 2 | 0| 50005 3 | 9| 6641 4 | 10| 6532 5 | 11| 6014 6 | 8| 5937 7 | 12| 5639 8 | 13| 5024 9 | 19| 4793 10 | 7| 4687 11 | 17| 4587 12 | 18| 4529 13 | 20| 4516 14 | 15| 4505 15 | 14| 4446 16 | 16| 4273 17 | 21| 4190 18 | 22| 3623 19 | 6| 3265 20 | 23| 3225 21 | 24| 2742 22 | 25| 2086 23 | 5| 1948 24 | 26| 1612 25 | 27| 1179 26 | 4| 1007 27 | 28| 893 28 | 29| 593 29 | 3| 415 30 | 30| 376 31 | 31| 226 32 | 32| 148 33 | 2| 134 34 | 33| 75 35 | 34| 50 36 | 35| 37 37 | 1| 17 38 | 36| 14 39 | 38| 5 40 | 37| 5 41 | 40| 4 42 | 41| 2 43 | 39| 1 44 | -------------------------------------------------------------------------------- /answers/q14.out: -------------------------------------------------------------------------------- 1 | promo_revenue 2 | 16.38 3 | -------------------------------------------------------------------------------- /answers/q15.out: -------------------------------------------------------------------------------- 1 | s_suppkey |s_name |s_address |s_phone |total_revenue 2 | 8449|Supplier#000008449 |Wp34zim9qYFbVctdW |20-469-856-8873|1772627.21 3 | -------------------------------------------------------------------------------- /answers/q17.out: -------------------------------------------------------------------------------- 1 | avg_yearly 2 | 348406.02 3 | -------------------------------------------------------------------------------- /answers/q18.out: -------------------------------------------------------------------------------- 1 | c_name |c_custkey |o_orderkey |o_orderdat|o_totalprice |col6 2 | Customer#000128120 | 128120| 4722021|1994-04-07|544089.09|323.00 3 | Customer#000144617 | 144617| 3043270|1997-02-12|530604.44|317.00 4 | Customer#000013940 | 13940| 2232932|1997-04-13|522720.61|304.00 5 | Customer#000066790 | 66790| 2199712|1996-09-30|515531.82|327.00 6 | Customer#000046435 | 46435| 4745607|1997-07-03|508047.99|309.00 7 | Customer#000015272 | 15272| 3883783|1993-07-28|500241.33|302.00 8 | Customer#000146608 | 146608| 3342468|1994-06-12|499794.58|303.00 9 | Customer#000096103 | 96103| 5984582|1992-03-16|494398.79|312.00 10 | Customer#000024341 | 24341| 1474818|1992-11-15|491348.26|302.00 11 | Customer#000137446 | 137446| 5489475|1997-05-23|487763.25|311.00 12 | Customer#000107590 | 107590| 4267751|1994-11-04|485141.38|301.00 13 | Customer#000050008 | 50008| 2366755|1996-12-09|483891.26|302.00 14 | Customer#000015619 | 15619| 3767271|1996-08-07|480083.96|318.00 15 | Customer#000077260 | 77260| 1436544|1992-09-12|479499.43|307.00 16 | Customer#000109379 | 109379| 5746311|1996-10-10|478064.11|302.00 17 | Customer#000054602 | 54602| 5832321|1997-02-09|471220.08|307.00 18 | Customer#000105995 | 105995| 2096705|1994-07-03|469692.58|307.00 19 | Customer#000148885 | 148885| 2942469|1992-05-31|469630.44|313.00 20 | Customer#000114586 | 114586| 551136|1993-05-19|469605.59|308.00 21 | Customer#000105260 | 105260| 5296167|1996-09-06|469360.57|303.00 22 | Customer#000147197 | 147197| 1263015|1997-02-02|467149.67|320.00 23 | Customer#000064483 | 64483| 2745894|1996-07-04|466991.35|304.00 24 | Customer#000136573 | 136573| 2761378|1996-05-31|461282.73|301.00 25 | Customer#000016384 | 16384| 502886|1994-04-12|458378.92|312.00 26 | Customer#000117919 | 117919| 2869152|1996-06-20|456815.92|317.00 27 | Customer#000012251 | 12251| 735366|1993-11-24|455107.26|309.00 28 | Customer#000120098 | 120098| 1971680|1995-06-14|453451.23|308.00 29 | Customer#000066098 | 66098| 5007490|1992-08-07|453436.16|304.00 30 | Customer#000117076 | 117076| 4290656|1997-02-05|449545.85|301.00 31 | Customer#000129379 | 129379| 4720454|1997-06-07|448665.79|303.00 32 | Customer#000126865 | 126865| 4702759|1994-11-07|447606.65|320.00 33 | Customer#000088876 | 88876| 983201|1993-12-30|446717.46|304.00 34 | Customer#000036619 | 36619| 4806726|1995-01-17|446704.09|328.00 35 | Customer#000141823 | 141823| 2806245|1996-12-29|446269.12|310.00 36 | Customer#000053029 | 53029| 2662214|1993-08-13|446144.49|302.00 37 | Customer#000018188 | 18188| 3037414|1995-01-25|443807.22|308.00 38 | Customer#000066533 | 66533| 29158|1995-10-21|443576.50|305.00 39 | Customer#000037729 | 37729| 4134341|1995-06-29|441082.97|309.00 40 | Customer#000003566 | 3566| 2329187|1998-01-04|439803.36|304.00 41 | Customer#000045538 | 45538| 4527553|1994-05-22|436275.31|305.00 42 | Customer#000081581 | 81581| 4739650|1995-11-04|435405.90|305.00 43 | Customer#000119989 | 119989| 1544643|1997-09-20|434568.25|320.00 44 | Customer#000003680 | 3680| 3861123|1998-07-03|433525.97|301.00 45 | Customer#000113131 | 113131| 967334|1995-12-15|432957.75|301.00 46 | Customer#000141098 | 141098| 565574|1995-09-24|430986.69|301.00 47 | Customer#000093392 | 93392| 5200102|1997-01-22|425487.51|304.00 48 | Customer#000015631 | 15631| 1845057|1994-05-12|419879.59|302.00 49 | Customer#000112987 | 112987| 4439686|1996-09-17|418161.49|305.00 50 | Customer#000012599 | 12599| 4259524|1998-02-12|415200.61|304.00 51 | Customer#000105410 | 105410| 4478371|1996-03-05|412754.51|302.00 52 | Customer#000149842 | 149842| 5156581|1994-05-30|411329.35|302.00 53 | Customer#000010129 | 10129| 5849444|1994-03-21|409129.85|309.00 54 | Customer#000069904 | 69904| 1742403|1996-10-19|408513.00|305.00 55 | Customer#000017746 | 17746| 6882|1997-04-09|408446.93|303.00 56 | Customer#000013072 | 13072| 1481925|1998-03-15|399195.47|301.00 57 | Customer#000082441 | 82441| 857959|1994-02-07|382579.74|305.00 58 | Customer#000088703 | 88703| 2995076|1994-01-30|363812.12|302.00 59 | -------------------------------------------------------------------------------- /answers/q19.out: -------------------------------------------------------------------------------- 1 | revenue 2 | 3083843.06 3 | -------------------------------------------------------------------------------- /answers/q21.out: -------------------------------------------------------------------------------- 1 | s_name |numwait 2 | Supplier#000002829 | 20 3 | Supplier#000005808 | 18 4 | Supplier#000000262 | 17 5 | Supplier#000000496 | 17 6 | Supplier#000002160 | 17 7 | Supplier#000002301 | 17 8 | Supplier#000002540 | 17 9 | Supplier#000003063 | 17 10 | Supplier#000005178 | 17 11 | Supplier#000008331 | 17 12 | Supplier#000002005 | 16 13 | Supplier#000002095 | 16 14 | Supplier#000005799 | 16 15 | Supplier#000005842 | 16 16 | Supplier#000006450 | 16 17 | Supplier#000006939 | 16 18 | Supplier#000009200 | 16 19 | Supplier#000009727 | 16 20 | Supplier#000000486 | 15 21 | Supplier#000000565 | 15 22 | Supplier#000001046 | 15 23 | Supplier#000001047 | 15 24 | Supplier#000001161 | 15 25 | Supplier#000001336 | 15 26 | Supplier#000001435 | 15 27 | Supplier#000003075 | 15 28 | Supplier#000003335 | 15 29 | Supplier#000005649 | 15 30 | Supplier#000006027 | 15 31 | Supplier#000006795 | 15 32 | Supplier#000006800 | 15 33 | Supplier#000006824 | 15 34 | Supplier#000007131 | 15 35 | Supplier#000007382 | 15 36 | Supplier#000008913 | 15 37 | Supplier#000009787 | 15 38 | Supplier#000000633 | 14 39 | Supplier#000001960 | 14 40 | Supplier#000002323 | 14 41 | Supplier#000002490 | 14 42 | Supplier#000002993 | 14 43 | Supplier#000003101 | 14 44 | Supplier#000004489 | 14 45 | Supplier#000005435 | 14 46 | Supplier#000005583 | 14 47 | Supplier#000005774 | 14 48 | Supplier#000007579 | 14 49 | Supplier#000008180 | 14 50 | Supplier#000008695 | 14 51 | Supplier#000009224 | 14 52 | Supplier#000000357 | 13 53 | Supplier#000000436 | 13 54 | Supplier#000000610 | 13 55 | Supplier#000000788 | 13 56 | Supplier#000000889 | 13 57 | Supplier#000001062 | 13 58 | Supplier#000001498 | 13 59 | Supplier#000002056 | 13 60 | Supplier#000002312 | 13 61 | Supplier#000002344 | 13 62 | Supplier#000002596 | 13 63 | Supplier#000002615 | 13 64 | Supplier#000002978 | 13 65 | Supplier#000003048 | 13 66 | Supplier#000003234 | 13 67 | Supplier#000003727 | 13 68 | Supplier#000003806 | 13 69 | Supplier#000004472 | 13 70 | Supplier#000005236 | 13 71 | Supplier#000005906 | 13 72 | Supplier#000006241 | 13 73 | Supplier#000006326 | 13 74 | Supplier#000006384 | 13 75 | Supplier#000006394 | 13 76 | Supplier#000006624 | 13 77 | Supplier#000006629 | 13 78 | Supplier#000006682 | 13 79 | Supplier#000006737 | 13 80 | Supplier#000006825 | 13 81 | Supplier#000007021 | 13 82 | Supplier#000007417 | 13 83 | Supplier#000007497 | 13 84 | Supplier#000007602 | 13 85 | Supplier#000008134 | 13 86 | Supplier#000008234 | 13 87 | Supplier#000009435 | 13 88 | Supplier#000009436 | 13 89 | Supplier#000009564 | 13 90 | Supplier#000009896 | 13 91 | Supplier#000000379 | 12 92 | Supplier#000000673 | 12 93 | Supplier#000000762 | 12 94 | Supplier#000000811 | 12 95 | Supplier#000000821 | 12 96 | Supplier#000001337 | 12 97 | Supplier#000001916 | 12 98 | Supplier#000001925 | 12 99 | Supplier#000002039 | 12 100 | Supplier#000002357 | 12 101 | Supplier#000002483 | 12 102 | -------------------------------------------------------------------------------- /answers/q22.out: -------------------------------------------------------------------------------- 1 | cntrycode |numcust |totacctbal 2 | 13 | 888|6737713.99 3 | 17 | 861|6460573.72 4 | 18 | 964|7236687.40 5 | 23 | 892|6701457.95 6 | 29 | 948|7158866.63 7 | 30 | 909|6808436.13 8 | 31 | 922|6806670.18 9 | -------------------------------------------------------------------------------- /answers/q3.out: -------------------------------------------------------------------------------- 1 | l_orderkey |revenue |o_orderdat|o_shippriority 2 | 2456423|406181.01|1995-03-05| 0 3 | 3459808|405838.70|1995-03-04| 0 4 | 492164|390324.06|1995-02-19| 0 5 | 1188320|384537.94|1995-03-09| 0 6 | 2435712|378673.06|1995-02-26| 0 7 | 4878020|378376.80|1995-03-12| 0 8 | 5521732|375153.92|1995-03-13| 0 9 | 2628192|373133.31|1995-02-22| 0 10 | 993600|371407.46|1995-03-05| 0 11 | 2300070|367371.15|1995-03-13| 0 12 | -------------------------------------------------------------------------------- /answers/q4.out: -------------------------------------------------------------------------------- 1 | o_orderpriority|order_count 2 | 1-URGENT | 10594 3 | 2-HIGH | 10476 4 | 3-MEDIUM | 10410 5 | 4-NOT SPECIFIED| 10556 6 | 5-LOW | 10487 7 | -------------------------------------------------------------------------------- /answers/q5.out: -------------------------------------------------------------------------------- 1 | n_name |revenue 2 | INDONESIA |55502041.17 3 | VIETNAM |55295087.00 4 | CHINA |53724494.26 5 | INDIA |52035512.00 6 | JAPAN |45410175.70 7 | -------------------------------------------------------------------------------- /answers/q6.out: -------------------------------------------------------------------------------- 1 | revenue 2 | 123141078.23 3 | -------------------------------------------------------------------------------- /answers/q7.out: -------------------------------------------------------------------------------- 1 | supp_nation |cust_nation |l_year |revenue 2 | FRANCE |GERMANY | 1995|54639732.73 3 | FRANCE |GERMANY | 1996|54633083.31 4 | GERMANY |FRANCE | 1995|52531746.67 5 | GERMANY |FRANCE | 1996|52520549.02 6 | -------------------------------------------------------------------------------- /answers/q8.out: -------------------------------------------------------------------------------- 1 | o_year |mkt_share 2 | 1995|0.03 3 | 1996|0.04 4 | -------------------------------------------------------------------------------- /bcd2.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: bcd2.c,v 1.2 2005/01/03 20:08:58 jms Exp $ 3 | * 4 | * Revision History 5 | * =================== 6 | * $Log: bcd2.c,v $ 7 | * Revision 1.2 2005/01/03 20:08:58 jms 8 | * change line terminations 9 | * 10 | * Revision 1.1.1.1 2004/11/24 23:31:45 jms 11 | * re-establish external server 12 | * 13 | * Revision 1.1.1.1 2003/04/03 18:54:21 jms 14 | * recreation after CVS crash 15 | * 16 | * Revision 1.1.1.1 2003/04/03 18:54:21 jms 17 | * initial checkin 18 | * 19 | * 20 | */ 21 | /* 22 | * bcd.c: conversion routines for multi-byte arithmetic 23 | * 24 | * defined routines: 25 | * bin_bcd2(long binary, long *low_res, long *high_res) 26 | * bcd2_bin(long *dest, long bcd) 27 | * bcd2_add(long *bcd_low, long *bcd_high, long addend) 28 | * bcd2_sub(long *bcd_low, long *bcd_high, long subend) 29 | * bcd2_mul(long *bcd_low, long *bcd_high, long multiplier) 30 | * bcd2_div(long *bcd_low, long *bcd_high, long divisor) 31 | * long bcd2_mod(long *bcd_low, long *bcd_high, long modulo) 32 | * long bcd2_cmp(long *bcd_low, long *bcd_high, long compare) 33 | */ 34 | #include 35 | #include "bcd2.h" /* for function prototypes */ 36 | 37 | #define DIGITS_PER_LONG 7 38 | #define WORD_DIVISOR 10000000 39 | #define GET_DIGIT(num, low, high) \ 40 | ((num) >= DIGITS_PER_LONG)? \ 41 | (high & (0xF << (4 * ((num) - DIGITS_PER_LONG)))) \ 42 | >> (((num) - DIGITS_PER_LONG) * 4): \ 43 | (low & (0xF << (4 * (num)))) >> ((num) * 4) 44 | #define SET_DIGIT(value, num, low, high) \ 45 | if ((num) >= DIGITS_PER_LONG) \ 46 | { \ 47 | *high &= \ 48 | (0xFFFFFFF ^ (0xF << (4 * ((num) - DIGITS_PER_LONG)))); \ 49 | *high |= (value << (4 * ((num) - DIGITS_PER_LONG))); \ 50 | } \ 51 | else \ 52 | { \ 53 | *low = (*low & (0xFFFFFFF ^ (0xF << (4 * (num))))); \ 54 | *low |= (value << (4 * (num))); \ 55 | } 56 | int 57 | bin_bcd2(long binary, long *low_res, long *high_res) 58 | { 59 | char number[15], 60 | *current; 61 | int count; 62 | long *dest; 63 | 64 | *low_res = *high_res = 0; 65 | sprintf(number, "%014ld", binary); 66 | for (current = number, count=13; *current; current++, count--) 67 | { 68 | dest = (count < DIGITS_PER_LONG)?low_res:high_res; 69 | *dest = *dest << 4; 70 | *dest |= *current - '0'; 71 | } 72 | return(0); 73 | } 74 | 75 | int 76 | bcd2_bin(long *dest, long bcd) 77 | { 78 | int count; 79 | long mask; 80 | 81 | count = DIGITS_PER_LONG - 1; 82 | mask = 0xF000000; 83 | *dest = 0; 84 | while (mask) 85 | { 86 | *dest *= 10; 87 | *dest += (bcd & mask) >> (4 * count); 88 | mask = mask >> 4; 89 | count -= 1; 90 | } 91 | return(0); 92 | } 93 | 94 | int 95 | bcd2_add(long *bcd_low, long *bcd_high, long addend) 96 | { 97 | long tmp_lo, tmp_hi, carry, res; 98 | int digit; 99 | 100 | bin_bcd2(addend, &tmp_lo, &tmp_hi); 101 | carry = 0; 102 | for (digit=0; digit < 14; digit++) 103 | { 104 | res = GET_DIGIT(digit, *bcd_low, *bcd_high); 105 | res += GET_DIGIT(digit, tmp_lo, tmp_hi); 106 | res += carry; 107 | carry = res / 10; 108 | res %= 10; 109 | SET_DIGIT(res, digit, bcd_low, bcd_high); 110 | } 111 | return(carry); 112 | } 113 | 114 | int 115 | bcd2_sub(long *bcd_low, long *bcd_high, long subend) 116 | { 117 | long tmp_lo, tmp_hi, carry, res; 118 | int digit; 119 | 120 | bin_bcd2(subend, &tmp_lo, &tmp_hi); 121 | carry = 0; 122 | for (digit=0; digit < 14; digit++) 123 | { 124 | res = GET_DIGIT(digit, *bcd_low, *bcd_high); 125 | res -= GET_DIGIT(digit, tmp_lo, tmp_hi); 126 | res -= carry; 127 | if (res < 0) 128 | { 129 | res += 10; 130 | carry = 1; 131 | } 132 | SET_DIGIT(res, digit, bcd_low, bcd_high); 133 | } 134 | return(carry); 135 | } 136 | 137 | int 138 | bcd2_mul(long *bcd_low, long *bcd_high, long multiplier) 139 | { 140 | long tmp_lo, tmp_hi, carry, m_lo, m_hi, m1, m2; 141 | int udigit, ldigit, res; 142 | 143 | tmp_lo = *bcd_low; 144 | tmp_hi = *bcd_high; 145 | bin_bcd2(multiplier, &m_lo, &m_hi); 146 | *bcd_low = 0; 147 | *bcd_high = 0; 148 | carry = 0; 149 | for (ldigit=0; ldigit < 14; ldigit++) 150 | { 151 | m1 = GET_DIGIT(ldigit, m_lo, m_hi); 152 | carry = 0; 153 | for (udigit=0; udigit < 14; udigit++) 154 | { 155 | m2 = GET_DIGIT(udigit, tmp_lo, tmp_hi); 156 | res = m1 * m2; 157 | res += carry; 158 | if (udigit + ldigit < 14) 159 | { 160 | carry = GET_DIGIT(udigit + ldigit, *bcd_low, *bcd_high); 161 | res += carry; 162 | } 163 | carry = res / 10; 164 | res %= 10; 165 | if (udigit + ldigit < 14) 166 | SET_DIGIT(res, udigit + ldigit, bcd_low, bcd_high); 167 | } 168 | } 169 | return(carry); 170 | } 171 | 172 | int 173 | bcd2_div(long *bcd_low, long *bcd_high, long divisor) 174 | { 175 | long tmp_lo, tmp_hi, carry, d1, res, digit; 176 | 177 | 178 | carry = 0; 179 | tmp_lo = *bcd_low; 180 | tmp_hi = *bcd_high; 181 | *bcd_low = *bcd_high = 0; 182 | for (digit=13; digit >= 0; digit--) 183 | { 184 | d1 = GET_DIGIT(digit, tmp_lo, tmp_hi); 185 | d1 += 10 * carry; 186 | res = d1 / divisor; 187 | carry = d1 % divisor; 188 | SET_DIGIT(res, digit, bcd_low, bcd_high); 189 | } 190 | return(carry); 191 | } 192 | 193 | long 194 | bcd2_mod(long *bcd_low, long *bcd_high, long modulo) 195 | { 196 | long tmp_low, tmp_high; 197 | 198 | tmp_low = *bcd_low; 199 | tmp_high = *bcd_high; 200 | while (tmp_high || tmp_low > modulo) 201 | bcd2_sub(&tmp_low, &tmp_high, modulo); 202 | return(tmp_low); 203 | } 204 | 205 | long 206 | bcd2_cmp(long *low1, long *high1, long comp) 207 | { 208 | long temp = 0; 209 | 210 | bcd2_bin(&temp, *high1); 211 | if (temp > 214) 212 | return(1); 213 | bcd2_bin(&temp, *low1); 214 | return(temp - comp); 215 | } 216 | 217 | #ifdef TEST_BCD 218 | #include 219 | 220 | main() 221 | { 222 | long bin, low_bcd, high_bcd; 223 | int i; 224 | 225 | bin = MAXINT; 226 | printf("%ld\n", bin); 227 | bin_bcd2(bin, &low_bcd, &high_bcd); 228 | printf("%ld %ld\n", high_bcd, low_bcd); 229 | bin = 0; 230 | bcd2_bin(&bin, high_bcd); 231 | bcd2_bin(&bin, low_bcd); 232 | printf( "%ld\n", bin); 233 | for (i=9; i >= 0; i--) 234 | printf("%dth digit in %d is %d\n", 235 | i, bin, GET_DIGIT(i, low_bcd, high_bcd)); 236 | bcd2_add(&low_bcd, &high_bcd, MAXINT); 237 | bin = 0; 238 | bcd2_bin(&bin, high_bcd); 239 | high_bcd = bin; 240 | bin = 0; 241 | bcd2_bin(&bin, low_bcd); 242 | low_bcd = bin; 243 | printf( "%ld%07ld\n", high_bcd, low_bcd); 244 | bin_bcd2(14, &low_bcd, &high_bcd); 245 | bcd2_mul(&low_bcd, &high_bcd, 23L); 246 | bin = 0; 247 | bcd2_bin(&bin, high_bcd); 248 | bcd2_bin(&bin, low_bcd); 249 | printf( "%ld\n", bin); 250 | bcd2_div(&low_bcd, &high_bcd, 10L); 251 | bin = 0; 252 | bcd2_bin(&bin, high_bcd); 253 | bcd2_bin(&bin, low_bcd); 254 | printf( "%ld\n", bin); 255 | } 256 | #endif /* TEST */ 257 | -------------------------------------------------------------------------------- /bcd2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: bcd2.h,v 1.2 2005/01/03 20:08:58 jms Exp $ 3 | * 4 | * Revision History 5 | * =================== 6 | * $Log: bcd2.h,v $ 7 | * Revision 1.2 2005/01/03 20:08:58 jms 8 | * change line terminations 9 | * 10 | * Revision 1.1.1.1 2004/11/24 23:31:45 jms 11 | * re-establish external server 12 | * 13 | * Revision 1.1.1.1 2003/04/03 18:54:21 jms 14 | * recreation after CVS crash 15 | * 16 | * Revision 1.1.1.1 2003/04/03 18:54:21 jms 17 | * initial checkin 18 | * 19 | * 20 | */ 21 | int bin_bcd2(long binary, long *low_res, long *high_res); 22 | int bcd2_bin(long *dest, long bcd); 23 | int bcd2_add(long *bcd_low, long *bcd_high, long addend); 24 | int bcd2_sub(long *bcd_low, long *bcd_high, long subend); 25 | int bcd2_mul(long *bcd_low, long *bcd_high, long multiplier); 26 | int bcd2_div(long *bcd_low, long *bcd_high, long divisor); 27 | long bcd2_mod(long *bcd_low, long *bcd_high, long modulo); 28 | long bcd2_cmp(long *bcd_low, long *bcd_high, long compare); 29 | -------------------------------------------------------------------------------- /check_answers/README: -------------------------------------------------------------------------------- 1 | Answer sets to be compared should all be named q<1..22>.out . 2 | Each file should have 1 header (col name line, that is ignored) followed by lines of data with fields separated by the pipe character "|". Lines should not start or end with a pipe char however. No trailing line of blank lines or "rows selected" should be present. 3 | 4 | ./pairs.sh 5 | This will create or overwrite a dir called _ and put in it 22 files of the form analysis_<1..22>.out . 6 | 7 | cmpq.pl 8 | This is the pearl script that compares two files. The current version treats date output as a string and thus dates that (legally according to the spec) are right justified in a larger field may compare incorrectly. This will be fixed shortly. 9 | -------------------------------------------------------------------------------- /check_answers/cmpall.sh: -------------------------------------------------------------------------------- 1 | for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22;do 2 | ./cmpq.pl $i ./Ingres_1g_qualification/q${i}.out ./Oracle_1g_qualification/${i}.log; 3 | done 4 | -------------------------------------------------------------------------------- /check_answers/cmpq.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | my $Query=shift(@ARGV); 3 | my $InputFile1=shift(@ARGV); 4 | my $InputFile2=shift(@ARGV); 5 | my $assume_header=1; 6 | my $OutputLog="analysis_".$Query.".log"; 7 | my @ColPos; 8 | my @ColF1; 9 | my @ColF2; 10 | my @ColStartF1; 11 | my @ColEndF1; 12 | my @ColStartF2; 13 | my @ColEndF2; 14 | my $NumColF1; 15 | my $NumColF2; 16 | my $QueryColPrecisionFile="colprecision.txt"; 17 | my @ColStart; 18 | my @ColEnd; 19 | my $NumMismatch=0; 20 | open my $file1 , $InputFile1; 21 | open my $file2 , $InputFile2; 22 | $debug = 0; 23 | # function to remove whitespace from the start and end of the string 24 | 25 | # function to get next valid line 26 | sub NextLine($) 27 | { 28 | $filehandler = shift; 29 | my $line; 30 | while ($line=<$filehandler>){ 31 | chop($line); 32 | if (length($line)>0) { 33 | return $line; 34 | } 35 | } 36 | return undef; 37 | } 38 | 39 | sub rtrim($) 40 | { 41 | my $string = shift; 42 | #$string =~ s/^\s+//; 43 | $string =~ s/\s+$//; 44 | return $string; 45 | } 46 | 47 | 48 | # main 49 | 50 | open my $file1 , $InputFile1; 51 | open my $file2 , $InputFile2; 52 | open(LOG,">$OutputLog"); 53 | open(QColPrecision,$QueryColPrecisionFile); 54 | 55 | #get column precision information 56 | $i=1; 57 | while (($l=) && ($i<$Query)){ 58 | $i++; 59 | } 60 | if ($i != $Query) { 61 | print "Could not find column precision for Query $Query\n"; 62 | } 63 | @QueryColPrecision=split(/\s/,$l); 64 | 65 | #print @QueryColPrecision; 66 | $NumRowsF1=0; 67 | $NumRowsF2=0; 68 | if ($assume_header==1){ 69 | $lf1=&NextLine($file1); 70 | $lf2=&NextLine($file2); 71 | } 72 | while (1){ 73 | $lf1=&NextLine($file1); 74 | #print "File 1 $lf1\n"; 75 | $lf2=&NextLine($file2); 76 | #print "File 2 $lf2\n"; 77 | if ((!defined($lf1)) && (defined($lf2))) { 78 | print LOG "File1 ($InputFile1) exhausted before File2 ($InputFile2)\n"; 79 | print LOG "Number of rows processed $NumRowsF1\n"; 80 | exit; 81 | } elsif ((defined($lf1)) && (!defined($lf2))) { 82 | print LOG "File2 ($InputFile2) exhausted before File1 ($InputFile1)\n"; 83 | print LOG "Number of rows processed $NumRowsF1\n"; 84 | exit; 85 | } elsif ((!defined($lf1)) && (!defined($lf2))) { 86 | #done 87 | print LOG "Found $NumMismatch unacceptable missmatches\n"; 88 | print "Query $Query $NumMismatch unacceptable missmatches\n"; 89 | exit; 90 | } 91 | $NumRowsF1++; 92 | $NumRowsF2++; 93 | #print "Comparing row $lf1 with $lf2"; 94 | # The following split implements fixed column length 95 | #print "Splitting row $NumColF1: $lf1\n"; 96 | @ColF1=split(/\|/,$lf1); 97 | $NumColF1=@ColF1; 98 | #print "Splitting row $NumColF2: $lf2\n"; 99 | @ColF2=split(/\|/,$lf2); 100 | $NumColF2=@ColF2; 101 | # as needed we can extend to other splits 102 | if ($NumColF1!=$NumColF2) { 103 | print LOG "Number of column mismatch in row $NumRowsF1\n"; 104 | exit; 105 | } 106 | #print $NumColF1."|".$NumColF2."\n"; 107 | for ($col=0;$col<$NumColF1;$col++){ 108 | #print "@ColF1[$col]| "; 109 | @ColF1[$col]=&rtrim(@ColF1[$col]); 110 | #print "@ColF1[$col]|\n"; 111 | #print "@ColF2[$col]|"; 112 | @ColF2[$col]=&rtrim(@ColF2[$col]); 113 | #print "@ColF2[$col]|\n"; 114 | } 115 | # comparison 116 | for ($col=0;$col<$NumColF1;$col++){ 117 | #print "Comparing @ColF1[$col] and @ColF2[$col]\n"; 118 | $difference=0; 119 | $mismatch=0; 120 | #print "@QueryColPrecision[$col]\n"; 121 | for (@QueryColPrecision[$col]) { 122 | if (/str/) {$mismatch = @ColF1[$col] ne @ColF2[$col] ? 1 : 0} #column is string and needs to match exactly 123 | elsif (/sum/) {@ColF1[$col]=sprintf("%.2f", @ColF1[$col]); 124 | @ColF2[$col]=sprintf("%.2f", @ColF2[$col]); 125 | $difference = abs(@ColF1[$col] - @ColF2[$col]); 126 | $pdifference= sprintf("%.4f",(($difference/@ColF1[$col])*100)); 127 | $mismatch = $difference>100 ? 1 : 0; 128 | $pdifference= sprintf("%.4f",($difference/@ColF1[$col])*100); } #column is sum and needs to be with 100 129 | elsif (/avg/) {@ColF1[$col]=sprintf("%.2f", @ColF1[$col]); 130 | @ColF2[$col]=sprintf("%.2f", @ColF2[$col]); 131 | $difference = abs(@ColF1[$col] - @ColF2[$col]); 132 | $pdifference= sprintf("%.4f",(($difference/@ColF1[$col])*100)); 133 | $mismatch = $pdifference>1 ? 1 : 0} #column is avg and needs to be within 1 percent when reported to the nearest 1/100th, rounded up 134 | elsif (/cnt/) {$mismatch=1 if (@ColF1[$col] != @ColF2[$col])} #column is cnt and needs to match exactly 135 | elsif (/int/) {$mismatch=1 if (@ColF1[$col] != @ColF2[$col])} #column is int and needs to match exactly 136 | elsif (/num/) {@ColF1[$col]=sprintf("%.2f", @ColF1[$col]); 137 | @ColF2[$col]=sprintf("%.2f", @ColF2[$col]); 138 | $mismatch=1 if (@ColF1[$col] != @ColF2[$col]); 139 | $difference = abs(@ColF1[$col] - @ColF2[$col]); 140 | $pdifference= sprintf("%.4f",(($difference/@ColF1[$col])*100));} #column is num and needs to match exactly when reported to the nearest 1/100th, rounded up 141 | elsif (/rat/) {@ColF1[$col]=sprintf("%.2f", @ColF1[$col]); 142 | @ColF2[$col]=sprintf("%.2f", @ColF2[$col]); 143 | $difference = abs(@ColF1[$col] - @ColF2[$col]); 144 | $pdifference= sprintf("%.4f",(($difference/@ColF1[$col])*100)); 145 | $mismatch = $difference > 1 ? 1 : 0;} #column is a ratio and needs to match within 1 percent when reported to the nearest 1/100th, rounded up 146 | else {print LOG "Don't know how to compare type @QueryColPrecision[$col]\n";exit;} # default 147 | } 148 | #print "$mismatch $difference\n"; 149 | if ($mismatch == 1) { 150 | $NumMismatch++; 151 | if (@QueryColPrecision[$col]=~"str"){ 152 | printf( LOG "%s\n%30s%s\n%30s%s\n", "Difference in row $NumRowsF1 column $col using @QueryColPrecision[$col] ----------------> VIOLATION OF SPEC","$InputFile1:","@ColF1[$col]","$InputFile2:","@ColF2[$col]");} 153 | else { 154 | print LOG "Difference in row $NumRowsF1 column $col @ColF1[$col] @ColF2[$col] using @QueryColPrecision[$col]: total diff $difference percent diff $pdifference"." % ----------------> VIOLATION OF SPEC\n";} 155 | } elsif ($difference>0) { 156 | print LOG "Difference in row $NumRowsF1 column $col F1=@ColF1[$col] F2=@ColF2[$col] using @QueryColPrecision[$col] total diff $difference percent diff $pdifference ----------------> OK WITH SPEC\n"; 157 | } 158 | } 159 | } 160 | -------------------------------------------------------------------------------- /check_answers/colprecision.txt: -------------------------------------------------------------------------------- 1 | str str sum sum sum sum avg avg avg cnt 2 | num str str int str str str str 3 | int sum str int 4 | str cnt 5 | str sum 6 | sum 7 | str str int sum 8 | int rat 9 | str int sum 10 | int str sum num str str str str 11 | int sum 12 | str sum sum 13 | cnt cnt 14 | rat 15 | int str str str sum 16 | str str num cnt 17 | avg 18 | str int int str num sum 19 | sum 20 | str str 21 | str cnt 22 | num cnt sum 23 | 24 | -------------------------------------------------------------------------------- /check_answers/pairs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | pairs() 4 | { 5 | x=$1 6 | shift 1 7 | for y in $*;do 8 | echo Comparing $x to $y 9 | for ((i=1; i<23; i++));do 10 | ./cmpq.pl $i ./${x}/q${i}.out ./${y}/q${i}.out 11 | done 12 | mkdir -p ${x}_${y} 13 | mv analysis* ${x}_${y} 14 | done 15 | if [ $# -gt 1 ]; then 16 | pairs $* 17 | fi 18 | } 19 | 20 | if [ $# -eq 0 ]; then 21 | pairs oracle ingres microsoft ibm 22 | else 23 | pairs $* 24 | fi 25 | 26 | -------------------------------------------------------------------------------- /column_split.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | TABLE=$1 3 | IFS="|" 4 | 5 | while read line 6 | do 7 | set $line 8 | count=1 9 | while [ $# -gt 0 ] 10 | do 11 | echo $1 >> ${TABLE}$count 12 | count=`expr $count + 1` 13 | shift 14 | done 15 | done 16 | -------------------------------------------------------------------------------- /config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: config.h,v 1.8 2007/01/04 21:29:21 jms Exp $ 3 | * 4 | * Revision History 5 | * =================== 6 | * $Log: config.h,v $ 7 | * Revision 1.8 2007/01/04 21:29:21 jms 8 | * Porting changes uncovered as part of move to VS2005. No impact on data set 9 | * 10 | * Revision 1.7 2006/06/29 20:46:17 jms 11 | * 2.4.0 changes from Meikel 12 | * 13 | * Revision 1.6 2006/05/31 22:25:21 jms 14 | * Rework UnifInt calls in varsub to handle lack of PROTO defn in windows 15 | * 16 | * Revision 1.5 2006/05/25 22:35:36 jms 17 | * qgen porting changes for 32b/64b 18 | * 19 | * Revision 1.4 2006/03/09 18:54:55 jms 20 | * porting bugs 21 | * 22 | * Revision 1.3 2005/03/04 19:48:39 jms 23 | * Changes from Doug Johnson to address very large scale factors 24 | * 25 | * Revision 1.2 2005/01/03 20:08:58 jms 26 | * change line terminations 27 | * 28 | * Revision 1.1.1.1 2004/11/24 23:31:46 jms 29 | * re-establish external server 30 | * 31 | * Revision 1.7 2004/04/08 17:36:47 jms 32 | * clarify config.h/makefile linkage 33 | * 34 | * Revision 1.6 2004/04/08 17:35:00 jms 35 | * SUN/SOLARIS ifdef merge between machines 36 | * 37 | * Revision 1.5 2004/04/08 17:27:53 jms 38 | * solaris porting fixes 39 | * 40 | * Revision 1.4 2003/08/12 16:45:26 jms 41 | * linux porting changes 42 | * 43 | * Revision 1.3 2003/08/08 21:35:26 jms 44 | * first integration of rng64 for o_custkey and l_partkey 45 | * 46 | * Revision 1.2 2003/08/07 17:58:34 jms 47 | * Convery RNG to 64bit space as preparation for new large scale RNG 48 | * 49 | * Revision 1.1.1.1 2003/04/03 18:54:21 jms 50 | * initial checkin 51 | * 52 | * 53 | */ 54 | /* 55 | * this file allows the compilation of DBGEN to be tailored to specific 56 | * architectures and operating systems. Some options are grouped 57 | * together to allow easier compilation on a given vendor's hardware. 58 | * 59 | * The following #defines will effect the code: 60 | * KILL(pid) -- how to terminate a process in a parallel load 61 | * SPAWN -- name of system call to clone an existing process 62 | * SET_HANDLER(proc) -- name of routine to handle signals in parallel load 63 | * WAIT(res, pid) -- how to await the termination of a child 64 | * SEPARATOR -- character used to separate fields in flat files 65 | * STDLIB_HAS_GETOPT -- to prevent confilcts with gloabal getopt() 66 | * MDY_DATE -- generate dates as MM-DD-YY 67 | * WIN32 -- support for WindowsNT 68 | * SUPPORT_64BITS -- compiler defines a 64 bit datatype 69 | * DSS_HUGE -- 64 bit data type 70 | * HUGE_FORMAT -- printf string for 64 bit data type 71 | * EOL_HANDLING -- flat files don't need final column separator 72 | * 73 | * Certain defines must be provided in the makefile: 74 | * MACHINE defines 75 | * ========== 76 | * ATT -- getopt() handling 77 | * DOS -- disable all multi-user functionality/dependency 78 | * HP -- posix source inclusion differences 79 | * IBM -- posix source inclusion differences 80 | * SGI -- getopt() handling 81 | * SUN -- getopt() handling 82 | * LINUX 83 | * WIN32 -- for WINDOWS 84 | * 85 | * DATABASE defines 86 | * ================ 87 | * DB2 -- use DB2 dialect in QGEN 88 | * INFORMIX -- use Informix dialect in QGEN 89 | * SQLSERVER -- use SQLSERVER dialect in QGEN 90 | * SYBASE -- use Sybase dialect in QGEN 91 | * TDAT -- use Teradata dialect in QGEN 92 | * 93 | * WORKLOAD defines 94 | * ================ 95 | * TPCH -- make will create TPCH (set in makefile) 96 | */ 97 | 98 | #ifdef DOS 99 | #define PATH_SEP '\\' 100 | #else 101 | 102 | 103 | #ifdef ATT 104 | #define STDLIB_HAS_GETOPT 105 | #ifdef SQLSERVER 106 | #define WIN32 107 | #else 108 | /* the 64 bit defines are for the Metaware compiler */ 109 | #define SUPPORT_64BITS 110 | #define DSS_HUGE long long 111 | #define RNG_A 6364136223846793005ull 112 | #define RNG_C 1ull 113 | #define HUGE_FORMAT "%LLd" 114 | #define HUGE_DATE_FORMAT "%02LLd" 115 | #endif /* SQLSERVER or MP/RAS */ 116 | #endif /* ATT */ 117 | 118 | #ifdef HP 119 | #define _INCLUDE_POSIX_SOURCE 120 | #define STDLIB_HAS_GETOPT 121 | #define SUPPORT_64BITS 122 | #define DSS_HUGE long 123 | #define HUGE_COUNT 2 124 | #define HUGE_FORMAT "%ld" 125 | #define HUGE_DATE_FORMAT "%02lld" 126 | #define RNG_C 1ull 127 | #define RNG_A 6364136223846793005ull 128 | #endif /* HP */ 129 | 130 | #ifdef IBM 131 | #define STDLIB_HAS_GETOPT 132 | #define SUPPORT_64BITS 133 | #define DSS_HUGE long long 134 | #define HUGE_FORMAT "%lld" 135 | #define HUGE_DATE_FORMAT "%02lld" 136 | #define RNG_A 6364136223846793005ull 137 | #define RNG_C 1ull 138 | #endif /* IBM */ 139 | 140 | #ifdef LINUX 141 | #define STDLIB_HAS_GETOPT 142 | #define SUPPORT_64BITS 143 | #define DSS_HUGE long long int 144 | #define HUGE_FORMAT "%lld" 145 | #define HUGE_DATE_FORMAT "%02lld" 146 | #define RNG_A 6364136223846793005ull 147 | #define RNG_C 1ull 148 | #endif /* LINUX */ 149 | 150 | #ifdef MAC 151 | #define _POSIX_C_SOURCE 200112L 152 | #define _POSIX_SOURCE 153 | #define STDLIB_HAS_GETOPT 154 | #define SUPPORT_64BITS 155 | #define DSS_HUGE long 156 | #define HUGE_FORMAT "%ld" 157 | #define HUGE_DATE_FORMAT "%02ld" 158 | #define RNG_A 6364136223846793005ull 159 | #define RNG_C 1ull 160 | #endif /* MAC */ 161 | 162 | #ifdef SUN 163 | #define STDLIB_HAS_GETOPT 164 | #define RNG_A 6364136223846793005ull 165 | #define RNG_C 1ull 166 | #define SUPPORT_64BITS 167 | #define DSS_HUGE long long 168 | #define HUGE_FORMAT "%lld" 169 | #define HUGE_DATE_FORMAT "%02lld" 170 | #endif /* SUN */ 171 | 172 | #ifdef SGI 173 | #define STDLIB_HAS_GETOPT 174 | #define SUPPORT_64BITS 175 | #define DSS_HUGE __int64_t 176 | #endif /* SGI */ 177 | 178 | #if (defined(WIN32)&&!defined(_POSIX_)) 179 | #define pid_t int 180 | #define SET_HANDLER(proc) signal(SIGINT, proc) 181 | #define KILL(pid) \ 182 | TerminateProcess(OpenProcess(PROCESS_TERMINATE,FALSE,pid),3) 183 | #if (defined (__WATCOMC__)) 184 | #define SPAWN() spawnv(P_NOWAIT, spawn_args[0], spawn_args) 185 | #define WAIT(res, pid) cwait(res, pid, WAIT_CHILD) 186 | #else 187 | #define SPAWN() _spawnv(_P_NOWAIT, spawn_args[0], spawn_args) 188 | #define WAIT(res, pid) _cwait(res, pid, _WAIT_CHILD) 189 | #define getpid _getpid 190 | #endif /* WATCOMC */ 191 | #define SIGS_DEFINED 192 | #define PATH_SEP '\\' 193 | #define SUPPORT_64BITS 194 | #define DSS_HUGE __int64 195 | #define RNG_A 6364136223846793005uI64 196 | #define RNG_C 1uI64 197 | #define HUGE_FORMAT "%I64d" 198 | #define HUGE_DATE_FORMAT "%02I64d" 199 | /* need to define process termination codes to match UNIX */ 200 | /* these are copied from Linux/GNU and need to be verified as part of a rework of */ 201 | /* process handling under NT (29 Apr 98) */ 202 | #define WIFEXITED(s) ((s & 0xFF) == 0) 203 | #define WIFSIGNALED(s) (((unsigned int)((status)-1) & 0xFFFF) < 0xFF) 204 | #define WIFSTOPPED(s) (((s) & 0xff) == 0x7f) 205 | #define WTERMSIG(s) ((s) & 0x7f) 206 | #define WSTOPSIG(s) (((s) & 0xff00) >> 8) 207 | /* requried by move to Visual Studio 2005 */ 208 | #define strdup(x) _strdup(x) 209 | #endif /* WIN32 */ 210 | 211 | #ifndef SIGS_DEFINED 212 | #define KILL(pid) kill(SIGUSR1, pid) 213 | #define SET_HANDLER(proc) signal(SIGUSR1, proc) 214 | #define SPAWN fork 215 | #define WAIT(res, pid) wait(res) 216 | #endif /* DEFAULT */ 217 | 218 | #endif /* DOS */ 219 | 220 | #ifndef PATH_SEP 221 | #define PATH_SEP '/' 222 | #endif /* PATH_SEP */ 223 | 224 | #ifndef DSS_HUGE 225 | #error Support for a 64-bit datatype is required in this release 226 | #endif 227 | 228 | #ifndef DOUBLE_CAST 229 | #define DOUBLE_CAST (double) 230 | #endif /* DOUBLE_CAST */ 231 | 232 | -------------------------------------------------------------------------------- /dbgen.dsp: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="dbgen" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00 3 | # ** DO NOT EDIT ** 4 | 5 | # TARGTYPE "Win32 (x86) Console Application" 0x0103 6 | 7 | CFG=dbgen - Win32 Debug 8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE, 9 | !MESSAGE use the Export Makefile command and run 10 | !MESSAGE 11 | !MESSAGE NMAKE /f "dbgen.mak". 12 | !MESSAGE 13 | !MESSAGE You can specify a configuration when running NMAKE 14 | !MESSAGE by defining the macro CFG on the command line. For example: 15 | !MESSAGE 16 | !MESSAGE NMAKE /f "dbgen.mak" CFG="dbgen - Win32 Debug" 17 | !MESSAGE 18 | !MESSAGE Possible choices for configuration are: 19 | !MESSAGE 20 | !MESSAGE "dbgen - Win32 Release" (based on "Win32 (x86) Console Application") 21 | !MESSAGE "dbgen - Win32 Debug" (based on "Win32 (x86) Console Application") 22 | !MESSAGE 23 | 24 | # Begin Project 25 | # PROP AllowPerConfigDependencies 0 26 | # PROP Scc_ProjName "" 27 | # PROP Scc_LocalPath "" 28 | CPP=cl.exe 29 | RSC=rc.exe 30 | 31 | !IF "$(CFG)" == "dbgen - Win32 Release" 32 | 33 | # PROP BASE Use_MFC 0 34 | # PROP BASE Use_Debug_Libraries 0 35 | # PROP BASE Output_Dir "Release" 36 | # PROP BASE Intermediate_Dir "Release" 37 | # PROP BASE Target_Dir "" 38 | # PROP Use_MFC 0 39 | # PROP Use_Debug_Libraries 0 40 | # PROP Output_Dir "Release" 41 | # PROP Intermediate_Dir "Release" 42 | # PROP Target_Dir "" 43 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c 44 | # ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "TPCH" /YX /FD /c 45 | # ADD BASE RSC /l 0x409 /d "NDEBUG" 46 | # ADD RSC /l 0x409 /d "NDEBUG" 47 | BSC32=bscmake.exe 48 | # ADD BASE BSC32 /nologo 49 | # ADD BSC32 /nologo 50 | LINK32=link.exe 51 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 52 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 53 | 54 | !ELSEIF "$(CFG)" == "dbgen - Win32 Debug" 55 | 56 | # PROP BASE Use_MFC 0 57 | # PROP BASE Use_Debug_Libraries 1 58 | # PROP BASE Output_Dir "Debug" 59 | # PROP BASE Intermediate_Dir "Debug" 60 | # PROP BASE Target_Dir "" 61 | # PROP Use_MFC 0 62 | # PROP Use_Debug_Libraries 1 63 | # PROP Output_Dir "Debug" 64 | # PROP Intermediate_Dir "Debug" 65 | # PROP Target_Dir "" 66 | # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c 67 | # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "TPCH" /FR /YX /FD /GZ /c 68 | # ADD BASE RSC /l 0x409 /d "_DEBUG" 69 | # ADD RSC /l 0x409 /d "_DEBUG" 70 | BSC32=bscmake.exe 71 | # ADD BASE BSC32 /nologo 72 | # ADD BSC32 /nologo 73 | LINK32=link.exe 74 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept 75 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept 76 | 77 | !ENDIF 78 | 79 | # Begin Target 80 | 81 | # Name "dbgen - Win32 Release" 82 | # Name "dbgen - Win32 Debug" 83 | # Begin Group "Source Files" 84 | 85 | # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" 86 | # Begin Source File 87 | 88 | SOURCE=.\bm_utils.c 89 | # End Source File 90 | # Begin Source File 91 | 92 | SOURCE=.\build.c 93 | # End Source File 94 | # Begin Source File 95 | 96 | SOURCE=.\driver.c 97 | # End Source File 98 | # Begin Source File 99 | 100 | SOURCE=.\load_stub.c 101 | # End Source File 102 | # Begin Source File 103 | 104 | SOURCE=.\permute.c 105 | # End Source File 106 | # Begin Source File 107 | 108 | SOURCE=.\print.c 109 | # End Source File 110 | # Begin Source File 111 | 112 | SOURCE=.\rnd.c 113 | # End Source File 114 | # Begin Source File 115 | 116 | SOURCE=.\rng64.c 117 | # End Source File 118 | # Begin Source File 119 | 120 | SOURCE=.\speed_seed.c 121 | # End Source File 122 | # Begin Source File 123 | 124 | SOURCE=.\text.c 125 | # End Source File 126 | # End Group 127 | # Begin Group "Header Files" 128 | 129 | # PROP Default_Filter "h;hpp;hxx;hm;inl" 130 | # Begin Source File 131 | 132 | SOURCE=.\config.h 133 | # End Source File 134 | # Begin Source File 135 | 136 | SOURCE=.\dss.h 137 | # End Source File 138 | # Begin Source File 139 | 140 | SOURCE=.\dsstypes.h 141 | # End Source File 142 | # Begin Source File 143 | 144 | SOURCE=.\permute.h 145 | # End Source File 146 | # Begin Source File 147 | 148 | SOURCE=.\rnd.h 149 | # End Source File 150 | # Begin Source File 151 | 152 | SOURCE=.\rng64.h 153 | # End Source File 154 | # Begin Source File 155 | 156 | SOURCE=.\shared.h 157 | # End Source File 158 | # Begin Source File 159 | 160 | SOURCE=.\tpcd.h 161 | # End Source File 162 | # End Group 163 | # Begin Group "Resource Files" 164 | 165 | # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" 166 | # End Group 167 | # End Target 168 | # End Project 169 | -------------------------------------------------------------------------------- /dss.ddl: -------------------------------------------------------------------------------- 1 | -- Sccsid: @(#)dss.ddl 2.1.8.1 2 | CREATE TABLE NATION ( N_NATIONKEY INTEGER NOT NULL, 3 | N_NAME CHAR(25) NOT NULL, 4 | N_REGIONKEY INTEGER NOT NULL, 5 | N_COMMENT VARCHAR(152)); 6 | 7 | CREATE TABLE REGION ( R_REGIONKEY INTEGER NOT NULL, 8 | R_NAME CHAR(25) NOT NULL, 9 | R_COMMENT VARCHAR(152)); 10 | 11 | CREATE TABLE PART ( P_PARTKEY INTEGER NOT NULL, 12 | P_NAME VARCHAR(55) NOT NULL, 13 | P_MFGR CHAR(25) NOT NULL, 14 | P_BRAND CHAR(10) NOT NULL, 15 | P_TYPE VARCHAR(25) NOT NULL, 16 | P_SIZE INTEGER NOT NULL, 17 | P_CONTAINER CHAR(10) NOT NULL, 18 | P_RETAILPRICE DECIMAL(15,2) NOT NULL, 19 | P_COMMENT VARCHAR(23) NOT NULL ); 20 | 21 | CREATE TABLE SUPPLIER ( S_SUPPKEY INTEGER NOT NULL, 22 | S_NAME CHAR(25) NOT NULL, 23 | S_ADDRESS VARCHAR(40) NOT NULL, 24 | S_NATIONKEY INTEGER NOT NULL, 25 | S_PHONE CHAR(15) NOT NULL, 26 | S_ACCTBAL DECIMAL(15,2) NOT NULL, 27 | S_COMMENT VARCHAR(101) NOT NULL); 28 | 29 | CREATE TABLE PARTSUPP ( PS_PARTKEY INTEGER NOT NULL, 30 | PS_SUPPKEY INTEGER NOT NULL, 31 | PS_AVAILQTY INTEGER NOT NULL, 32 | PS_SUPPLYCOST DECIMAL(15,2) NOT NULL, 33 | PS_COMMENT VARCHAR(199) NOT NULL ); 34 | 35 | CREATE TABLE CUSTOMER ( C_CUSTKEY INTEGER NOT NULL, 36 | C_NAME VARCHAR(25) NOT NULL, 37 | C_ADDRESS VARCHAR(40) NOT NULL, 38 | C_NATIONKEY INTEGER NOT NULL, 39 | C_PHONE CHAR(15) NOT NULL, 40 | C_ACCTBAL DECIMAL(15,2) NOT NULL, 41 | C_MKTSEGMENT CHAR(10) NOT NULL, 42 | C_COMMENT VARCHAR(117) NOT NULL); 43 | 44 | CREATE TABLE ORDERS ( O_ORDERKEY INTEGER NOT NULL, 45 | O_CUSTKEY INTEGER NOT NULL, 46 | O_ORDERSTATUS CHAR(1) NOT NULL, 47 | O_TOTALPRICE DECIMAL(15,2) NOT NULL, 48 | O_ORDERDATE DATE NOT NULL, 49 | O_ORDERPRIORITY CHAR(15) NOT NULL, 50 | O_CLERK CHAR(15) NOT NULL, 51 | O_SHIPPRIORITY INTEGER NOT NULL, 52 | O_COMMENT VARCHAR(79) NOT NULL); 53 | 54 | CREATE TABLE LINEITEM ( L_ORDERKEY INTEGER NOT NULL, 55 | L_PARTKEY INTEGER NOT NULL, 56 | L_SUPPKEY INTEGER NOT NULL, 57 | L_LINENUMBER INTEGER NOT NULL, 58 | L_QUANTITY DECIMAL(15,2) NOT NULL, 59 | L_EXTENDEDPRICE DECIMAL(15,2) NOT NULL, 60 | L_DISCOUNT DECIMAL(15,2) NOT NULL, 61 | L_TAX DECIMAL(15,2) NOT NULL, 62 | L_RETURNFLAG CHAR(1) NOT NULL, 63 | L_LINESTATUS CHAR(1) NOT NULL, 64 | L_SHIPDATE DATE NOT NULL, 65 | L_COMMITDATE DATE NOT NULL, 66 | L_RECEIPTDATE DATE NOT NULL, 67 | L_SHIPINSTRUCT CHAR(25) NOT NULL, 68 | L_SHIPMODE CHAR(10) NOT NULL, 69 | L_COMMENT VARCHAR(44) NOT NULL); 70 | 71 | -------------------------------------------------------------------------------- /dss.ri: -------------------------------------------------------------------------------- 1 | -- Sccsid: @(#)dss.ri 2.1.8.1 2 | -- TPCD Benchmark Version 8.0 3 | 4 | CONNECT TO TPCD; 5 | 6 | --ALTER TABLE TPCD.REGION DROP PRIMARY KEY; 7 | --ALTER TABLE TPCD.NATION DROP PRIMARY KEY; 8 | --ALTER TABLE TPCD.PART DROP PRIMARY KEY; 9 | --ALTER TABLE TPCD.SUPPLIER DROP PRIMARY KEY; 10 | --ALTER TABLE TPCD.PARTSUPP DROP PRIMARY KEY; 11 | --ALTER TABLE TPCD.ORDERS DROP PRIMARY KEY; 12 | --ALTER TABLE TPCD.LINEITEM DROP PRIMARY KEY; 13 | --ALTER TABLE TPCD.CUSTOMER DROP PRIMARY KEY; 14 | 15 | 16 | -- For table REGION 17 | ALTER TABLE TPCD.REGION 18 | ADD PRIMARY KEY (R_REGIONKEY); 19 | 20 | -- For table NATION 21 | ALTER TABLE TPCD.NATION 22 | ADD PRIMARY KEY (N_NATIONKEY); 23 | 24 | ALTER TABLE TPCD.NATION 25 | ADD FOREIGN KEY NATION_FK1 (N_REGIONKEY) references TPCD.REGION; 26 | 27 | COMMIT WORK; 28 | 29 | -- For table PART 30 | ALTER TABLE TPCD.PART 31 | ADD PRIMARY KEY (P_PARTKEY); 32 | 33 | COMMIT WORK; 34 | 35 | -- For table SUPPLIER 36 | ALTER TABLE TPCD.SUPPLIER 37 | ADD PRIMARY KEY (S_SUPPKEY); 38 | 39 | ALTER TABLE TPCD.SUPPLIER 40 | ADD FOREIGN KEY SUPPLIER_FK1 (S_NATIONKEY) references TPCD.NATION; 41 | 42 | COMMIT WORK; 43 | 44 | -- For table PARTSUPP 45 | ALTER TABLE TPCD.PARTSUPP 46 | ADD PRIMARY KEY (PS_PARTKEY,PS_SUPPKEY); 47 | 48 | COMMIT WORK; 49 | 50 | -- For table CUSTOMER 51 | ALTER TABLE TPCD.CUSTOMER 52 | ADD PRIMARY KEY (C_CUSTKEY); 53 | 54 | ALTER TABLE TPCD.CUSTOMER 55 | ADD FOREIGN KEY CUSTOMER_FK1 (C_NATIONKEY) references TPCD.NATION; 56 | 57 | COMMIT WORK; 58 | 59 | -- For table LINEITEM 60 | ALTER TABLE TPCD.LINEITEM 61 | ADD PRIMARY KEY (L_ORDERKEY,L_LINENUMBER); 62 | 63 | COMMIT WORK; 64 | 65 | -- For table ORDERS 66 | ALTER TABLE TPCD.ORDERS 67 | ADD PRIMARY KEY (O_ORDERKEY); 68 | 69 | COMMIT WORK; 70 | 71 | -- For table PARTSUPP 72 | ALTER TABLE TPCD.PARTSUPP 73 | ADD FOREIGN KEY PARTSUPP_FK1 (PS_SUPPKEY) references TPCD.SUPPLIER; 74 | 75 | COMMIT WORK; 76 | 77 | ALTER TABLE TPCD.PARTSUPP 78 | ADD FOREIGN KEY PARTSUPP_FK2 (PS_PARTKEY) references TPCD.PART; 79 | 80 | COMMIT WORK; 81 | 82 | -- For table ORDERS 83 | ALTER TABLE TPCD.ORDERS 84 | ADD FOREIGN KEY ORDERS_FK1 (O_CUSTKEY) references TPCD.CUSTOMER; 85 | 86 | COMMIT WORK; 87 | 88 | -- For table LINEITEM 89 | ALTER TABLE TPCD.LINEITEM 90 | ADD FOREIGN KEY LINEITEM_FK1 (L_ORDERKEY) references TPCD.ORDERS; 91 | 92 | COMMIT WORK; 93 | 94 | ALTER TABLE TPCD.LINEITEM 95 | ADD FOREIGN KEY LINEITEM_FK2 (L_PARTKEY,L_SUPPKEY) references 96 | TPCD.PARTSUPP; 97 | 98 | COMMIT WORK; 99 | 100 | 101 | -------------------------------------------------------------------------------- /dsstypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: dsstypes.h,v 1.3 2005/10/28 02:57:04 jms Exp $ 3 | * 4 | * Revision History 5 | * =================== 6 | * $Log: dsstypes.h,v $ 7 | * Revision 1.3 2005/10/28 02:57:04 jms 8 | * allow for larger names in customer table 9 | * 10 | * Revision 1.2 2005/01/03 20:08:58 jms 11 | * change line terminations 12 | * 13 | * Revision 1.1.1.1 2004/11/24 23:31:46 jms 14 | * re-establish external server 15 | * 16 | * Revision 1.3 2004/04/07 20:17:29 jms 17 | * bug #58 (join fails between order/lineitem) 18 | * 19 | * Revision 1.2 2004/01/22 05:49:29 jms 20 | * AIX porting (AIX 5.1) 21 | * 22 | * Revision 1.1.1.1 2003/08/07 17:58:34 jms 23 | * recreation after CVS crash 24 | * 25 | * Revision 1.2 2003/08/07 17:58:34 jms 26 | * Convery RNG to 64bit space as preparation for new large scale RNG 27 | * 28 | * Revision 1.1.1.1 2003/04/03 18:54:21 jms 29 | * initial checkin 30 | * 31 | * 32 | */ 33 | /* 34 | * general definitions and control information for the DSS data types 35 | * and function prototypes 36 | */ 37 | 38 | /* 39 | * typedefs 40 | */ 41 | typedef struct 42 | { 43 | DSS_HUGE custkey; 44 | char name[C_NAME_LEN + 3]; 45 | char address[C_ADDR_MAX + 1]; 46 | int alen; 47 | DSS_HUGE nation_code; 48 | char phone[PHONE_LEN + 1]; 49 | DSS_HUGE acctbal; 50 | char mktsegment[MAXAGG_LEN + 1]; 51 | char comment[C_CMNT_MAX + 1]; 52 | int clen; 53 | } customer_t; 54 | /* customers.c */ 55 | long mk_cust PROTO((DSS_HUGE n_cust, customer_t * c)); 56 | int pr_cust PROTO((customer_t * c, int mode)); 57 | int ld_cust PROTO((customer_t * c, int mode)); 58 | 59 | typedef struct 60 | { 61 | DSS_HUGE okey; 62 | DSS_HUGE partkey; 63 | DSS_HUGE suppkey; 64 | DSS_HUGE lcnt; 65 | DSS_HUGE quantity; 66 | DSS_HUGE eprice; 67 | DSS_HUGE discount; 68 | DSS_HUGE tax; 69 | char rflag[1]; 70 | char lstatus[1]; 71 | char cdate[DATE_LEN]; 72 | char sdate[DATE_LEN]; 73 | char rdate[DATE_LEN]; 74 | char shipinstruct[MAXAGG_LEN + 1]; 75 | char shipmode[MAXAGG_LEN + 1]; 76 | char comment[L_CMNT_MAX + 1]; 77 | int clen; 78 | } line_t; 79 | 80 | typedef struct 81 | { 82 | DSS_HUGE okey; 83 | DSS_HUGE custkey; 84 | char orderstatus; 85 | DSS_HUGE totalprice; 86 | char odate[DATE_LEN]; 87 | char opriority[MAXAGG_LEN + 1]; 88 | char clerk[O_CLRK_LEN + 1]; 89 | long spriority; 90 | DSS_HUGE lines; 91 | char comment[O_CMNT_MAX + 1]; 92 | int clen; 93 | line_t l[O_LCNT_MAX]; 94 | } order_t; 95 | 96 | /* order.c */ 97 | long mk_order PROTO((DSS_HUGE index, order_t * o, long upd_num)); 98 | int pr_order PROTO((order_t * o, int mode)); 99 | int ld_order PROTO((order_t * o, int mode)); 100 | void mk_sparse PROTO((DSS_HUGE index, DSS_HUGE *ok, long seq)); 101 | 102 | typedef struct 103 | { 104 | DSS_HUGE partkey; 105 | DSS_HUGE suppkey; 106 | DSS_HUGE qty; 107 | DSS_HUGE scost; 108 | char comment[PS_CMNT_MAX + 1]; 109 | int clen; 110 | } partsupp_t; 111 | 112 | typedef struct 113 | { 114 | DSS_HUGE partkey; 115 | char name[P_NAME_LEN + 1]; 116 | int nlen; 117 | char mfgr[P_MFG_LEN + 1]; 118 | char brand[P_BRND_LEN + 1]; 119 | char type[P_TYPE_LEN + 1]; 120 | int tlen; 121 | DSS_HUGE size; 122 | char container[P_CNTR_LEN + 1]; 123 | DSS_HUGE retailprice; 124 | char comment[P_CMNT_MAX + 1]; 125 | int clen; 126 | partsupp_t s[SUPP_PER_PART]; 127 | } part_t; 128 | 129 | /* parts.c */ 130 | long mk_part PROTO((DSS_HUGE index, part_t * p)); 131 | int pr_part PROTO((part_t * part, int mode)); 132 | int ld_part PROTO((part_t * part, int mode)); 133 | 134 | typedef struct 135 | { 136 | DSS_HUGE suppkey; 137 | char name[S_NAME_LEN + 1]; 138 | char address[S_ADDR_MAX + 1]; 139 | int alen; 140 | DSS_HUGE nation_code; 141 | char phone[PHONE_LEN + 1]; 142 | DSS_HUGE acctbal; 143 | char comment[S_CMNT_MAX + 1]; 144 | int clen; 145 | } supplier_t; 146 | /* supplier.c */ 147 | long mk_supp PROTO((DSS_HUGE index, supplier_t * s)); 148 | int pr_supp PROTO((supplier_t * supp, int mode)); 149 | int ld_supp PROTO((supplier_t * supp, int mode)); 150 | 151 | typedef struct 152 | { 153 | DSS_HUGE timekey; 154 | char alpha[DATE_LEN]; 155 | long year; 156 | long month; 157 | long week; 158 | long day; 159 | } dss_time_t; 160 | 161 | /* time.c */ 162 | long mk_time PROTO((DSS_HUGE h, dss_time_t * t)); 163 | 164 | /* 165 | * this assumes that N_CMNT_LEN >= R_CMNT_LEN 166 | */ 167 | typedef struct 168 | { 169 | DSS_HUGE code; 170 | char *text; 171 | long join; 172 | char comment[N_CMNT_MAX + 1]; 173 | int clen; 174 | } code_t; 175 | 176 | /* code table */ 177 | int mk_nation PROTO((DSS_HUGE i, code_t * c)); 178 | int pr_nation PROTO((code_t * c, int mode)); 179 | int ld_nation PROTO((code_t * c, int mode)); 180 | int mk_region PROTO((DSS_HUGE i, code_t * c)); 181 | int pr_region PROTO((code_t * c, int mode)); 182 | int ld_region PROTO((code_t * c, int mode)); 183 | 184 | -------------------------------------------------------------------------------- /load_stub.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: load_stub.c,v 1.2 2005/01/03 20:08:58 jms Exp $ 3 | * 4 | * Revision History 5 | * =================== 6 | * $Log: load_stub.c,v $ 7 | * Revision 1.2 2005/01/03 20:08:58 jms 8 | * change line terminations 9 | * 10 | * Revision 1.1.1.1 2004/11/24 23:31:46 jms 11 | * re-establish external server 12 | * 13 | * Revision 1.1.1.1 2003/04/03 18:54:21 jms 14 | * recreation after CVS crash 15 | * 16 | * Revision 1.1.1.1 2003/04/03 18:54:21 jms 17 | * initial checkin 18 | * 19 | * 20 | */ 21 | /***************************************************************** 22 | * Title: load_stub.c 23 | * Description: 24 | * stub routines for: 25 | * inline load of dss benchmark 26 | * header creation for dss benchmark 27 | * 28 | ***************************************************************** 29 | */ 30 | 31 | #include 32 | #include "config.h" 33 | #include "dss.h" 34 | #include "dsstypes.h" 35 | 36 | int 37 | close_direct(void) 38 | { 39 | /* any post load cleanup goes here */ 40 | return(0); 41 | } 42 | 43 | int 44 | prep_direct(void) 45 | { 46 | /* any preload prep goes here */ 47 | return(0); 48 | } 49 | 50 | int 51 | hd_cust (FILE *f) 52 | { 53 | static int count = 0; 54 | 55 | if (! count++) 56 | printf("No header has been defined for the customer table\n"); 57 | 58 | return(0); 59 | } 60 | 61 | int 62 | ld_cust (customer_t *cp, int mode) 63 | { 64 | static int count = 0; 65 | 66 | if (! count++) 67 | printf("%s %s\n", 68 | "No load routine has been defined", 69 | "for the customer table"); 70 | 71 | return(0); 72 | } 73 | 74 | int 75 | hd_part (FILE *f) 76 | { 77 | static int count = 0; 78 | 79 | if (! count++) 80 | printf("No header has been defined for the part table\n"); 81 | 82 | return(0); 83 | } 84 | 85 | int 86 | ld_part (part_t *pp, int mode) 87 | { 88 | static int count = 0; 89 | 90 | if (! count++) 91 | printf("No load routine has been defined for the part table\n"); 92 | 93 | return(0); 94 | } 95 | 96 | int 97 | ld_psupp (part_t *pp, int mode) 98 | { 99 | static int count = 0; 100 | 101 | if (! count++) 102 | printf("%s %s\n", 103 | "No load routine has been defined for the", 104 | "psupp table\n"); 105 | 106 | return(0); 107 | 108 | } 109 | 110 | 111 | int 112 | hd_supp (FILE *f) 113 | { 114 | static int count = 0; 115 | 116 | if (! count++) 117 | printf("No header has been defined for the supplier table\n"); 118 | 119 | return(0); 120 | } 121 | 122 | int 123 | ld_supp (supplier_t *sp, int mode) 124 | { 125 | static int count = 0; 126 | 127 | if (! count++) 128 | printf("%s %s\n", 129 | "No load routine has been defined", 130 | "for the supplier table\n"); 131 | 132 | return(0); 133 | } 134 | 135 | 136 | int 137 | hd_order (FILE *f) 138 | { 139 | static int count = 0; 140 | 141 | if (! count++) 142 | printf("No header has been defined for the order table\n"); 143 | 144 | return(0); 145 | } 146 | 147 | int 148 | ld_order (order_t *p, int mode) 149 | { 150 | static int count = 0; 151 | 152 | if (! count++) 153 | printf("%s %s\n", 154 | "No load routine has been defined", 155 | "for the order table"); 156 | 157 | return(0); 158 | } 159 | 160 | int ld_line (order_t *p, int mode) 161 | { 162 | static int count = 0; 163 | 164 | if (! count++) 165 | printf("%s %s\n", 166 | "No load routine has been defined", 167 | "for the line table"); 168 | 169 | return(0); 170 | } 171 | 172 | 173 | 174 | int 175 | hd_psupp (FILE *f) 176 | { 177 | static int count = 0; 178 | 179 | if (! count++) 180 | printf("%s %s\n", 181 | "No header has been defined for the", 182 | "part supplier table"); 183 | 184 | return(0); 185 | } 186 | 187 | 188 | int 189 | hd_line (FILE *f) 190 | { 191 | static int count = 0; 192 | 193 | if (! count++) 194 | printf("No header has been defined for the lineitem table\n"); 195 | 196 | return(0); 197 | } 198 | 199 | int 200 | hd_nation (FILE *f) 201 | { 202 | static int count = 0; 203 | 204 | if (! count++) 205 | printf("No header has been defined for the nation table\n"); 206 | 207 | return(0); 208 | } 209 | 210 | int 211 | ld_nation (code_t *cp, int mode) 212 | { 213 | static int count = 0; 214 | 215 | if (! count++) 216 | printf("%s %s\n", 217 | "No load routine has been defined", 218 | "for the nation table"); 219 | 220 | return(0); 221 | } 222 | 223 | int 224 | hd_region (FILE *f) 225 | { 226 | static int count = 0; 227 | 228 | if (! count++) 229 | printf("No header has been defined for the region table\n"); 230 | 231 | return(0); 232 | } 233 | 234 | int 235 | ld_region (code_t *cp, int mode) 236 | { 237 | static int count = 0; 238 | 239 | if (! count++) 240 | printf("%s %s\n", 241 | "No load routine has been defined", 242 | "for the region table"); 243 | 244 | return(0); 245 | } 246 | 247 | int 248 | ld_order_line (order_t *p, int mode) 249 | { 250 | ld_order(p, mode); 251 | ld_line (p, mode); 252 | 253 | return(0); 254 | } 255 | 256 | int 257 | hd_order_line (FILE *f) 258 | { 259 | hd_order(f); 260 | hd_line (f); 261 | 262 | return(0); 263 | } 264 | 265 | int 266 | ld_part_psupp (part_t *p, int mode) 267 | { 268 | ld_part(p, mode); 269 | ld_psupp (p, mode); 270 | 271 | return(0); 272 | } 273 | 274 | int 275 | hd_part_psupp (FILE *f) 276 | { 277 | hd_part(f); 278 | hd_psupp(f); 279 | 280 | return(0); 281 | } 282 | -------------------------------------------------------------------------------- /makefile: -------------------------------------------------------------------------------- 1 | # 2 | # $Id: makefile.suite,v 1.25 2009/10/22 19:10:21 jms Exp $ 3 | # 4 | # Revision History 5 | # =================== 6 | # $Log: makefile.suite,v $ 7 | # Revision 1.25 2009/10/22 19:10:21 jms 8 | # update revision to 2.9.0, disable bug55 fix 9 | # 10 | # Revision 1.24 2009/10/22 19:06:10 jms 11 | # update revision to 2.9.0, disable bug55 fix 12 | # 13 | # Revision 1.23 2009/06/28 14:01:08 jms 14 | # bug fix for DOP 15 | # 16 | # Revision 1.22 2008/09/15 16:37:46 jms 17 | # release 2.8.0 makefile.suite 18 | # 19 | # Revision 1.21 2008/03/21 18:26:54 jms 20 | # recursive zip for reference data, chmod for update_release 21 | # 22 | # Revision 1.20 2008/03/21 17:38:39 jms 23 | # changes for 2.6.3 24 | # 25 | # Revision 1.19 2007/03/08 20:36:03 jms 26 | # update release number to 2.6.1 27 | # 28 | # Revision 1.18 2007/02/06 18:15:56 jms 29 | # remove update release from general target 30 | # 31 | # Revision 1.17 2007/01/25 19:35:50 jms 32 | # add sln file used by VS2005 33 | # 34 | # Revision 1.16 2007/01/05 20:05:41 jms 35 | # update release number 36 | # 37 | # Revision 1.15 2006/09/07 17:25:57 jms 38 | # correct dss.ddl 39 | # 40 | # Revision 1.14 2006/08/01 17:21:22 jms 41 | # fix bad merge 42 | # 43 | # Revision 1.13 2006/08/01 16:55:44 jms 44 | # move to 2.4.1 45 | # 46 | # Revision 1.12 2006/06/29 20:46:17 jms 47 | # 2.4.0 changes from Meikel 48 | # 49 | # Revision 1.10 2006/05/25 22:30:44 jms 50 | # qgen porting for 32b/64b 51 | # 52 | # Revision 1.9 2006/04/26 23:17:09 jms 53 | # checking release.h prior to release build 54 | # 55 | # Revision 1.8 2006/04/26 23:03:00 jms 56 | # release 2.3.4-1 57 | # 58 | # Revision 1.7 2006/04/12 18:13:58 jms 59 | # release 2.3.3 60 | # 61 | # Revision 1.6 2006/03/09 18:59:19 jms 62 | # move to version 2.3.2 63 | # 64 | # Revision 1.5 2006/01/28 23:54:32 jms 65 | # add reference data to release 66 | # 67 | # Revision 1.4 2005/10/28 03:00:32 jms 68 | # fix release target 69 | # 70 | # Revision 1.3 2005/10/28 02:54:14 jms 71 | # increment build count with each release creation 72 | # 73 | # Revision 1.2 2005/01/03 20:08:58 jms 74 | # change line terminations 75 | # 76 | # Revision 1.1.1.1 2004/11/24 23:31:47 jms 77 | # re-establish external server 78 | # 79 | # Revision 1.5 2004/03/26 20:39:23 jms 80 | # add tpch tag to release files 81 | # 82 | # Revision 1.4 2004/03/16 14:45:57 jms 83 | # correct release target in makefile 84 | # 85 | # Revision 1.3 2004/03/02 20:49:01 jms 86 | # simplify distributions, add Windows IDE files 87 | # releases should use make release from now on 88 | # 89 | # Revision 1.2 2004/02/18 14:05:53 jms 90 | # porting changes for LINUX and 64 bit RNG 91 | # 92 | # Revision 1.1.1.1 2003/04/03 18:54:21 jms 93 | # recreation after CVS crash 94 | # 95 | # Revision 1.1.1.1 2003/04/03 18:54:21 jms 96 | # initial checkin 97 | # 98 | # 99 | # 100 | ################ 101 | ## CHANGE NAME OF ANSI COMPILER HERE 102 | ################ 103 | CC = gcc 104 | # Current values for DATABASE are: INFORMIX, DB2, TDAT (Teradata) 105 | # SQLSERVER, SYBASE, ORACLE 106 | # Current values for MACHINE are: ATT, DOS, HP, IBM, ICL, MVS, 107 | # SGI, SUN, U2200, VMS, LINUX, WIN32 108 | # Current values for WORKLOAD are: TPCH 109 | DATABASE= ORACLE 110 | MACHINE = MAC 111 | WORKLOAD = TPCH 112 | # 113 | CFLAGS = -g -DDBNAME=\"dss\" -D$(MACHINE) -D$(DATABASE) -D$(WORKLOAD) -DRNG_TEST -D_FILE_OFFSET_BITS=64 114 | LDFLAGS = -O 115 | # The OBJ,EXE and LIB macros will need to be changed for compilation under 116 | # Windows NT 117 | OBJ = .o 118 | EXE = 119 | LIBS = -lm 120 | # 121 | # NO CHANGES SHOULD BE NECESSARY BELOW THIS LINE 122 | ############### 123 | VERSION=2 124 | RELEASE=13 125 | PATCH=0 126 | BUILD=`grep BUILD release.h | cut -f3 -d' '` 127 | NEW_BUILD=`expr ${BUILD} + 1` 128 | TREE_ROOT=/tmp/tree 129 | # 130 | PROG1 = dbgen$(EXE) 131 | PROG2 = qgen$(EXE) 132 | PROGS = $(PROG1) $(PROG2) 133 | # 134 | HDR1 = dss.h rnd.h config.h dsstypes.h shared.h bcd2.h rng64.h release.h 135 | HDR2 = tpcd.h permute.h 136 | HDR = $(HDR1) $(HDR2) 137 | # 138 | SRC1 = build.c driver.c bm_utils.c rnd.c print.c load_stub.c bcd2.c \ 139 | speed_seed.c text.c permute.c rng64.c 140 | SRC2 = qgen.c varsub.c 141 | SRC = $(SRC1) $(SRC2) 142 | # 143 | OBJ1 = build$(OBJ) driver$(OBJ) bm_utils$(OBJ) rnd$(OBJ) print$(OBJ) \ 144 | load_stub$(OBJ) bcd2$(OBJ) speed_seed$(OBJ) text$(OBJ) permute$(OBJ) \ 145 | rng64$(OBJ) 146 | OBJ2 = build$(OBJ) bm_utils$(OBJ) qgen$(OBJ) rnd$(OBJ) varsub$(OBJ) \ 147 | text$(OBJ) bcd2$(OBJ) permute$(OBJ) speed_seed$(OBJ) rng64$(OBJ) 148 | OBJS = $(OBJ1) $(OBJ2) 149 | # 150 | SETS = dists.dss 151 | DOC=README HISTORY PORTING.NOTES BUGS 152 | DDL = dss.ddl dss.ri 153 | WINDOWS_IDE = tpch.dsw dbgen.dsp tpch.sln tpch.vcproj qgen.vcproj 154 | OTHER=makefile.suite $(SETS) $(DDL) $(WINDOWS_IDE) 155 | # case is *important* in TEST_RES 156 | TEST_RES = O.res L.res c.res s.res P.res S.res n.res r.res 157 | # 158 | DBGENSRC=$(SRC1) $(HDR1) $(OTHER) $(DOC) $(SRC2) $(HDR2) $(SRC3) 159 | FQD=queries/1.sql queries/2.sql queries/3.sql queries/4.sql queries/5.sql queries/6.sql queries/7.sql \ 160 | queries/8.sql queries/9.sql queries/10.sql queries/11.sql queries/12.sql queries/13.sql \ 161 | queries/14.sql queries/15.sql queries/16.sql queries/17.sql queries/18.sql queries/19.sql queries/20.sql \ 162 | queries/21.sql queries/22.sql 163 | VARIANTS= variants/8a.sql variants/12a.sql variants/13a.sql variants/14a.sql variants/15a.sql 164 | ANS = answers/q1.out answers/q2.out answers/q3.out answers/q4.out answers/q5.out answers/q6.out answers/q7.out answers/q8.out \ 165 | answers/q9.out answers/q10.out answers/q11.out answers/q12.out answers/q13.out answers/q14.out answers/q15.out \ 166 | answers/q16.out answers/q17.out answers/q18.out answers/q19.out answers/q20.out answers/q21.out answers/q22.out 167 | QSRC = $(FQD) $(VARIANTS) $(ANS) 168 | TREE_DOC=tree.readme tree.changes appendix.readme appendix.version answers.readme queries.readme variants.readme 169 | REFERENCE=reference/[tcR]* 170 | REFERENCE_DATA=referenceData/[13]* 171 | SCRIPTS= check55.sh column_split.sh dop.sh gen_tasks.sh last_row.sh load_balance.sh new55.sh check_dirs.sh 172 | ALLSRC=$(DBGENSRC) $(REFERENCE) $(QSRC) $(SCRIPTS) 173 | JUNK = 174 | # 175 | all: $(PROGS) 176 | $(PROG1): $(OBJ1) $(SETS) 177 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ1) $(LIBS) 178 | $(PROG2): permute.h $(OBJ2) 179 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ2) $(LIBS) 180 | clean: 181 | rm -f $(PROGS) $(OBJS) $(JUNK) 182 | lint: 183 | lint $(CFLAGS) -u -x -wO -Ma -p $(SRC1) 184 | lint $(CFLAGS) -u -x -wO -Ma -p $(SRC2) 185 | 186 | tar: $(ALLSRC) 187 | tar cvhf - $(ALLSRC) --exclude .svn\*/\* |gzip - > tpch_${VERSION}_${RELEASE}_${PATCH}.tar.gz 188 | tar cvhf - $(REFERENCE_DATA) --exclude .svn\*/\* |gzip - > reference_${VERSION}_${RELEASE}_${PATCH}.tar.gz 189 | zip: $(ALLSRC) 190 | zip -r tpch_${VERSION}_${RELEASE}_${PATCH}.zip $(ALLSRC) -x *.svn* 191 | zip -r reference_${VERSION}_${RELEASE}_${PATCH}.zip $(REFERENCE_DATA) -x *.svn* 192 | release: 193 | make -f makefile.suite tar 194 | make -f makefile.suite zip 195 | ( cd tests; sh test_list.sh `date '+%Y%m%d'` ) 196 | rnd$(OBJ): rnd.h 197 | $(OBJ1): $(HDR1) 198 | $(OBJ2): dss.h tpcd.h config.h rng64.h release.h 199 | -------------------------------------------------------------------------------- /makefile.suite: -------------------------------------------------------------------------------- 1 | # 2 | # $Id: makefile.suite,v 1.25 2009/10/22 19:10:21 jms Exp $ 3 | # 4 | # Revision History 5 | # =================== 6 | # $Log: makefile.suite,v $ 7 | # Revision 1.25 2009/10/22 19:10:21 jms 8 | # update revision to 2.9.0, disable bug55 fix 9 | # 10 | # Revision 1.24 2009/10/22 19:06:10 jms 11 | # update revision to 2.9.0, disable bug55 fix 12 | # 13 | # Revision 1.23 2009/06/28 14:01:08 jms 14 | # bug fix for DOP 15 | # 16 | # Revision 1.22 2008/09/15 16:37:46 jms 17 | # release 2.8.0 makefile.suite 18 | # 19 | # Revision 1.21 2008/03/21 18:26:54 jms 20 | # recursive zip for reference data, chmod for update_release 21 | # 22 | # Revision 1.20 2008/03/21 17:38:39 jms 23 | # changes for 2.6.3 24 | # 25 | # Revision 1.19 2007/03/08 20:36:03 jms 26 | # update release number to 2.6.1 27 | # 28 | # Revision 1.18 2007/02/06 18:15:56 jms 29 | # remove update release from general target 30 | # 31 | # Revision 1.17 2007/01/25 19:35:50 jms 32 | # add sln file used by VS2005 33 | # 34 | # Revision 1.16 2007/01/05 20:05:41 jms 35 | # update release number 36 | # 37 | # Revision 1.15 2006/09/07 17:25:57 jms 38 | # correct dss.ddl 39 | # 40 | # Revision 1.14 2006/08/01 17:21:22 jms 41 | # fix bad merge 42 | # 43 | # Revision 1.13 2006/08/01 16:55:44 jms 44 | # move to 2.4.1 45 | # 46 | # Revision 1.12 2006/06/29 20:46:17 jms 47 | # 2.4.0 changes from Meikel 48 | # 49 | # Revision 1.10 2006/05/25 22:30:44 jms 50 | # qgen porting for 32b/64b 51 | # 52 | # Revision 1.9 2006/04/26 23:17:09 jms 53 | # checking release.h prior to release build 54 | # 55 | # Revision 1.8 2006/04/26 23:03:00 jms 56 | # release 2.3.4-1 57 | # 58 | # Revision 1.7 2006/04/12 18:13:58 jms 59 | # release 2.3.3 60 | # 61 | # Revision 1.6 2006/03/09 18:59:19 jms 62 | # move to version 2.3.2 63 | # 64 | # Revision 1.5 2006/01/28 23:54:32 jms 65 | # add reference data to release 66 | # 67 | # Revision 1.4 2005/10/28 03:00:32 jms 68 | # fix release target 69 | # 70 | # Revision 1.3 2005/10/28 02:54:14 jms 71 | # increment build count with each release creation 72 | # 73 | # Revision 1.2 2005/01/03 20:08:58 jms 74 | # change line terminations 75 | # 76 | # Revision 1.1.1.1 2004/11/24 23:31:47 jms 77 | # re-establish external server 78 | # 79 | # Revision 1.5 2004/03/26 20:39:23 jms 80 | # add tpch tag to release files 81 | # 82 | # Revision 1.4 2004/03/16 14:45:57 jms 83 | # correct release target in makefile 84 | # 85 | # Revision 1.3 2004/03/02 20:49:01 jms 86 | # simplify distributions, add Windows IDE files 87 | # releases should use make release from now on 88 | # 89 | # Revision 1.2 2004/02/18 14:05:53 jms 90 | # porting changes for LINUX and 64 bit RNG 91 | # 92 | # Revision 1.1.1.1 2003/04/03 18:54:21 jms 93 | # recreation after CVS crash 94 | # 95 | # Revision 1.1.1.1 2003/04/03 18:54:21 jms 96 | # initial checkin 97 | # 98 | # 99 | # 100 | ################ 101 | ## CHANGE NAME OF ANSI COMPILER HERE 102 | ################ 103 | CC = 104 | # Current values for DATABASE are: INFORMIX, DB2, TDAT (Teradata) 105 | # SQLSERVER, SYBASE, ORACLE 106 | # Current values for MACHINE are: ATT, DOS, HP, IBM, ICL, MVS, 107 | # SGI, SUN, U2200, VMS, LINUX, WIN32 108 | # Current values for WORKLOAD are: TPCH 109 | DATABASE= 110 | MACHINE = 111 | WORKLOAD = 112 | # 113 | CFLAGS = -g -DDBNAME=\"dss\" -D$(MACHINE) -D$(DATABASE) -D$(WORKLOAD) -DRNG_TEST -D_FILE_OFFSET_BITS=64 114 | LDFLAGS = -O 115 | # The OBJ,EXE and LIB macros will need to be changed for compilation under 116 | # Windows NT 117 | OBJ = .o 118 | EXE = 119 | LIBS = -lm 120 | # 121 | # NO CHANGES SHOULD BE NECESSARY BELOW THIS LINE 122 | ############### 123 | VERSION=2 124 | RELEASE=13 125 | PATCH=0 126 | BUILD=`grep BUILD release.h | cut -f3 -d' '` 127 | NEW_BUILD=`expr ${BUILD} + 1` 128 | TREE_ROOT=/tmp/tree 129 | # 130 | PROG1 = dbgen$(EXE) 131 | PROG2 = qgen$(EXE) 132 | PROGS = $(PROG1) $(PROG2) 133 | # 134 | HDR1 = dss.h rnd.h config.h dsstypes.h shared.h bcd2.h rng64.h release.h 135 | HDR2 = tpcd.h permute.h 136 | HDR = $(HDR1) $(HDR2) 137 | # 138 | SRC1 = build.c driver.c bm_utils.c rnd.c print.c load_stub.c bcd2.c \ 139 | speed_seed.c text.c permute.c rng64.c 140 | SRC2 = qgen.c varsub.c 141 | SRC = $(SRC1) $(SRC2) 142 | # 143 | OBJ1 = build$(OBJ) driver$(OBJ) bm_utils$(OBJ) rnd$(OBJ) print$(OBJ) \ 144 | load_stub$(OBJ) bcd2$(OBJ) speed_seed$(OBJ) text$(OBJ) permute$(OBJ) \ 145 | rng64$(OBJ) 146 | OBJ2 = build$(OBJ) bm_utils$(OBJ) qgen$(OBJ) rnd$(OBJ) varsub$(OBJ) \ 147 | text$(OBJ) bcd2$(OBJ) permute$(OBJ) speed_seed$(OBJ) rng64$(OBJ) 148 | OBJS = $(OBJ1) $(OBJ2) 149 | # 150 | SETS = dists.dss 151 | DOC=README HISTORY PORTING.NOTES BUGS 152 | DDL = dss.ddl dss.ri 153 | WINDOWS_IDE = tpch.dsw dbgen.dsp tpch.sln tpch.vcproj qgen.vcproj 154 | OTHER=makefile.suite $(SETS) $(DDL) $(WINDOWS_IDE) 155 | # case is *important* in TEST_RES 156 | TEST_RES = O.res L.res c.res s.res P.res S.res n.res r.res 157 | # 158 | DBGENSRC=$(SRC1) $(HDR1) $(OTHER) $(DOC) $(SRC2) $(HDR2) $(SRC3) 159 | FQD=queries/1.sql queries/2.sql queries/3.sql queries/4.sql queries/5.sql queries/6.sql queries/7.sql \ 160 | queries/8.sql queries/9.sql queries/10.sql queries/11.sql queries/12.sql queries/13.sql \ 161 | queries/14.sql queries/15.sql queries/16.sql queries/17.sql queries/18.sql queries/19.sql queries/20.sql \ 162 | queries/21.sql queries/22.sql 163 | VARIANTS= variants/8a.sql variants/12a.sql variants/13a.sql variants/14a.sql variants/15a.sql 164 | ANS = answers/q1.out answers/q2.out answers/q3.out answers/q4.out answers/q5.out answers/q6.out answers/q7.out answers/q8.out \ 165 | answers/q9.out answers/q10.out answers/q11.out answers/q12.out answers/q13.out answers/q14.out answers/q15.out \ 166 | answers/q16.out answers/q17.out answers/q18.out answers/q19.out answers/q20.out answers/q21.out answers/q22.out 167 | QSRC = $(FQD) $(VARIANTS) $(ANS) 168 | TREE_DOC=tree.readme tree.changes appendix.readme appendix.version answers.readme queries.readme variants.readme 169 | REFERENCE=reference/[tcR]* 170 | REFERENCE_DATA=referenceData/[13]* 171 | SCRIPTS= check55.sh column_split.sh dop.sh gen_tasks.sh last_row.sh load_balance.sh new55.sh check_dirs.sh 172 | ALLSRC=$(DBGENSRC) $(REFERENCE) $(QSRC) $(SCRIPTS) 173 | JUNK = 174 | # 175 | all: $(PROGS) 176 | $(PROG1): $(OBJ1) $(SETS) 177 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ1) $(LIBS) 178 | $(PROG2): permute.h $(OBJ2) 179 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ2) $(LIBS) 180 | clean: 181 | rm -f $(PROGS) $(OBJS) $(JUNK) 182 | lint: 183 | lint $(CFLAGS) -u -x -wO -Ma -p $(SRC1) 184 | lint $(CFLAGS) -u -x -wO -Ma -p $(SRC2) 185 | 186 | tar: $(ALLSRC) 187 | tar cvhf - $(ALLSRC) --exclude .svn\*/\* |gzip - > tpch_${VERSION}_${RELEASE}_${PATCH}.tar.gz 188 | tar cvhf - $(REFERENCE_DATA) --exclude .svn\*/\* |gzip - > reference_${VERSION}_${RELEASE}_${PATCH}.tar.gz 189 | zip: $(ALLSRC) 190 | zip -r tpch_${VERSION}_${RELEASE}_${PATCH}.zip $(ALLSRC) -x *.svn* 191 | zip -r reference_${VERSION}_${RELEASE}_${PATCH}.zip $(REFERENCE_DATA) -x *.svn* 192 | release: 193 | make -f makefile.suite tar 194 | make -f makefile.suite zip 195 | ( cd tests; sh test_list.sh `date '+%Y%m%d'` ) 196 | rnd$(OBJ): rnd.h 197 | $(OBJ1): $(HDR1) 198 | $(OBJ2): dss.h tpcd.h config.h rng64.h release.h 199 | -------------------------------------------------------------------------------- /permute.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: permute.c,v 1.3 2007/01/04 21:29:21 jms Exp $ 3 | * 4 | * Revision History 5 | * =================== 6 | * $Log: permute.c,v $ 7 | * Revision 1.3 2007/01/04 21:29:21 jms 8 | * Porting changes uncovered as part of move to VS2005. No impact on data set 9 | * 10 | * Revision 1.2 2005/01/03 20:08:59 jms 11 | * change line terminations 12 | * 13 | * Revision 1.1.1.1 2004/11/24 23:31:47 jms 14 | * re-establish external server 15 | * 16 | * Revision 1.1.1.1 2003/08/07 17:58:34 jms 17 | * recreation after CVS crash 18 | * 19 | * Revision 1.2 2003/08/07 17:58:34 jms 20 | * Convery RNG to 64bit space as preparation for new large scale RNG 21 | * 22 | * Revision 1.1.1.1 2003/04/03 18:54:21 jms 23 | * initial checkin 24 | * 25 | * 26 | */ 27 | /* 28 | * permute.c -- a permutation generator for the query 29 | * sequences in TPC-H and TPC-R 30 | */ 31 | 32 | #ifdef TEST 33 | #define DECLARER 34 | #endif 35 | #include "config.h" 36 | #include "dss.h" 37 | #ifdef TEST 38 | #include 39 | #if (defined(_POSIX_)||!defined(WIN32)) /* Change for Windows NT */ 40 | #include 41 | #include 42 | #endif /* WIN32 */ 43 | #include /* */ 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | #ifdef HP 51 | #include 52 | #endif 53 | #if (defined(WIN32)&&!defined(_POSIX_)) 54 | #include 55 | #pragma warning(disable:4201) 56 | #pragma warning(disable:4214) 57 | #pragma warning(disable:4514) 58 | #define WIN32_LEAN_AND_MEAN 59 | #define NOATOM 60 | #define NOGDICAPMASKS 61 | #define NOMETAFILE 62 | #define NOMINMAX 63 | #define NOMSG 64 | #define NOOPENFILE 65 | #define NORASTEROPS 66 | #define NOSCROLL 67 | #define NOSOUND 68 | #define NOSYSMETRICS 69 | #define NOTEXTMETRIC 70 | #define NOWH 71 | #define NOCOMM 72 | #define NOKANJI 73 | #define NOMCX 74 | #include 75 | #pragma warning(default:4201) 76 | #pragma warning(default:4214) 77 | #endif 78 | #endif 79 | 80 | DSS_HUGE NextRand(DSS_HUGE seed); 81 | void permute(long *set, int cnt, long stream); 82 | void permute_dist(distribution *d, long stream); 83 | long seed; 84 | char *eol[2] = {" ", "},"}; 85 | extern seed_t Seed[]; 86 | #ifdef TEST 87 | tdef tdefs = { NULL }; 88 | #endif 89 | 90 | 91 | #define MAX_QUERY 22 92 | #define ITERATIONS 1000 93 | #define UNSET 0 94 | 95 | void permute(long *a, int c, long s) 96 | { 97 | int i; 98 | static DSS_HUGE source; 99 | static long *set, temp; 100 | 101 | if (a != (long *)NULL) 102 | { 103 | for (i=0; i < c; i++) 104 | { 105 | RANDOM(source, (long)i, (long)(c - 1), s); 106 | temp = *(a + source); 107 | *(a + source) = *(a + i) ; 108 | *(a + i) = temp; 109 | } 110 | } 111 | 112 | return; 113 | } 114 | 115 | void permute_dist(distribution *d, long stream) 116 | { 117 | static distribution *dist = NULL; 118 | int i; 119 | 120 | if (d != NULL) 121 | { 122 | if (d->permute == (long *)NULL) 123 | { 124 | d->permute = (long *)malloc(sizeof(long) * DIST_SIZE(d)); 125 | MALLOC_CHECK(d->permute); 126 | } 127 | for (i=0; i < DIST_SIZE(d); i++) 128 | *(d->permute + i) = i; 129 | permute(d->permute, DIST_SIZE(d), stream); 130 | } 131 | else 132 | INTERNAL_ERROR("Bad call to permute_dist"); 133 | 134 | return; 135 | } 136 | 137 | 138 | #ifdef TEST 139 | 140 | main(int ac, char *av[]) 141 | { 142 | long *sequence, 143 | i, 144 | j, 145 | streams = UNSET, 146 | *a; 147 | char sep; 148 | int index = 0; 149 | 150 | set_seeds = 0; 151 | sequence = (long *)malloc(MAX_QUERY * sizeof(long)); 152 | a = sequence; 153 | for (i=0; i < MAX_QUERY; i++) 154 | *(sequence + i) = i; 155 | if (ac < 3) 156 | goto usage; 157 | Seed[0].value = (long)atoi(av[1]); 158 | streams = atoi(av[2]); 159 | if (Seed[0].value == UNSET || streams == UNSET) 160 | goto usage; 161 | 162 | index = 0; 163 | printf("long permutation[%d][%d] = {\n", streams, MAX_QUERY); 164 | for (j=0; j < streams; j++) 165 | { 166 | sep = '{'; 167 | printf("%s\n", eol[index]); 168 | for (i=0; i < MAX_QUERY; i++) 169 | { 170 | printf("%c%2d", sep, *permute(a, MAX_QUERY, 0) + 1); 171 | a = (long *)NULL; 172 | sep = ','; 173 | } 174 | a = sequence; 175 | index=1; 176 | } 177 | printf("}\n};\n"); 178 | return(0); 179 | 180 | usage: 181 | printf("Usage: %s \n",av[0]); 182 | printf(" uses to start the generation of permutations of [1..%d]\n", MAX_QUERY); 183 | return(-1); 184 | 185 | } 186 | #endif /* TEST */ 187 | -------------------------------------------------------------------------------- /permute.h: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: permute.h,v 1.2 2005/01/03 20:08:59 jms Exp $ 3 | * 4 | * Revision History 5 | * =================== 6 | * $Log: permute.h,v $ 7 | * Revision 1.2 2005/01/03 20:08:59 jms 8 | * change line terminations 9 | * 10 | * Revision 1.1.1.1 2004/11/24 23:31:47 jms 11 | * re-establish external server 12 | * 13 | * Revision 1.1.1.1 2003/04/03 18:54:21 jms 14 | * recreation after CVS crash 15 | * 16 | * Revision 1.1.1.1 2003/04/03 18:54:21 jms 17 | * initial checkin 18 | * 19 | * 20 | */ 21 | long permutation[41][22] = 22 | { 23 | {14, 2, 9,20, 6,17,18, 8,21,13, 3,22,16, 4,11,15, 1,10,19, 5, 7,12}, 24 | {21, 3,18, 5,11, 7, 6,20,17,12,16,15,13,10, 2, 8,14,19, 9,22, 1, 4}, 25 | { 6,17,14,16,19,10, 9, 2,15, 8, 5,22,12, 7,13,18, 1, 4,20, 3,11,21}, 26 | { 8, 5, 4, 6,17, 7, 1,18,22,14, 9,10,15,11,20, 2,21,19,13,16,12, 3}, 27 | { 5,21,14,19,15,17,12, 6, 4, 9, 8,16,11, 2,10,18, 1,13, 7,22, 3,20}, 28 | {21,15, 4, 6, 7,16,19,18,14,22,11,13, 3, 1, 2, 5, 8,20,12,17,10, 9}, 29 | {10, 3,15,13, 6, 8, 9, 7, 4,11,22,18,12, 1, 5,16, 2,14,19,20,17,21}, 30 | {18, 8,20,21, 2, 4,22,17, 1,11, 9,19, 3,13, 5, 7,10,16, 6,14,15,12}, 31 | {19, 1,15,17, 5, 8, 9,12,14, 7, 4, 3,20,16, 6,22,10,13, 2,21,18,11}, 32 | { 8,13, 2,20,17, 3, 6,21,18,11,19,10,15, 4,22, 1, 7,12, 9,14, 5,16}, 33 | { 6,15,18,17,12, 1, 7, 2,22,13,21,10,14, 9, 3,16,20,19,11, 4, 8, 5}, 34 | {15,14,18,17,10,20,16,11, 1, 8, 4,22, 5,12, 3, 9,21, 2,13, 6,19, 7}, 35 | { 1, 7,16,17,18,22,12, 6, 8, 9,11, 4, 2, 5,20,21,13,10,19, 3,14,15}, 36 | {21,17, 7, 3, 1,10,12,22, 9,16, 6,11, 2, 4, 5,14, 8,20,13,18,15,19}, 37 | { 2, 9, 5, 4,18, 1,20,15,16,17, 7,21,13,14,19, 8,22,11,10, 3,12, 6}, 38 | {16, 9,17, 8,14,11,10,12, 6,21, 7, 3,15, 5,22,20, 1,13,19, 2, 4,18}, 39 | { 1, 3, 6, 5, 2,16,14,22,17,20, 4, 9,10,11,15, 8,12,19,18,13, 7,21}, 40 | { 3,16, 5,11,21, 9, 2,15,10,18,17, 7, 8,19,14,13, 1, 4,22,20, 6,12}, 41 | {14, 4,13, 5,21,11, 8, 6, 3,17, 2,20, 1,19,10, 9,12,18,15, 7,22,16}, 42 | { 4,12,22,14, 5,15,16, 2, 8,10,17, 9,21, 7, 3, 6,13,18,11,20,19, 1}, 43 | {16,15,14,13, 4,22,18,19, 7, 1,12,17, 5,10,20, 3, 9,21,11, 2, 6, 8}, 44 | {20,14,21,12,15,17, 4,19,13,10,11, 1,16, 5,18, 7, 8,22, 9, 6, 3, 2}, 45 | {16,14,13, 2,21,10,11, 4, 1,22,18,12,19, 5, 7, 8, 6, 3,15,20, 9,17}, 46 | {18,15, 9,14,12, 2, 8,11,22,21,16, 1, 6,17, 5,10,19, 4,20,13, 3, 7}, 47 | { 7, 3,10,14,13,21,18, 6,20, 4, 9, 8,22,15, 2, 1, 5,12,19,17,11,16}, 48 | {18, 1,13, 7,16,10,14, 2,19, 5,21,11,22,15, 8,17,20, 3, 4,12, 6, 9}, 49 | {13, 2,22, 5,11,21,20,14, 7,10, 4, 9,19,18, 6, 3, 1, 8,15,12,17,16}, 50 | {14,17,21, 8, 2, 9, 6, 4, 5,13,22, 7,15, 3, 1,18,16,11,10,12,20,19}, 51 | {10,22, 1,12,13,18,21,20, 2,14,16, 7,15, 3, 4,17, 5,19, 6, 8, 9,11}, 52 | {10, 8, 9,18,12, 6, 1, 5,20,11,17,22,16, 3,13, 2,15,21,14,19, 7, 4}, 53 | { 7,17,22, 5, 3,10,13,18, 9, 1,14,15,21,19,16,12, 8, 6,11,20, 4, 2}, 54 | { 2, 9,21, 3, 4, 7, 1,11,16, 5,20,19,18, 8,17,13,10,12,15, 6,14,22}, 55 | {15,12, 8, 4,22,13,16,17,18, 3, 7, 5, 6, 1, 9,11,21,10,14,20,19, 2}, 56 | {15,16, 2,11,17, 7, 5,14,20, 4,21, 3,10, 9,12, 8,13, 6,18,19,22, 1}, 57 | { 1,13,11, 3, 4,21, 6,14,15,22,18, 9, 7, 5,10,20,12,16,17, 8,19, 2}, 58 | {14,17,22,20, 8,16, 5,10, 1,13, 2,21,12, 9, 4,18, 3, 7, 6,19,15,11}, 59 | { 9,17, 7, 4, 5,13,21,18,11, 3,22, 1, 6,16,20,14,15,10, 8, 2,12,19}, 60 | {13,14, 5,22,19,11, 9, 6,18,15, 8,10, 7, 4,17,16, 3, 1,12, 2,21,20}, 61 | {20, 5, 4,14,11, 1, 6,16, 8,22, 7, 3, 2,12,21,19,17,13,10,15,18, 9}, 62 | { 3, 7,14,15, 6, 5,21,20,18,10, 4,16,19, 1,13, 9, 8,17,11,12,22, 2}, 63 | {13,15,17, 1,22,11, 3, 4, 7,20,14,21, 9, 8, 2,18,16, 6,10,12, 5,19} 64 | }; 65 | -------------------------------------------------------------------------------- /qgen.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 13 | 14 | 15 | 16 | 17 | 24 | 27 | 30 | 33 | 36 | 39 | 50 | 53 | 56 | 59 | 64 | 67 | 70 | 73 | 76 | 79 | 82 | 85 | 88 | 89 | 97 | 100 | 103 | 106 | 109 | 112 | 119 | 122 | 125 | 128 | 135 | 138 | 141 | 144 | 147 | 150 | 153 | 156 | 159 | 160 | 161 | 162 | 163 | 164 | 169 | 172 | 173 | 176 | 177 | 180 | 181 | 184 | 185 | 188 | 189 | 192 | 193 | 196 | 197 | 200 | 201 | 204 | 205 | 208 | 209 | 210 | 215 | 218 | 219 | 222 | 223 | 226 | 227 | 230 | 231 | 234 | 235 | 238 | 239 | 242 | 243 | 246 | 247 | 250 | 251 | 254 | 255 | 256 | 261 | 262 | 263 | 264 | 265 | 266 | -------------------------------------------------------------------------------- /queries/1.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Pricing Summary Report Query (Q1) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | l_returnflag, 9 | l_linestatus, 10 | sum(l_quantity) as sum_qty, 11 | sum(l_extendedprice) as sum_base_price, 12 | sum(l_extendedprice * (1 - l_discount)) as sum_disc_price, 13 | sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as sum_charge, 14 | avg(l_quantity) as avg_qty, 15 | avg(l_extendedprice) as avg_price, 16 | avg(l_discount) as avg_disc, 17 | count(*) as count_order 18 | from 19 | lineitem 20 | where 21 | l_shipdate <= date '1998-12-01' - interval ':1' day (3) 22 | group by 23 | l_returnflag, 24 | l_linestatus 25 | order by 26 | l_returnflag, 27 | l_linestatus; 28 | :n -1 29 | -------------------------------------------------------------------------------- /queries/10.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Returned Item Reporting Query (Q10) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | c_custkey, 9 | c_name, 10 | sum(l_extendedprice * (1 - l_discount)) as revenue, 11 | c_acctbal, 12 | n_name, 13 | c_address, 14 | c_phone, 15 | c_comment 16 | from 17 | customer, 18 | orders, 19 | lineitem, 20 | nation 21 | where 22 | c_custkey = o_custkey 23 | and l_orderkey = o_orderkey 24 | and o_orderdate >= date ':1' 25 | and o_orderdate < date ':1' + interval '3' month 26 | and l_returnflag = 'R' 27 | and c_nationkey = n_nationkey 28 | group by 29 | c_custkey, 30 | c_name, 31 | c_acctbal, 32 | c_phone, 33 | n_name, 34 | c_address, 35 | c_comment 36 | order by 37 | revenue desc; 38 | :n 20 39 | -------------------------------------------------------------------------------- /queries/11.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Important Stock Identification Query (Q11) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | ps_partkey, 9 | sum(ps_supplycost * ps_availqty) as value 10 | from 11 | partsupp, 12 | supplier, 13 | nation 14 | where 15 | ps_suppkey = s_suppkey 16 | and s_nationkey = n_nationkey 17 | and n_name = ':1' 18 | group by 19 | ps_partkey having 20 | sum(ps_supplycost * ps_availqty) > ( 21 | select 22 | sum(ps_supplycost * ps_availqty) * :2 23 | from 24 | partsupp, 25 | supplier, 26 | nation 27 | where 28 | ps_suppkey = s_suppkey 29 | and s_nationkey = n_nationkey 30 | and n_name = ':1' 31 | ) 32 | order by 33 | value desc; 34 | :n -1 35 | -------------------------------------------------------------------------------- /queries/12.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Shipping Modes and Order Priority Query (Q12) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | l_shipmode, 9 | sum(case 10 | when o_orderpriority = '1-URGENT' 11 | or o_orderpriority = '2-HIGH' 12 | then 1 13 | else 0 14 | end) as high_line_count, 15 | sum(case 16 | when o_orderpriority <> '1-URGENT' 17 | and o_orderpriority <> '2-HIGH' 18 | then 1 19 | else 0 20 | end) as low_line_count 21 | from 22 | orders, 23 | lineitem 24 | where 25 | o_orderkey = l_orderkey 26 | and l_shipmode in (':1', ':2') 27 | and l_commitdate < l_receiptdate 28 | and l_shipdate < l_commitdate 29 | and l_receiptdate >= date ':3' 30 | and l_receiptdate < date ':3' + interval '1' year 31 | group by 32 | l_shipmode 33 | order by 34 | l_shipmode; 35 | :n -1 36 | -------------------------------------------------------------------------------- /queries/13.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Customer Distribution Query (Q13) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | c_count, 9 | count(*) as custdist 10 | from 11 | ( 12 | select 13 | c_custkey, 14 | count(o_orderkey) 15 | from 16 | customer left outer join orders on 17 | c_custkey = o_custkey 18 | and o_comment not like '%:1%:2%' 19 | group by 20 | c_custkey 21 | ) as c_orders (c_custkey, c_count) 22 | group by 23 | c_count 24 | order by 25 | custdist desc, 26 | c_count desc; 27 | :n -1 28 | -------------------------------------------------------------------------------- /queries/14.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Promotion Effect Query (Q14) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | 100.00 * sum(case 9 | when p_type like 'PROMO%' 10 | then l_extendedprice * (1 - l_discount) 11 | else 0 12 | end) / sum(l_extendedprice * (1 - l_discount)) as promo_revenue 13 | from 14 | lineitem, 15 | part 16 | where 17 | l_partkey = p_partkey 18 | and l_shipdate >= date ':1' 19 | and l_shipdate < date ':1' + interval '1' month; 20 | :n -1 21 | -------------------------------------------------------------------------------- /queries/15.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Top Supplier Query (Q15) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | create view revenue:s (supplier_no, total_revenue) as 7 | select 8 | l_suppkey, 9 | sum(l_extendedprice * (1 - l_discount)) 10 | from 11 | lineitem 12 | where 13 | l_shipdate >= date ':1' 14 | and l_shipdate < date ':1' + interval '3' month 15 | group by 16 | l_suppkey; 17 | 18 | :o 19 | select 20 | s_suppkey, 21 | s_name, 22 | s_address, 23 | s_phone, 24 | total_revenue 25 | from 26 | supplier, 27 | revenue:s 28 | where 29 | s_suppkey = supplier_no 30 | and total_revenue = ( 31 | select 32 | max(total_revenue) 33 | from 34 | revenue:s 35 | ) 36 | order by 37 | s_suppkey; 38 | 39 | drop view revenue:s; 40 | :n -1 41 | -------------------------------------------------------------------------------- /queries/16.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Parts/Supplier Relationship Query (Q16) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | p_brand, 9 | p_type, 10 | p_size, 11 | count(distinct ps_suppkey) as supplier_cnt 12 | from 13 | partsupp, 14 | part 15 | where 16 | p_partkey = ps_partkey 17 | and p_brand <> ':1' 18 | and p_type not like ':2%' 19 | and p_size in (:3, :4, :5, :6, :7, :8, :9, :10) 20 | and ps_suppkey not in ( 21 | select 22 | s_suppkey 23 | from 24 | supplier 25 | where 26 | s_comment like '%Customer%Complaints%' 27 | ) 28 | group by 29 | p_brand, 30 | p_type, 31 | p_size 32 | order by 33 | supplier_cnt desc, 34 | p_brand, 35 | p_type, 36 | p_size; 37 | :n -1 38 | -------------------------------------------------------------------------------- /queries/17.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Small-Quantity-Order Revenue Query (Q17) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | sum(l_extendedprice) / 7.0 as avg_yearly 9 | from 10 | lineitem, 11 | part 12 | where 13 | p_partkey = l_partkey 14 | and p_brand = ':1' 15 | and p_container = ':2' 16 | and l_quantity < ( 17 | select 18 | 0.2 * avg(l_quantity) 19 | from 20 | lineitem 21 | where 22 | l_partkey = p_partkey 23 | ); 24 | :n -1 25 | -------------------------------------------------------------------------------- /queries/18.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Large Volume Customer Query (Q18) 3 | -- Function Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | c_name, 9 | c_custkey, 10 | o_orderkey, 11 | o_orderdate, 12 | o_totalprice, 13 | sum(l_quantity) 14 | from 15 | customer, 16 | orders, 17 | lineitem 18 | where 19 | o_orderkey in ( 20 | select 21 | l_orderkey 22 | from 23 | lineitem 24 | group by 25 | l_orderkey having 26 | sum(l_quantity) > :1 27 | ) 28 | and c_custkey = o_custkey 29 | and o_orderkey = l_orderkey 30 | group by 31 | c_name, 32 | c_custkey, 33 | o_orderkey, 34 | o_orderdate, 35 | o_totalprice 36 | order by 37 | o_totalprice desc, 38 | o_orderdate; 39 | :n 100 40 | -------------------------------------------------------------------------------- /queries/19.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Discounted Revenue Query (Q19) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | sum(l_extendedprice* (1 - l_discount)) as revenue 9 | from 10 | lineitem, 11 | part 12 | where 13 | ( 14 | p_partkey = l_partkey 15 | and p_brand = ':1' 16 | and p_container in ('SM CASE', 'SM BOX', 'SM PACK', 'SM PKG') 17 | and l_quantity >= :4 and l_quantity <= :4 + 10 18 | and p_size between 1 and 5 19 | and l_shipmode in ('AIR', 'AIR REG') 20 | and l_shipinstruct = 'DELIVER IN PERSON' 21 | ) 22 | or 23 | ( 24 | p_partkey = l_partkey 25 | and p_brand = ':2' 26 | and p_container in ('MED BAG', 'MED BOX', 'MED PKG', 'MED PACK') 27 | and l_quantity >= :5 and l_quantity <= :5 + 10 28 | and p_size between 1 and 10 29 | and l_shipmode in ('AIR', 'AIR REG') 30 | and l_shipinstruct = 'DELIVER IN PERSON' 31 | ) 32 | or 33 | ( 34 | p_partkey = l_partkey 35 | and p_brand = ':3' 36 | and p_container in ('LG CASE', 'LG BOX', 'LG PACK', 'LG PKG') 37 | and l_quantity >= :6 and l_quantity <= :6 + 10 38 | and p_size between 1 and 15 39 | and l_shipmode in ('AIR', 'AIR REG') 40 | and l_shipinstruct = 'DELIVER IN PERSON' 41 | ); 42 | :n -1 43 | -------------------------------------------------------------------------------- /queries/2.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Minimum Cost Supplier Query (Q2) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | s_acctbal, 9 | s_name, 10 | n_name, 11 | p_partkey, 12 | p_mfgr, 13 | s_address, 14 | s_phone, 15 | s_comment 16 | from 17 | part, 18 | supplier, 19 | partsupp, 20 | nation, 21 | region 22 | where 23 | p_partkey = ps_partkey 24 | and s_suppkey = ps_suppkey 25 | and p_size = :1 26 | and p_type like '%:2' 27 | and s_nationkey = n_nationkey 28 | and n_regionkey = r_regionkey 29 | and r_name = ':3' 30 | and ps_supplycost = ( 31 | select 32 | min(ps_supplycost) 33 | from 34 | partsupp, 35 | supplier, 36 | nation, 37 | region 38 | where 39 | p_partkey = ps_partkey 40 | and s_suppkey = ps_suppkey 41 | and s_nationkey = n_nationkey 42 | and n_regionkey = r_regionkey 43 | and r_name = ':3' 44 | ) 45 | order by 46 | s_acctbal desc, 47 | n_name, 48 | s_name, 49 | p_partkey; 50 | :n 100 51 | -------------------------------------------------------------------------------- /queries/20.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Potential Part Promotion Query (Q20) 3 | -- Function Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | s_name, 9 | s_address 10 | from 11 | supplier, 12 | nation 13 | where 14 | s_suppkey in ( 15 | select 16 | ps_suppkey 17 | from 18 | partsupp 19 | where 20 | ps_partkey in ( 21 | select 22 | p_partkey 23 | from 24 | part 25 | where 26 | p_name like ':1%' 27 | ) 28 | and ps_availqty > ( 29 | select 30 | 0.5 * sum(l_quantity) 31 | from 32 | lineitem 33 | where 34 | l_partkey = ps_partkey 35 | and l_suppkey = ps_suppkey 36 | and l_shipdate >= date ':2' 37 | and l_shipdate < date ':2' + interval '1' year 38 | ) 39 | ) 40 | and s_nationkey = n_nationkey 41 | and n_name = ':3' 42 | order by 43 | s_name; 44 | :n -1 45 | -------------------------------------------------------------------------------- /queries/21.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Suppliers Who Kept Orders Waiting Query (Q21) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | s_name, 9 | count(*) as numwait 10 | from 11 | supplier, 12 | lineitem l1, 13 | orders, 14 | nation 15 | where 16 | s_suppkey = l1.l_suppkey 17 | and o_orderkey = l1.l_orderkey 18 | and o_orderstatus = 'F' 19 | and l1.l_receiptdate > l1.l_commitdate 20 | and exists ( 21 | select 22 | * 23 | from 24 | lineitem l2 25 | where 26 | l2.l_orderkey = l1.l_orderkey 27 | and l2.l_suppkey <> l1.l_suppkey 28 | ) 29 | and not exists ( 30 | select 31 | * 32 | from 33 | lineitem l3 34 | where 35 | l3.l_orderkey = l1.l_orderkey 36 | and l3.l_suppkey <> l1.l_suppkey 37 | and l3.l_receiptdate > l3.l_commitdate 38 | ) 39 | and s_nationkey = n_nationkey 40 | and n_name = ':1' 41 | group by 42 | s_name 43 | order by 44 | numwait desc, 45 | s_name; 46 | :n 100 47 | -------------------------------------------------------------------------------- /queries/22.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Global Sales Opportunity Query (Q22) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | cntrycode, 9 | count(*) as numcust, 10 | sum(c_acctbal) as totacctbal 11 | from 12 | ( 13 | select 14 | substring(c_phone from 1 for 2) as cntrycode, 15 | c_acctbal 16 | from 17 | customer 18 | where 19 | substring(c_phone from 1 for 2) in 20 | (':1', ':2', ':3', ':4', ':5', ':6', ':7') 21 | and c_acctbal > ( 22 | select 23 | avg(c_acctbal) 24 | from 25 | customer 26 | where 27 | c_acctbal > 0.00 28 | and substring(c_phone from 1 for 2) in 29 | (':1', ':2', ':3', ':4', ':5', ':6', ':7') 30 | ) 31 | and not exists ( 32 | select 33 | * 34 | from 35 | orders 36 | where 37 | o_custkey = c_custkey 38 | ) 39 | ) as custsale 40 | group by 41 | cntrycode 42 | order by 43 | cntrycode; 44 | :n -1 45 | -------------------------------------------------------------------------------- /queries/3.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Shipping Priority Query (Q3) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | l_orderkey, 9 | sum(l_extendedprice * (1 - l_discount)) as revenue, 10 | o_orderdate, 11 | o_shippriority 12 | from 13 | customer, 14 | orders, 15 | lineitem 16 | where 17 | c_mktsegment = ':1' 18 | and c_custkey = o_custkey 19 | and l_orderkey = o_orderkey 20 | and o_orderdate < date ':2' 21 | and l_shipdate > date ':2' 22 | group by 23 | l_orderkey, 24 | o_orderdate, 25 | o_shippriority 26 | order by 27 | revenue desc, 28 | o_orderdate; 29 | :n 10 30 | -------------------------------------------------------------------------------- /queries/4.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Order Priority Checking Query (Q4) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | o_orderpriority, 9 | count(*) as order_count 10 | from 11 | orders 12 | where 13 | o_orderdate >= date ':1' 14 | and o_orderdate < date ':1' + interval '3' month 15 | and exists ( 16 | select 17 | * 18 | from 19 | lineitem 20 | where 21 | l_orderkey = o_orderkey 22 | and l_commitdate < l_receiptdate 23 | ) 24 | group by 25 | o_orderpriority 26 | order by 27 | o_orderpriority; 28 | :n -1 29 | -------------------------------------------------------------------------------- /queries/5.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Local Supplier Volume Query (Q5) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | n_name, 9 | sum(l_extendedprice * (1 - l_discount)) as revenue 10 | from 11 | customer, 12 | orders, 13 | lineitem, 14 | supplier, 15 | nation, 16 | region 17 | where 18 | c_custkey = o_custkey 19 | and l_orderkey = o_orderkey 20 | and l_suppkey = s_suppkey 21 | and c_nationkey = s_nationkey 22 | and s_nationkey = n_nationkey 23 | and n_regionkey = r_regionkey 24 | and r_name = ':1' 25 | and o_orderdate >= date ':2' 26 | and o_orderdate < date ':2' + interval '1' year 27 | group by 28 | n_name 29 | order by 30 | revenue desc; 31 | :n -1 32 | -------------------------------------------------------------------------------- /queries/6.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Forecasting Revenue Change Query (Q6) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | sum(l_extendedprice * l_discount) as revenue 9 | from 10 | lineitem 11 | where 12 | l_shipdate >= date ':1' 13 | and l_shipdate < date ':1' + interval '1' year 14 | and l_discount between :2 - 0.01 and :2 + 0.01 15 | and l_quantity < :3; 16 | :n -1 17 | -------------------------------------------------------------------------------- /queries/7.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Volume Shipping Query (Q7) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | supp_nation, 9 | cust_nation, 10 | l_year, 11 | sum(volume) as revenue 12 | from 13 | ( 14 | select 15 | n1.n_name as supp_nation, 16 | n2.n_name as cust_nation, 17 | extract(year from l_shipdate) as l_year, 18 | l_extendedprice * (1 - l_discount) as volume 19 | from 20 | supplier, 21 | lineitem, 22 | orders, 23 | customer, 24 | nation n1, 25 | nation n2 26 | where 27 | s_suppkey = l_suppkey 28 | and o_orderkey = l_orderkey 29 | and c_custkey = o_custkey 30 | and s_nationkey = n1.n_nationkey 31 | and c_nationkey = n2.n_nationkey 32 | and ( 33 | (n1.n_name = ':1' and n2.n_name = ':2') 34 | or (n1.n_name = ':2' and n2.n_name = ':1') 35 | ) 36 | and l_shipdate between date '1995-01-01' and date '1996-12-31' 37 | ) as shipping 38 | group by 39 | supp_nation, 40 | cust_nation, 41 | l_year 42 | order by 43 | supp_nation, 44 | cust_nation, 45 | l_year; 46 | :n -1 47 | -------------------------------------------------------------------------------- /queries/8.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R National Market Share Query (Q8) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | o_year, 9 | sum(case 10 | when nation = ':1' then volume 11 | else 0 12 | end) / sum(volume) as mkt_share 13 | from 14 | ( 15 | select 16 | extract(year from o_orderdate) as o_year, 17 | l_extendedprice * (1 - l_discount) as volume, 18 | n2.n_name as nation 19 | from 20 | part, 21 | supplier, 22 | lineitem, 23 | orders, 24 | customer, 25 | nation n1, 26 | nation n2, 27 | region 28 | where 29 | p_partkey = l_partkey 30 | and s_suppkey = l_suppkey 31 | and l_orderkey = o_orderkey 32 | and o_custkey = c_custkey 33 | and c_nationkey = n1.n_nationkey 34 | and n1.n_regionkey = r_regionkey 35 | and r_name = ':2' 36 | and s_nationkey = n2.n_nationkey 37 | and o_orderdate between date '1995-01-01' and date '1996-12-31' 38 | and p_type = ':3' 39 | ) as all_nations 40 | group by 41 | o_year 42 | order by 43 | o_year; 44 | :n -1 45 | -------------------------------------------------------------------------------- /queries/9.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Product Type Profit Measure Query (Q9) 3 | -- Functional Query Definition 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | nation, 9 | o_year, 10 | sum(amount) as sum_profit 11 | from 12 | ( 13 | select 14 | n_name as nation, 15 | extract(year from o_orderdate) as o_year, 16 | l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity as amount 17 | from 18 | part, 19 | supplier, 20 | lineitem, 21 | partsupp, 22 | orders, 23 | nation 24 | where 25 | s_suppkey = l_suppkey 26 | and ps_suppkey = l_suppkey 27 | and ps_partkey = l_partkey 28 | and p_partkey = l_partkey 29 | and o_orderkey = l_orderkey 30 | and s_nationkey = n_nationkey 31 | and p_name like '%:1%' 32 | ) as profit 33 | group by 34 | nation, 35 | o_year 36 | order by 37 | nation, 38 | o_year desc; 39 | :n -1 40 | -------------------------------------------------------------------------------- /reference/README.txt: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: README.txt,v 1.4 2006/08/07 17:36:46 jms Exp $ 3 | */ 4 | 5 | 1. Goal 6 | This document summarizes the steps required to validate the data set generated 7 | by DBGEN, relative to the reference data published by the TPC. 8 | 9 | 2. Pre-Requesites 10 | Toolset executable: This readme file is included as part of the toolset 11 | distributed by the TPC. The DBGEN and QGEN executables must be built from 12 | the same distribution. 13 | 14 | Reference Data Set(s): For each permissible scale factor, the TPC has 15 | produced a separate zip file that defines the reference point for the base 16 | data set, the update data set, and the output of QGEN. These must be 17 | downloaded separately from the TPC web site. 18 | 19 | 3. Validation Process 20 | 21 | a. Setup 22 | The commands that are included in this distribution assume that they are 23 | being executed from /reference, where is directory into which 24 | the DBGEN distribution was unpacked. If that is not the case for your 25 | environemnt, the paths to executables and associated files will need to be 26 | edited to match your directory structure. 27 | 28 | b. Base Data Validation 29 | The base data set is produced using cmd_base_sf where is the scale 30 | factor to be generated. The resulting files will be produced in the current 31 | working directory. The generated files will be of the form .tbl., 32 | where will is the name of one of the tables in the TPCH schema, and 33 | identifies a particular data generation step. 34 | 35 | The file set produced by genbaserefdata.sh should match the .tbl. 36 | files found in the reference data set for the same scale factor. 37 | 38 | c. Update Data Validation 39 | The update data set is produced using cmd_update_sf where is the scale 40 | factor to be generated. The resulting files will be produced in the current 41 | working directory. The generated files will be of the form 42 | .tbl.u. and delete.u., where will is the 43 | name of one of the tables in the TPCH schema, and and identify 44 | a particular data generation step. 45 | 46 | For each file produced by DBGEN, the first 100 lines of the file should 47 | match the delete.tbl.u. and .tbl.u. files found in the 48 | reference data set. Where the files from the reference data set contain 49 | fewer than 100 lines, the file should match in their entriety. 50 | 51 | d. QGEN Parameter Generation 52 | The qgen paramter sets are produced using the cmd_qgen_sf files, where 53 | matches the scale factor being validated. The resulting files will 54 | be produced in the current working directory. The generated files will be of 55 | the form subparam_, where identifies a particular qgen subsituttion 56 | set. 57 | 58 | The file set produced by cmd_qgen_ script should match the subparam. 59 | files found in the reference data set. 60 | 61 | /********************* 62 | * Revision History 63 | * =================== 64 | * $Log: README.txt,v $ 65 | * Revision 1.4 2006/08/07 17:36:46 jms 66 | * typo corrections 67 | * 68 | * Revision 1.3 2006/03/30 22:12:36 jms 69 | * reduce to simple scripts 70 | * 71 | -------------------------------------------------------------------------------- /reference/cmd_base_sf1: -------------------------------------------------------------------------------- 1 | ../dbgen -s 1 -T L -C 60000 -S 1 -f -b ../dists.dss 2 | ../dbgen -s 1 -T L -C 60000 -S 19999 -f -b ../dists.dss 3 | ../dbgen -s 1 -T L -C 60000 -S 39998 -f -b ../dists.dss 4 | ../dbgen -s 1 -T L -C 60000 -S 59997 -f -b ../dists.dss 5 | ../dbgen -s 1 -T L -C 60000 -S 60000 -f -b ../dists.dss 6 | ../dbgen -s 1 -T O -C 15000 -S 1 -f -b ../dists.dss 7 | ../dbgen -s 1 -T O -C 15000 -S 4999 -f -b ../dists.dss 8 | ../dbgen -s 1 -T O -C 15000 -S 9998 -f -b ../dists.dss 9 | ../dbgen -s 1 -T O -C 15000 -S 14997 -f -b ../dists.dss 10 | ../dbgen -s 1 -T O -C 15000 -S 15000 -f -b ../dists.dss 11 | ../dbgen -s 1 -T P -C 2000 -S 1 -f -b ../dists.dss 12 | ../dbgen -s 1 -T P -C 2000 -S 666 -f -b ../dists.dss 13 | ../dbgen -s 1 -T P -C 2000 -S 1332 -f -b ../dists.dss 14 | ../dbgen -s 1 -T P -C 2000 -S 1998 -f -b ../dists.dss 15 | ../dbgen -s 1 -T P -C 2000 -S 2000 -f -b ../dists.dss 16 | ../dbgen -s 1 -T S -C 8000 -S 1 -f -b ../dists.dss 17 | ../dbgen -s 1 -T S -C 8000 -S 2666 -f -b ../dists.dss 18 | ../dbgen -s 1 -T S -C 8000 -S 5332 -f -b ../dists.dss 19 | ../dbgen -s 1 -T S -C 8000 -S 7998 -f -b ../dists.dss 20 | ../dbgen -s 1 -T S -C 8000 -S 8000 -f -b ../dists.dss 21 | ../dbgen -s 1 -T s -C 100 -S 1 -f -b ../dists.dss 22 | ../dbgen -s 1 -T s -C 100 -S 32 -f -b ../dists.dss 23 | ../dbgen -s 1 -T s -C 100 -S 64 -f -b ../dists.dss 24 | ../dbgen -s 1 -T s -C 100 -S 96 -f -b ../dists.dss 25 | ../dbgen -s 1 -T s -C 100 -S 100 -f -b ../dists.dss 26 | ../dbgen -s 1 -T c -C 1500 -S 1 -f -b ../dists.dss 27 | ../dbgen -s 1 -T c -C 1500 -S 499 -f -b ../dists.dss 28 | ../dbgen -s 1 -T c -C 1500 -S 998 -f -b ../dists.dss 29 | ../dbgen -s 1 -T c -C 1500 -S 1497 -f -b ../dists.dss 30 | ../dbgen -s 1 -T c -C 1500 -S 1500 -f -b ../dists.dss 31 | ../dbgen -T n -f -b ../dists.dss 32 | ../dbgen -T r -f -b ../dists.dss 33 | -------------------------------------------------------------------------------- /reference/cmd_base_sf100: -------------------------------------------------------------------------------- 1 | ../dbgen -s 100 -T L -C 6000000 -S 1 -f -b ../dists.dss 2 | ../dbgen -s 100 -T L -C 6000000 -S 1999999 -f -b ../dists.dss 3 | ../dbgen -s 100 -T L -C 6000000 -S 3999998 -f -b ../dists.dss 4 | ../dbgen -s 100 -T L -C 6000000 -S 5999997 -f -b ../dists.dss 5 | ../dbgen -s 100 -T L -C 6000000 -S 6000000 -f -b ../dists.dss 6 | ../dbgen -s 100 -T O -C 1500000 -S 1 -f -b ../dists.dss 7 | ../dbgen -s 100 -T O -C 1500000 -S 499999 -f -b ../dists.dss 8 | ../dbgen -s 100 -T O -C 1500000 -S 999998 -f -b ../dists.dss 9 | ../dbgen -s 100 -T O -C 1500000 -S 1499997 -f -b ../dists.dss 10 | ../dbgen -s 100 -T O -C 1500000 -S 1500000 -f -b ../dists.dss 11 | ../dbgen -s 100 -T P -C 200000 -S 1 -f -b ../dists.dss 12 | ../dbgen -s 100 -T P -C 200000 -S 66666 -f -b ../dists.dss 13 | ../dbgen -s 100 -T P -C 200000 -S 133332 -f -b ../dists.dss 14 | ../dbgen -s 100 -T P -C 200000 -S 199998 -f -b ../dists.dss 15 | ../dbgen -s 100 -T P -C 200000 -S 200000 -f -b ../dists.dss 16 | ../dbgen -s 100 -T S -C 800000 -S 1 -f -b ../dists.dss 17 | ../dbgen -s 100 -T S -C 800000 -S 266666 -f -b ../dists.dss 18 | ../dbgen -s 100 -T S -C 800000 -S 533332 -f -b ../dists.dss 19 | ../dbgen -s 100 -T S -C 800000 -S 799998 -f -b ../dists.dss 20 | ../dbgen -s 100 -T S -C 800000 -S 800000 -f -b ../dists.dss 21 | ../dbgen -s 100 -T s -C 10000 -S 1 -f -b ../dists.dss 22 | ../dbgen -s 100 -T s -C 10000 -S 3332 -f -b ../dists.dss 23 | ../dbgen -s 100 -T s -C 10000 -S 6664 -f -b ../dists.dss 24 | ../dbgen -s 100 -T s -C 10000 -S 9996 -f -b ../dists.dss 25 | ../dbgen -s 100 -T s -C 10000 -S 10000 -f -b ../dists.dss 26 | ../dbgen -s 100 -T c -C 150000 -S 1 -f -b ../dists.dss 27 | ../dbgen -s 100 -T c -C 150000 -S 49999 -f -b ../dists.dss 28 | ../dbgen -s 100 -T c -C 150000 -S 99998 -f -b ../dists.dss 29 | ../dbgen -s 100 -T c -C 150000 -S 149997 -f -b ../dists.dss 30 | ../dbgen -s 100 -T c -C 150000 -S 150000 -f -b ../dists.dss 31 | ../dbgen -T n -f -b ../dists.dss 32 | ../dbgen -T r -f -b ../dists.dss 33 | -------------------------------------------------------------------------------- /reference/cmd_base_sf1000: -------------------------------------------------------------------------------- 1 | ../dbgen -s 1000 -T L -C 60000000 -S 1 -f -b ../dists.dss 2 | ../dbgen -s 1000 -T L -C 60000000 -S 19999999 -f -b ../dists.dss 3 | ../dbgen -s 1000 -T L -C 60000000 -S 39999998 -f -b ../dists.dss 4 | ../dbgen -s 1000 -T L -C 60000000 -S 59999997 -f -b ../dists.dss 5 | ../dbgen -s 1000 -T L -C 60000000 -S 60000000 -f -b ../dists.dss 6 | ../dbgen -s 1000 -T O -C 15000000 -S 1 -f -b ../dists.dss 7 | ../dbgen -s 1000 -T O -C 15000000 -S 4999999 -f -b ../dists.dss 8 | ../dbgen -s 1000 -T O -C 15000000 -S 9999998 -f -b ../dists.dss 9 | ../dbgen -s 1000 -T O -C 15000000 -S 14999997 -f -b ../dists.dss 10 | ../dbgen -s 1000 -T O -C 15000000 -S 15000000 -f -b ../dists.dss 11 | ../dbgen -s 1000 -T P -C 2000000 -S 1 -f -b ../dists.dss 12 | ../dbgen -s 1000 -T P -C 2000000 -S 666666 -f -b ../dists.dss 13 | ../dbgen -s 1000 -T P -C 2000000 -S 1333332 -f -b ../dists.dss 14 | ../dbgen -s 1000 -T P -C 2000000 -S 1999998 -f -b ../dists.dss 15 | ../dbgen -s 1000 -T P -C 2000000 -S 2000000 -f -b ../dists.dss 16 | ../dbgen -s 1000 -T S -C 8000000 -S 1 -f -b ../dists.dss 17 | ../dbgen -s 1000 -T S -C 8000000 -S 2666666 -f -b ../dists.dss 18 | ../dbgen -s 1000 -T S -C 8000000 -S 5333332 -f -b ../dists.dss 19 | ../dbgen -s 1000 -T S -C 8000000 -S 7999998 -f -b ../dists.dss 20 | ../dbgen -s 1000 -T S -C 8000000 -S 8000000 -f -b ../dists.dss 21 | ../dbgen -s 1000 -T s -C 100000 -S 1 -f -b ../dists.dss 22 | ../dbgen -s 1000 -T s -C 100000 -S 33332 -f -b ../dists.dss 23 | ../dbgen -s 1000 -T s -C 100000 -S 66664 -f -b ../dists.dss 24 | ../dbgen -s 1000 -T s -C 100000 -S 99996 -f -b ../dists.dss 25 | ../dbgen -s 1000 -T s -C 100000 -S 100000 -f -b ../dists.dss 26 | ../dbgen -s 1000 -T c -C 1500000 -S 1 -f -b ../dists.dss 27 | ../dbgen -s 1000 -T c -C 1500000 -S 499999 -f -b ../dists.dss 28 | ../dbgen -s 1000 -T c -C 1500000 -S 999998 -f -b ../dists.dss 29 | ../dbgen -s 1000 -T c -C 1500000 -S 1499997 -f -b ../dists.dss 30 | ../dbgen -s 1000 -T c -C 1500000 -S 1500000 -f -b ../dists.dss 31 | ../dbgen -T n -f -b ../dists.dss 32 | ../dbgen -T r -f -b ../dists.dss 33 | -------------------------------------------------------------------------------- /reference/cmd_base_sf10000: -------------------------------------------------------------------------------- 1 | ../dbgen -s 10000 -T L -C 600000000 -S 1 -f -b ../dists.dss 2 | ../dbgen -s 10000 -T L -C 600000000 -S 199999999 -f -b ../dists.dss 3 | ../dbgen -s 10000 -T L -C 600000000 -S 399999998 -f -b ../dists.dss 4 | ../dbgen -s 10000 -T L -C 600000000 -S 599999997 -f -b ../dists.dss 5 | ../dbgen -s 10000 -T L -C 600000000 -S 600000000 -f -b ../dists.dss 6 | ../dbgen -s 10000 -T O -C 150000000 -S 1 -f -b ../dists.dss 7 | ../dbgen -s 10000 -T O -C 150000000 -S 49999999 -f -b ../dists.dss 8 | ../dbgen -s 10000 -T O -C 150000000 -S 99999998 -f -b ../dists.dss 9 | ../dbgen -s 10000 -T O -C 150000000 -S 149999997 -f -b ../dists.dss 10 | ../dbgen -s 10000 -T O -C 150000000 -S 150000000 -f -b ../dists.dss 11 | ../dbgen -s 10000 -T P -C 20000000 -S 1 -f -b ../dists.dss 12 | ../dbgen -s 10000 -T P -C 20000000 -S 6666666 -f -b ../dists.dss 13 | ../dbgen -s 10000 -T P -C 20000000 -S 13333332 -f -b ../dists.dss 14 | ../dbgen -s 10000 -T P -C 20000000 -S 19999998 -f -b ../dists.dss 15 | ../dbgen -s 10000 -T P -C 20000000 -S 20000000 -f -b ../dists.dss 16 | ../dbgen -s 10000 -T S -C 80000000 -S 1 -f -b ../dists.dss 17 | ../dbgen -s 10000 -T S -C 80000000 -S 26666666 -f -b ../dists.dss 18 | ../dbgen -s 10000 -T S -C 80000000 -S 53333332 -f -b ../dists.dss 19 | ../dbgen -s 10000 -T S -C 80000000 -S 79999998 -f -b ../dists.dss 20 | ../dbgen -s 10000 -T S -C 80000000 -S 80000000 -f -b ../dists.dss 21 | ../dbgen -s 10000 -T s -C 1000000 -S 1 -f -b ../dists.dss 22 | ../dbgen -s 10000 -T s -C 1000000 -S 333332 -f -b ../dists.dss 23 | ../dbgen -s 10000 -T s -C 1000000 -S 666664 -f -b ../dists.dss 24 | ../dbgen -s 10000 -T s -C 1000000 -S 999996 -f -b ../dists.dss 25 | ../dbgen -s 10000 -T s -C 1000000 -S 1000000 -f -b ../dists.dss 26 | ../dbgen -s 10000 -T c -C 15000000 -S 1 -f -b ../dists.dss 27 | ../dbgen -s 10000 -T c -C 15000000 -S 4999999 -f -b ../dists.dss 28 | ../dbgen -s 10000 -T c -C 15000000 -S 9999998 -f -b ../dists.dss 29 | ../dbgen -s 10000 -T c -C 15000000 -S 14999997 -f -b ../dists.dss 30 | ../dbgen -s 10000 -T c -C 15000000 -S 15000000 -f -b ../dists.dss 31 | ../dbgen -T n -f -b ../dists.dss 32 | ../dbgen -T r -f -b ../dists.dss 33 | -------------------------------------------------------------------------------- /reference/cmd_base_sf100000: -------------------------------------------------------------------------------- 1 | ../dbgen -s 100000 -T L -C 2000000000 -S 1 -f -b ../dists.dss 2 | ../dbgen -s 100000 -T L -C 2000000000 -S 666666666 -f -b ../dists.dss 3 | ../dbgen -s 100000 -T L -C 2000000000 -S 1333333332 -f -b ../dists.dss 4 | ../dbgen -s 100000 -T L -C 2000000000 -S 1999999998 -f -b ../dists.dss 5 | ../dbgen -s 100000 -T L -C 2000000000 -S 2000000000 -f -b ../dists.dss 6 | ../dbgen -s 100000 -T O -C 1500000000 -S 1 -f -b ../dists.dss 7 | ../dbgen -s 100000 -T O -C 1500000000 -S 499999999 -f -b ../dists.dss 8 | ../dbgen -s 100000 -T O -C 1500000000 -S 999999998 -f -b ../dists.dss 9 | ../dbgen -s 100000 -T O -C 1500000000 -S 1499999997 -f -b ../dists.dss 10 | ../dbgen -s 100000 -T O -C 1500000000 -S 1500000000 -f -b ../dists.dss 11 | ../dbgen -s 100000 -T P -C 200000000 -S 1 -f -b ../dists.dss 12 | ../dbgen -s 100000 -T P -C 200000000 -S 66666666 -f -b ../dists.dss 13 | ../dbgen -s 100000 -T P -C 200000000 -S 133333332 -f -b ../dists.dss 14 | ../dbgen -s 100000 -T P -C 200000000 -S 199999998 -f -b ../dists.dss 15 | ../dbgen -s 100000 -T P -C 200000000 -S 200000000 -f -b ../dists.dss 16 | ../dbgen -s 100000 -T S -C 800000000 -S 1 -f -b ../dists.dss 17 | ../dbgen -s 100000 -T S -C 800000000 -S 266666666 -f -b ../dists.dss 18 | ../dbgen -s 100000 -T S -C 800000000 -S 533333332 -f -b ../dists.dss 19 | ../dbgen -s 100000 -T S -C 800000000 -S 799999998 -f -b ../dists.dss 20 | ../dbgen -s 100000 -T S -C 800000000 -S 800000000 -f -b ../dists.dss 21 | ../dbgen -s 100000 -T s -C 10000000 -S 1 -f -b ../dists.dss 22 | ../dbgen -s 100000 -T s -C 10000000 -S 3333332 -f -b ../dists.dss 23 | ../dbgen -s 100000 -T s -C 10000000 -S 6666664 -f -b ../dists.dss 24 | ../dbgen -s 100000 -T s -C 10000000 -S 9999996 -f -b ../dists.dss 25 | ../dbgen -s 100000 -T s -C 10000000 -S 10000000 -f -b ../dists.dss 26 | ../dbgen -s 100000 -T c -C 150000000 -S 1 -f -b ../dists.dss 27 | ../dbgen -s 100000 -T c -C 150000000 -S 49999999 -f -b ../dists.dss 28 | ../dbgen -s 100000 -T c -C 150000000 -S 99999998 -f -b ../dists.dss 29 | ../dbgen -s 100000 -T c -C 150000000 -S 149999997 -f -b ../dists.dss 30 | ../dbgen -s 100000 -T c -C 150000000 -S 150000000 -f -b ../dists.dss 31 | ../dbgen -T n -f -b ../dists.dss 32 | ../dbgen -T r -f -b ../dists.dss 33 | -------------------------------------------------------------------------------- /reference/cmd_base_sf300: -------------------------------------------------------------------------------- 1 | ../dbgen -s 300 -T L -C 18000000 -S 1 -f -b ../dists.dss 2 | ../dbgen -s 300 -T L -C 18000000 -S 5999999 -f -b ../dists.dss 3 | ../dbgen -s 300 -T L -C 18000000 -S 11999998 -f -b ../dists.dss 4 | ../dbgen -s 300 -T L -C 18000000 -S 17999997 -f -b ../dists.dss 5 | ../dbgen -s 300 -T L -C 18000000 -S 18000000 -f -b ../dists.dss 6 | ../dbgen -s 300 -T O -C 4500000 -S 1 -f -b ../dists.dss 7 | ../dbgen -s 300 -T O -C 4500000 -S 1499999 -f -b ../dists.dss 8 | ../dbgen -s 300 -T O -C 4500000 -S 2999998 -f -b ../dists.dss 9 | ../dbgen -s 300 -T O -C 4500000 -S 4499997 -f -b ../dists.dss 10 | ../dbgen -s 300 -T O -C 4500000 -S 4500000 -f -b ../dists.dss 11 | ../dbgen -s 300 -T P -C 600000 -S 1 -f -b ../dists.dss 12 | ../dbgen -s 300 -T P -C 600000 -S 199999 -f -b ../dists.dss 13 | ../dbgen -s 300 -T P -C 600000 -S 399998 -f -b ../dists.dss 14 | ../dbgen -s 300 -T P -C 600000 -S 599997 -f -b ../dists.dss 15 | ../dbgen -s 300 -T P -C 600000 -S 600000 -f -b ../dists.dss 16 | ../dbgen -s 300 -T S -C 2400000 -S 1 -f -b ../dists.dss 17 | ../dbgen -s 300 -T S -C 2400000 -S 799999 -f -b ../dists.dss 18 | ../dbgen -s 300 -T S -C 2400000 -S 1599998 -f -b ../dists.dss 19 | ../dbgen -s 300 -T S -C 2400000 -S 2399997 -f -b ../dists.dss 20 | ../dbgen -s 300 -T S -C 2400000 -S 2400000 -f -b ../dists.dss 21 | ../dbgen -s 300 -T s -C 30000 -S 1 -f -b ../dists.dss 22 | ../dbgen -s 300 -T s -C 30000 -S 9999 -f -b ../dists.dss 23 | ../dbgen -s 300 -T s -C 30000 -S 19998 -f -b ../dists.dss 24 | ../dbgen -s 300 -T s -C 30000 -S 29997 -f -b ../dists.dss 25 | ../dbgen -s 300 -T s -C 30000 -S 30000 -f -b ../dists.dss 26 | ../dbgen -s 300 -T c -C 450000 -S 1 -f -b ../dists.dss 27 | ../dbgen -s 300 -T c -C 450000 -S 149999 -f -b ../dists.dss 28 | ../dbgen -s 300 -T c -C 450000 -S 299998 -f -b ../dists.dss 29 | ../dbgen -s 300 -T c -C 450000 -S 449997 -f -b ../dists.dss 30 | ../dbgen -s 300 -T c -C 450000 -S 450000 -f -b ../dists.dss 31 | ../dbgen -T n -f -b ../dists.dss 32 | ../dbgen -T r -f -b ../dists.dss 33 | -------------------------------------------------------------------------------- /reference/cmd_base_sf3000: -------------------------------------------------------------------------------- 1 | ../dbgen -s 3000 -T L -C 180000000 -S 1 -f -b ../dists.dss 2 | ../dbgen -s 3000 -T L -C 180000000 -S 59999999 -f -b ../dists.dss 3 | ../dbgen -s 3000 -T L -C 180000000 -S 119999998 -f -b ../dists.dss 4 | ../dbgen -s 3000 -T L -C 180000000 -S 179999997 -f -b ../dists.dss 5 | ../dbgen -s 3000 -T L -C 180000000 -S 180000000 -f -b ../dists.dss 6 | ../dbgen -s 3000 -T O -C 45000000 -S 1 -f -b ../dists.dss 7 | ../dbgen -s 3000 -T O -C 45000000 -S 14999999 -f -b ../dists.dss 8 | ../dbgen -s 3000 -T O -C 45000000 -S 29999998 -f -b ../dists.dss 9 | ../dbgen -s 3000 -T O -C 45000000 -S 44999997 -f -b ../dists.dss 10 | ../dbgen -s 3000 -T O -C 45000000 -S 45000000 -f -b ../dists.dss 11 | ../dbgen -s 3000 -T P -C 6000000 -S 1 -f -b ../dists.dss 12 | ../dbgen -s 3000 -T P -C 6000000 -S 1999999 -f -b ../dists.dss 13 | ../dbgen -s 3000 -T P -C 6000000 -S 3999998 -f -b ../dists.dss 14 | ../dbgen -s 3000 -T P -C 6000000 -S 5999997 -f -b ../dists.dss 15 | ../dbgen -s 3000 -T P -C 6000000 -S 6000000 -f -b ../dists.dss 16 | ../dbgen -s 3000 -T S -C 24000000 -S 1 -f -b ../dists.dss 17 | ../dbgen -s 3000 -T S -C 24000000 -S 7999999 -f -b ../dists.dss 18 | ../dbgen -s 3000 -T S -C 24000000 -S 15999998 -f -b ../dists.dss 19 | ../dbgen -s 3000 -T S -C 24000000 -S 23999997 -f -b ../dists.dss 20 | ../dbgen -s 3000 -T S -C 24000000 -S 24000000 -f -b ../dists.dss 21 | ../dbgen -s 3000 -T s -C 300000 -S 1 -f -b ../dists.dss 22 | ../dbgen -s 3000 -T s -C 300000 -S 99999 -f -b ../dists.dss 23 | ../dbgen -s 3000 -T s -C 300000 -S 199998 -f -b ../dists.dss 24 | ../dbgen -s 3000 -T s -C 300000 -S 299997 -f -b ../dists.dss 25 | ../dbgen -s 3000 -T s -C 300000 -S 300000 -f -b ../dists.dss 26 | ../dbgen -s 3000 -T c -C 4500000 -S 1 -f -b ../dists.dss 27 | ../dbgen -s 3000 -T c -C 4500000 -S 1499999 -f -b ../dists.dss 28 | ../dbgen -s 3000 -T c -C 4500000 -S 2999998 -f -b ../dists.dss 29 | ../dbgen -s 3000 -T c -C 4500000 -S 4499997 -f -b ../dists.dss 30 | ../dbgen -s 3000 -T c -C 4500000 -S 4500000 -f -b ../dists.dss 31 | ../dbgen -T n -f -b ../dists.dss 32 | ../dbgen -T r -f -b ../dists.dss 33 | -------------------------------------------------------------------------------- /reference/cmd_base_sf30000: -------------------------------------------------------------------------------- 1 | ../dbgen -s 30000 -T L -C 1800000000 -S 1 -f -b ../dists.dss 2 | ../dbgen -s 30000 -T L -C 1800000000 -S 599999999 -f -b ../dists.dss 3 | ../dbgen -s 30000 -T L -C 1800000000 -S 1199999998 -f -b ../dists.dss 4 | ../dbgen -s 30000 -T L -C 1800000000 -S 1799999997 -f -b ../dists.dss 5 | ../dbgen -s 30000 -T L -C 1800000000 -S 1800000000 -f -b ../dists.dss 6 | ../dbgen -s 30000 -T O -C 450000000 -S 1 -f -b ../dists.dss 7 | ../dbgen -s 30000 -T O -C 450000000 -S 149999999 -f -b ../dists.dss 8 | ../dbgen -s 30000 -T O -C 450000000 -S 299999998 -f -b ../dists.dss 9 | ../dbgen -s 30000 -T O -C 450000000 -S 449999997 -f -b ../dists.dss 10 | ../dbgen -s 30000 -T O -C 450000000 -S 450000000 -f -b ../dists.dss 11 | ../dbgen -s 30000 -T P -C 60000000 -S 1 -f -b ../dists.dss 12 | ../dbgen -s 30000 -T P -C 60000000 -S 19999999 -f -b ../dists.dss 13 | ../dbgen -s 30000 -T P -C 60000000 -S 39999998 -f -b ../dists.dss 14 | ../dbgen -s 30000 -T P -C 60000000 -S 59999997 -f -b ../dists.dss 15 | ../dbgen -s 30000 -T P -C 60000000 -S 60000000 -f -b ../dists.dss 16 | ../dbgen -s 30000 -T S -C 240000000 -S 1 -f -b ../dists.dss 17 | ../dbgen -s 30000 -T S -C 240000000 -S 79999999 -f -b ../dists.dss 18 | ../dbgen -s 30000 -T S -C 240000000 -S 159999998 -f -b ../dists.dss 19 | ../dbgen -s 30000 -T S -C 240000000 -S 239999997 -f -b ../dists.dss 20 | ../dbgen -s 30000 -T S -C 240000000 -S 240000000 -f -b ../dists.dss 21 | ../dbgen -s 30000 -T s -C 3000000 -S 1 -f -b ../dists.dss 22 | ../dbgen -s 30000 -T s -C 3000000 -S 999999 -f -b ../dists.dss 23 | ../dbgen -s 30000 -T s -C 3000000 -S 1999998 -f -b ../dists.dss 24 | ../dbgen -s 30000 -T s -C 3000000 -S 2999997 -f -b ../dists.dss 25 | ../dbgen -s 30000 -T s -C 3000000 -S 3000000 -f -b ../dists.dss 26 | ../dbgen -s 30000 -T c -C 45000000 -S 1 -f -b ../dists.dss 27 | ../dbgen -s 30000 -T c -C 45000000 -S 14999999 -f -b ../dists.dss 28 | ../dbgen -s 30000 -T c -C 45000000 -S 29999998 -f -b ../dists.dss 29 | ../dbgen -s 30000 -T c -C 45000000 -S 44999997 -f -b ../dists.dss 30 | ../dbgen -s 30000 -T c -C 45000000 -S 45000000 -f -b ../dists.dss 31 | ../dbgen -T n -f -b ../dists.dss 32 | ../dbgen -T r -f -b ../dists.dss 33 | -------------------------------------------------------------------------------- /reference/cmd_base_small: -------------------------------------------------------------------------------- 1 | ../dbgen -s 30000 -T P -C 60000000 -S 1 -f -b ../dists.dss 2 | ../dbgen -s 30000 -T P -C 60000000 -S 19999999 -f -b ../dists.dss 3 | ../dbgen -s 30000 -T P -C 60000000 -S 39999998 -f -b ../dists.dss 4 | ../dbgen -s 30000 -T P -C 60000000 -S 59999997 -f -b ../dists.dss 5 | ../dbgen -s 30000 -T P -C 60000000 -S 60000000 -f -b ../dists.dss 6 | ../dbgen -s 30000 -T S -C 240000000 -S 1 -f -b ../dists.dss 7 | ../dbgen -s 30000 -T S -C 240000000 -S 79999999 -f -b ../dists.dss 8 | ../dbgen -s 30000 -T S -C 240000000 -S 159999998 -f -b ../dists.dss 9 | ../dbgen -s 30000 -T S -C 240000000 -S 239999997 -f -b ../dists.dss 10 | ../dbgen -s 30000 -T S -C 240000000 -S 240000000 -f -b ../dists.dss 11 | ../dbgen -s 30000 -T s -C 3000000 -S 1 -f -b ../dists.dss 12 | ../dbgen -s 30000 -T s -C 3000000 -S 999999 -f -b ../dists.dss 13 | ../dbgen -s 30000 -T s -C 3000000 -S 1999998 -f -b ../dists.dss 14 | ../dbgen -s 30000 -T s -C 3000000 -S 2999997 -f -b ../dists.dss 15 | ../dbgen -s 30000 -T s -C 3000000 -S 3000000 -f -b ../dists.dss 16 | ../dbgen -s 30000 -T c -C 45000000 -S 1 -f -b ../dists.dss 17 | ../dbgen -s 30000 -T c -C 45000000 -S 14999999 -f -b ../dists.dss 18 | ../dbgen -s 30000 -T c -C 45000000 -S 29999998 -f -b ../dists.dss 19 | ../dbgen -s 30000 -T c -C 45000000 -S 44999997 -f -b ../dists.dss 20 | ../dbgen -s 30000 -T c -C 45000000 -S 45000000 -f -b ../dists.dss 21 | ../dbgen -T n -f -b ../dists.dss 22 | ../dbgen -T r -f -b ../dists.dss 23 | -------------------------------------------------------------------------------- /reference/cmd_qgen_sf1: -------------------------------------------------------------------------------- 1 | ../qgen -s 1 -r 0101000000 -l subparam_1 -b ../dists.dss 2 | ../qgen -s 1 -r 8204031 -l subparam_2 -b ../dists.dss 3 | ../qgen -s 1 -r 16408062 -l subparam_3 -b ../dists.dss 4 | ../qgen -s 1 -r 24612093 -l subparam_4 -b ../dists.dss 5 | ../qgen -s 1 -r 32816124 -l subparam_5 -b ../dists.dss 6 | ../qgen -s 1 -r 41020155 -l subparam_6 -b ../dists.dss 7 | ../qgen -s 1 -r 49224186 -l subparam_7 -b ../dists.dss 8 | ../qgen -s 1 -r 57428217 -l subparam_8 -b ../dists.dss 9 | ../qgen -s 1 -r 65632248 -l subparam_9 -b ../dists.dss 10 | ../qgen -s 1 -r 73836279 -l subparam_10 -b ../dists.dss 11 | ../qgen -s 1 -r 82040310 -l subparam_11 -b ../dists.dss 12 | ../qgen -s 1 -r 90244341 -l subparam_12 -b ../dists.dss 13 | ../qgen -s 1 -r 98448372 -l subparam_13 -b ../dists.dss 14 | ../qgen -s 1 -r 106652403 -l subparam_14 -b ../dists.dss 15 | ../qgen -s 1 -r 114856434 -l subparam_15 -b ../dists.dss 16 | ../qgen -s 1 -r 123060465 -l subparam_16 -b ../dists.dss 17 | ../qgen -s 1 -r 131264496 -l subparam_17 -b ../dists.dss 18 | ../qgen -s 1 -r 139468527 -l subparam_18 -b ../dists.dss 19 | ../qgen -s 1 -r 147672558 -l subparam_19 -b ../dists.dss 20 | ../qgen -s 1 -r 155876589 -l subparam_20 -b ../dists.dss 21 | ../qgen -s 1 -r 164080620 -l subparam_21 -b ../dists.dss 22 | ../qgen -s 1 -r 172284651 -l subparam_22 -b ../dists.dss 23 | ../qgen -s 1 -r 180488682 -l subparam_23 -b ../dists.dss 24 | ../qgen -s 1 -r 188692713 -l subparam_24 -b ../dists.dss 25 | ../qgen -s 1 -r 196896744 -l subparam_25 -b ../dists.dss 26 | ../qgen -s 1 -r 205100775 -l subparam_26 -b ../dists.dss 27 | ../qgen -s 1 -r 213304806 -l subparam_27 -b ../dists.dss 28 | ../qgen -s 1 -r 221508837 -l subparam_28 -b ../dists.dss 29 | ../qgen -s 1 -r 229712868 -l subparam_29 -b ../dists.dss 30 | ../qgen -s 1 -r 237916899 -l subparam_30 -b ../dists.dss 31 | ../qgen -s 1 -r 246120930 -l subparam_31 -b ../dists.dss 32 | ../qgen -s 1 -r 254324961 -l subparam_32 -b ../dists.dss 33 | ../qgen -s 1 -r 262528992 -l subparam_33 -b ../dists.dss 34 | ../qgen -s 1 -r 270733023 -l subparam_34 -b ../dists.dss 35 | ../qgen -s 1 -r 278937054 -l subparam_35 -b ../dists.dss 36 | ../qgen -s 1 -r 287141085 -l subparam_36 -b ../dists.dss 37 | ../qgen -s 1 -r 295345116 -l subparam_37 -b ../dists.dss 38 | ../qgen -s 1 -r 303549147 -l subparam_38 -b ../dists.dss 39 | ../qgen -s 1 -r 311753178 -l subparam_39 -b ../dists.dss 40 | ../qgen -s 1 -r 319957209 -l subparam_40 -b ../dists.dss 41 | ../qgen -s 1 -r 328161240 -l subparam_41 -b ../dists.dss 42 | ../qgen -s 1 -r 336365271 -l subparam_42 -b ../dists.dss 43 | ../qgen -s 1 -r 344569302 -l subparam_43 -b ../dists.dss 44 | ../qgen -s 1 -r 352773333 -l subparam_44 -b ../dists.dss 45 | ../qgen -s 1 -r 360977364 -l subparam_45 -b ../dists.dss 46 | ../qgen -s 1 -r 369181395 -l subparam_46 -b ../dists.dss 47 | ../qgen -s 1 -r 377385426 -l subparam_47 -b ../dists.dss 48 | ../qgen -s 1 -r 385589457 -l subparam_48 -b ../dists.dss 49 | ../qgen -s 1 -r 393793488 -l subparam_49 -b ../dists.dss 50 | ../qgen -s 1 -r 401997519 -l subparam_50 -b ../dists.dss 51 | ../qgen -s 1 -r 410201550 -l subparam_51 -b ../dists.dss 52 | ../qgen -s 1 -r 418405581 -l subparam_52 -b ../dists.dss 53 | ../qgen -s 1 -r 426609612 -l subparam_53 -b ../dists.dss 54 | ../qgen -s 1 -r 434813643 -l subparam_54 -b ../dists.dss 55 | ../qgen -s 1 -r 443017674 -l subparam_55 -b ../dists.dss 56 | ../qgen -s 1 -r 451221705 -l subparam_56 -b ../dists.dss 57 | ../qgen -s 1 -r 459425736 -l subparam_57 -b ../dists.dss 58 | ../qgen -s 1 -r 467629767 -l subparam_58 -b ../dists.dss 59 | ../qgen -s 1 -r 475833798 -l subparam_59 -b ../dists.dss 60 | ../qgen -s 1 -r 484037829 -l subparam_60 -b ../dists.dss 61 | ../qgen -s 1 -r 492241860 -l subparam_61 -b ../dists.dss 62 | ../qgen -s 1 -r 500445891 -l subparam_62 -b ../dists.dss 63 | ../qgen -s 1 -r 508649922 -l subparam_63 -b ../dists.dss 64 | ../qgen -s 1 -r 516853953 -l subparam_64 -b ../dists.dss 65 | ../qgen -s 1 -r 525057984 -l subparam_65 -b ../dists.dss 66 | ../qgen -s 1 -r 533262015 -l subparam_66 -b ../dists.dss 67 | ../qgen -s 1 -r 541466046 -l subparam_67 -b ../dists.dss 68 | ../qgen -s 1 -r 549670077 -l subparam_68 -b ../dists.dss 69 | ../qgen -s 1 -r 557874108 -l subparam_69 -b ../dists.dss 70 | ../qgen -s 1 -r 566078139 -l subparam_70 -b ../dists.dss 71 | ../qgen -s 1 -r 574282170 -l subparam_71 -b ../dists.dss 72 | ../qgen -s 1 -r 582486201 -l subparam_72 -b ../dists.dss 73 | ../qgen -s 1 -r 590690232 -l subparam_73 -b ../dists.dss 74 | ../qgen -s 1 -r 598894263 -l subparam_74 -b ../dists.dss 75 | ../qgen -s 1 -r 607098294 -l subparam_75 -b ../dists.dss 76 | ../qgen -s 1 -r 615302325 -l subparam_76 -b ../dists.dss 77 | ../qgen -s 1 -r 623506356 -l subparam_77 -b ../dists.dss 78 | ../qgen -s 1 -r 631710387 -l subparam_78 -b ../dists.dss 79 | ../qgen -s 1 -r 639914418 -l subparam_79 -b ../dists.dss 80 | ../qgen -s 1 -r 648118449 -l subparam_80 -b ../dists.dss 81 | ../qgen -s 1 -r 656322480 -l subparam_81 -b ../dists.dss 82 | ../qgen -s 1 -r 664526511 -l subparam_82 -b ../dists.dss 83 | ../qgen -s 1 -r 672730542 -l subparam_83 -b ../dists.dss 84 | ../qgen -s 1 -r 680934573 -l subparam_84 -b ../dists.dss 85 | ../qgen -s 1 -r 689138604 -l subparam_85 -b ../dists.dss 86 | ../qgen -s 1 -r 697342635 -l subparam_86 -b ../dists.dss 87 | ../qgen -s 1 -r 705546666 -l subparam_87 -b ../dists.dss 88 | ../qgen -s 1 -r 713750697 -l subparam_88 -b ../dists.dss 89 | ../qgen -s 1 -r 721954728 -l subparam_89 -b ../dists.dss 90 | ../qgen -s 1 -r 730158759 -l subparam_90 -b ../dists.dss 91 | ../qgen -s 1 -r 738362790 -l subparam_91 -b ../dists.dss 92 | ../qgen -s 1 -r 746566821 -l subparam_92 -b ../dists.dss 93 | ../qgen -s 1 -r 754770852 -l subparam_93 -b ../dists.dss 94 | ../qgen -s 1 -r 762974883 -l subparam_94 -b ../dists.dss 95 | ../qgen -s 1 -r 771178914 -l subparam_95 -b ../dists.dss 96 | ../qgen -s 1 -r 779382945 -l subparam_96 -b ../dists.dss 97 | ../qgen -s 1 -r 787586976 -l subparam_97 -b ../dists.dss 98 | ../qgen -s 1 -r 795791007 -l subparam_98 -b ../dists.dss 99 | ../qgen -s 1 -r 803995038 -l subparam_99 -b ../dists.dss 100 | ../qgen -s 1 -r 812199069 -l subparam_100 -b ../dists.dss 101 | ../qgen -s 1 -r 820403100 -l subparam_101 -b ../dists.dss 102 | ../qgen -s 1 -r 828607131 -l subparam_102 -b ../dists.dss 103 | ../qgen -s 1 -r 836811162 -l subparam_103 -b ../dists.dss 104 | ../qgen -s 1 -r 845015193 -l subparam_104 -b ../dists.dss 105 | ../qgen -s 1 -r 853219224 -l subparam_105 -b ../dists.dss 106 | ../qgen -s 1 -r 861423255 -l subparam_106 -b ../dists.dss 107 | ../qgen -s 1 -r 869627286 -l subparam_107 -b ../dists.dss 108 | ../qgen -s 1 -r 877831317 -l subparam_108 -b ../dists.dss 109 | ../qgen -s 1 -r 886035348 -l subparam_109 -b ../dists.dss 110 | ../qgen -s 1 -r 894239379 -l subparam_110 -b ../dists.dss 111 | ../qgen -s 1 -r 902443410 -l subparam_111 -b ../dists.dss 112 | ../qgen -s 1 -r 910647441 -l subparam_112 -b ../dists.dss 113 | ../qgen -s 1 -r 918851472 -l subparam_113 -b ../dists.dss 114 | ../qgen -s 1 -r 927055503 -l subparam_114 -b ../dists.dss 115 | ../qgen -s 1 -r 935259534 -l subparam_115 -b ../dists.dss 116 | ../qgen -s 1 -r 943463565 -l subparam_116 -b ../dists.dss 117 | ../qgen -s 1 -r 951667596 -l subparam_117 -b ../dists.dss 118 | ../qgen -s 1 -r 959871627 -l subparam_118 -b ../dists.dss 119 | ../qgen -s 1 -r 968075658 -l subparam_119 -b ../dists.dss 120 | ../qgen -s 1 -r 976279689 -l subparam_120 -b ../dists.dss 121 | ../qgen -s 1 -r 984483720 -l subparam_121 -b ../dists.dss 122 | ../qgen -s 1 -r 992687751 -l subparam_122 -b ../dists.dss 123 | ../qgen -s 1 -r 1000891782 -l subparam_123 -b ../dists.dss 124 | ../qgen -s 1 -r 1009095813 -l subparam_124 -b ../dists.dss 125 | ../qgen -s 1 -r 1017299844 -l subparam_125 -b ../dists.dss 126 | ../qgen -s 1 -r 1025503875 -l subparam_126 -b ../dists.dss 127 | ../qgen -s 1 -r 1033707906 -l subparam_127 -b ../dists.dss 128 | ../qgen -s 1 -r 1041911937 -l subparam_128 -b ../dists.dss 129 | ../qgen -s 1 -r 1050115968 -l subparam_129 -b ../dists.dss 130 | ../qgen -s 1 -r 1058319999 -l subparam_130 -b ../dists.dss 131 | ../qgen -s 1 -r 1066524030 -l subparam_131 -b ../dists.dss 132 | ../qgen -s 1 -r 1074728061 -l subparam_132 -b ../dists.dss 133 | ../qgen -s 1 -r 1082932092 -l subparam_133 -b ../dists.dss 134 | ../qgen -s 1 -r 1091136123 -l subparam_134 -b ../dists.dss 135 | ../qgen -s 1 -r 1099340154 -l subparam_135 -b ../dists.dss 136 | ../qgen -s 1 -r 1107544185 -l subparam_136 -b ../dists.dss 137 | ../qgen -s 1 -r 1115748216 -l subparam_137 -b ../dists.dss 138 | ../qgen -s 1 -r 1123952247 -l subparam_138 -b ../dists.dss 139 | ../qgen -s 1 -r 1132156278 -l subparam_139 -b ../dists.dss 140 | ../qgen -s 1 -r 1140360309 -l subparam_140 -b ../dists.dss 141 | ../qgen -s 1 -r 1148564340 -l subparam_141 -b ../dists.dss 142 | ../qgen -s 1 -r 1156768371 -l subparam_142 -b ../dists.dss 143 | ../qgen -s 1 -r 1164972402 -l subparam_143 -b ../dists.dss 144 | ../qgen -s 1 -r 1173176433 -l subparam_144 -b ../dists.dss 145 | ../qgen -s 1 -r 1181380464 -l subparam_145 -b ../dists.dss 146 | ../qgen -s 1 -r 1189584495 -l subparam_146 -b ../dists.dss 147 | ../qgen -s 1 -r 1197788526 -l subparam_147 -b ../dists.dss 148 | ../qgen -s 1 -r 1205992557 -l subparam_148 -b ../dists.dss 149 | ../qgen -s 1 -r 1214196588 -l subparam_149 -b ../dists.dss 150 | ../qgen -s 1 -r 1231235959 -l subparam_150 -b ../dists.dss 151 | -------------------------------------------------------------------------------- /reference/cmd_qgen_sf100: -------------------------------------------------------------------------------- 1 | ../qgen -s 100 -r 0101000000 -l subparam_1 -b ../dists.dss 2 | ../qgen -s 100 -r 8204031 -l subparam_2 -b ../dists.dss 3 | ../qgen -s 100 -r 16408062 -l subparam_3 -b ../dists.dss 4 | ../qgen -s 100 -r 24612093 -l subparam_4 -b ../dists.dss 5 | ../qgen -s 100 -r 32816124 -l subparam_5 -b ../dists.dss 6 | ../qgen -s 100 -r 41020155 -l subparam_6 -b ../dists.dss 7 | ../qgen -s 100 -r 49224186 -l subparam_7 -b ../dists.dss 8 | ../qgen -s 100 -r 57428217 -l subparam_8 -b ../dists.dss 9 | ../qgen -s 100 -r 65632248 -l subparam_9 -b ../dists.dss 10 | ../qgen -s 100 -r 73836279 -l subparam_10 -b ../dists.dss 11 | ../qgen -s 100 -r 82040310 -l subparam_11 -b ../dists.dss 12 | ../qgen -s 100 -r 90244341 -l subparam_12 -b ../dists.dss 13 | ../qgen -s 100 -r 98448372 -l subparam_13 -b ../dists.dss 14 | ../qgen -s 100 -r 106652403 -l subparam_14 -b ../dists.dss 15 | ../qgen -s 100 -r 114856434 -l subparam_15 -b ../dists.dss 16 | ../qgen -s 100 -r 123060465 -l subparam_16 -b ../dists.dss 17 | ../qgen -s 100 -r 131264496 -l subparam_17 -b ../dists.dss 18 | ../qgen -s 100 -r 139468527 -l subparam_18 -b ../dists.dss 19 | ../qgen -s 100 -r 147672558 -l subparam_19 -b ../dists.dss 20 | ../qgen -s 100 -r 155876589 -l subparam_20 -b ../dists.dss 21 | ../qgen -s 100 -r 164080620 -l subparam_21 -b ../dists.dss 22 | ../qgen -s 100 -r 172284651 -l subparam_22 -b ../dists.dss 23 | ../qgen -s 100 -r 180488682 -l subparam_23 -b ../dists.dss 24 | ../qgen -s 100 -r 188692713 -l subparam_24 -b ../dists.dss 25 | ../qgen -s 100 -r 196896744 -l subparam_25 -b ../dists.dss 26 | ../qgen -s 100 -r 205100775 -l subparam_26 -b ../dists.dss 27 | ../qgen -s 100 -r 213304806 -l subparam_27 -b ../dists.dss 28 | ../qgen -s 100 -r 221508837 -l subparam_28 -b ../dists.dss 29 | ../qgen -s 100 -r 229712868 -l subparam_29 -b ../dists.dss 30 | ../qgen -s 100 -r 237916899 -l subparam_30 -b ../dists.dss 31 | ../qgen -s 100 -r 246120930 -l subparam_31 -b ../dists.dss 32 | ../qgen -s 100 -r 254324961 -l subparam_32 -b ../dists.dss 33 | ../qgen -s 100 -r 262528992 -l subparam_33 -b ../dists.dss 34 | ../qgen -s 100 -r 270733023 -l subparam_34 -b ../dists.dss 35 | ../qgen -s 100 -r 278937054 -l subparam_35 -b ../dists.dss 36 | ../qgen -s 100 -r 287141085 -l subparam_36 -b ../dists.dss 37 | ../qgen -s 100 -r 295345116 -l subparam_37 -b ../dists.dss 38 | ../qgen -s 100 -r 303549147 -l subparam_38 -b ../dists.dss 39 | ../qgen -s 100 -r 311753178 -l subparam_39 -b ../dists.dss 40 | ../qgen -s 100 -r 319957209 -l subparam_40 -b ../dists.dss 41 | ../qgen -s 100 -r 328161240 -l subparam_41 -b ../dists.dss 42 | ../qgen -s 100 -r 336365271 -l subparam_42 -b ../dists.dss 43 | ../qgen -s 100 -r 344569302 -l subparam_43 -b ../dists.dss 44 | ../qgen -s 100 -r 352773333 -l subparam_44 -b ../dists.dss 45 | ../qgen -s 100 -r 360977364 -l subparam_45 -b ../dists.dss 46 | ../qgen -s 100 -r 369181395 -l subparam_46 -b ../dists.dss 47 | ../qgen -s 100 -r 377385426 -l subparam_47 -b ../dists.dss 48 | ../qgen -s 100 -r 385589457 -l subparam_48 -b ../dists.dss 49 | ../qgen -s 100 -r 393793488 -l subparam_49 -b ../dists.dss 50 | ../qgen -s 100 -r 401997519 -l subparam_50 -b ../dists.dss 51 | ../qgen -s 100 -r 410201550 -l subparam_51 -b ../dists.dss 52 | ../qgen -s 100 -r 418405581 -l subparam_52 -b ../dists.dss 53 | ../qgen -s 100 -r 426609612 -l subparam_53 -b ../dists.dss 54 | ../qgen -s 100 -r 434813643 -l subparam_54 -b ../dists.dss 55 | ../qgen -s 100 -r 443017674 -l subparam_55 -b ../dists.dss 56 | ../qgen -s 100 -r 451221705 -l subparam_56 -b ../dists.dss 57 | ../qgen -s 100 -r 459425736 -l subparam_57 -b ../dists.dss 58 | ../qgen -s 100 -r 467629767 -l subparam_58 -b ../dists.dss 59 | ../qgen -s 100 -r 475833798 -l subparam_59 -b ../dists.dss 60 | ../qgen -s 100 -r 484037829 -l subparam_60 -b ../dists.dss 61 | ../qgen -s 100 -r 492241860 -l subparam_61 -b ../dists.dss 62 | ../qgen -s 100 -r 500445891 -l subparam_62 -b ../dists.dss 63 | ../qgen -s 100 -r 508649922 -l subparam_63 -b ../dists.dss 64 | ../qgen -s 100 -r 516853953 -l subparam_64 -b ../dists.dss 65 | ../qgen -s 100 -r 525057984 -l subparam_65 -b ../dists.dss 66 | ../qgen -s 100 -r 533262015 -l subparam_66 -b ../dists.dss 67 | ../qgen -s 100 -r 541466046 -l subparam_67 -b ../dists.dss 68 | ../qgen -s 100 -r 549670077 -l subparam_68 -b ../dists.dss 69 | ../qgen -s 100 -r 557874108 -l subparam_69 -b ../dists.dss 70 | ../qgen -s 100 -r 566078139 -l subparam_70 -b ../dists.dss 71 | ../qgen -s 100 -r 574282170 -l subparam_71 -b ../dists.dss 72 | ../qgen -s 100 -r 582486201 -l subparam_72 -b ../dists.dss 73 | ../qgen -s 100 -r 590690232 -l subparam_73 -b ../dists.dss 74 | ../qgen -s 100 -r 598894263 -l subparam_74 -b ../dists.dss 75 | ../qgen -s 100 -r 607098294 -l subparam_75 -b ../dists.dss 76 | ../qgen -s 100 -r 615302325 -l subparam_76 -b ../dists.dss 77 | ../qgen -s 100 -r 623506356 -l subparam_77 -b ../dists.dss 78 | ../qgen -s 100 -r 631710387 -l subparam_78 -b ../dists.dss 79 | ../qgen -s 100 -r 639914418 -l subparam_79 -b ../dists.dss 80 | ../qgen -s 100 -r 648118449 -l subparam_80 -b ../dists.dss 81 | ../qgen -s 100 -r 656322480 -l subparam_81 -b ../dists.dss 82 | ../qgen -s 100 -r 664526511 -l subparam_82 -b ../dists.dss 83 | ../qgen -s 100 -r 672730542 -l subparam_83 -b ../dists.dss 84 | ../qgen -s 100 -r 680934573 -l subparam_84 -b ../dists.dss 85 | ../qgen -s 100 -r 689138604 -l subparam_85 -b ../dists.dss 86 | ../qgen -s 100 -r 697342635 -l subparam_86 -b ../dists.dss 87 | ../qgen -s 100 -r 705546666 -l subparam_87 -b ../dists.dss 88 | ../qgen -s 100 -r 713750697 -l subparam_88 -b ../dists.dss 89 | ../qgen -s 100 -r 721954728 -l subparam_89 -b ../dists.dss 90 | ../qgen -s 100 -r 730158759 -l subparam_90 -b ../dists.dss 91 | ../qgen -s 100 -r 738362790 -l subparam_91 -b ../dists.dss 92 | ../qgen -s 100 -r 746566821 -l subparam_92 -b ../dists.dss 93 | ../qgen -s 100 -r 754770852 -l subparam_93 -b ../dists.dss 94 | ../qgen -s 100 -r 762974883 -l subparam_94 -b ../dists.dss 95 | ../qgen -s 100 -r 771178914 -l subparam_95 -b ../dists.dss 96 | ../qgen -s 100 -r 779382945 -l subparam_96 -b ../dists.dss 97 | ../qgen -s 100 -r 787586976 -l subparam_97 -b ../dists.dss 98 | ../qgen -s 100 -r 795791007 -l subparam_98 -b ../dists.dss 99 | ../qgen -s 100 -r 803995038 -l subparam_99 -b ../dists.dss 100 | ../qgen -s 100 -r 812199069 -l subparam_100 -b ../dists.dss 101 | ../qgen -s 100 -r 820403100 -l subparam_101 -b ../dists.dss 102 | ../qgen -s 100 -r 828607131 -l subparam_102 -b ../dists.dss 103 | ../qgen -s 100 -r 836811162 -l subparam_103 -b ../dists.dss 104 | ../qgen -s 100 -r 845015193 -l subparam_104 -b ../dists.dss 105 | ../qgen -s 100 -r 853219224 -l subparam_105 -b ../dists.dss 106 | ../qgen -s 100 -r 861423255 -l subparam_106 -b ../dists.dss 107 | ../qgen -s 100 -r 869627286 -l subparam_107 -b ../dists.dss 108 | ../qgen -s 100 -r 877831317 -l subparam_108 -b ../dists.dss 109 | ../qgen -s 100 -r 886035348 -l subparam_109 -b ../dists.dss 110 | ../qgen -s 100 -r 894239379 -l subparam_110 -b ../dists.dss 111 | ../qgen -s 100 -r 902443410 -l subparam_111 -b ../dists.dss 112 | ../qgen -s 100 -r 910647441 -l subparam_112 -b ../dists.dss 113 | ../qgen -s 100 -r 918851472 -l subparam_113 -b ../dists.dss 114 | ../qgen -s 100 -r 927055503 -l subparam_114 -b ../dists.dss 115 | ../qgen -s 100 -r 935259534 -l subparam_115 -b ../dists.dss 116 | ../qgen -s 100 -r 943463565 -l subparam_116 -b ../dists.dss 117 | ../qgen -s 100 -r 951667596 -l subparam_117 -b ../dists.dss 118 | ../qgen -s 100 -r 959871627 -l subparam_118 -b ../dists.dss 119 | ../qgen -s 100 -r 968075658 -l subparam_119 -b ../dists.dss 120 | ../qgen -s 100 -r 976279689 -l subparam_120 -b ../dists.dss 121 | ../qgen -s 100 -r 984483720 -l subparam_121 -b ../dists.dss 122 | ../qgen -s 100 -r 992687751 -l subparam_122 -b ../dists.dss 123 | ../qgen -s 100 -r 1000891782 -l subparam_123 -b ../dists.dss 124 | ../qgen -s 100 -r 1009095813 -l subparam_124 -b ../dists.dss 125 | ../qgen -s 100 -r 1017299844 -l subparam_125 -b ../dists.dss 126 | ../qgen -s 100 -r 1025503875 -l subparam_126 -b ../dists.dss 127 | ../qgen -s 100 -r 1033707906 -l subparam_127 -b ../dists.dss 128 | ../qgen -s 100 -r 1041911937 -l subparam_128 -b ../dists.dss 129 | ../qgen -s 100 -r 1050115968 -l subparam_129 -b ../dists.dss 130 | ../qgen -s 100 -r 1058319999 -l subparam_130 -b ../dists.dss 131 | ../qgen -s 100 -r 1066524030 -l subparam_131 -b ../dists.dss 132 | ../qgen -s 100 -r 1074728061 -l subparam_132 -b ../dists.dss 133 | ../qgen -s 100 -r 1082932092 -l subparam_133 -b ../dists.dss 134 | ../qgen -s 100 -r 1091136123 -l subparam_134 -b ../dists.dss 135 | ../qgen -s 100 -r 1099340154 -l subparam_135 -b ../dists.dss 136 | ../qgen -s 100 -r 1107544185 -l subparam_136 -b ../dists.dss 137 | ../qgen -s 100 -r 1115748216 -l subparam_137 -b ../dists.dss 138 | ../qgen -s 100 -r 1123952247 -l subparam_138 -b ../dists.dss 139 | ../qgen -s 100 -r 1132156278 -l subparam_139 -b ../dists.dss 140 | ../qgen -s 100 -r 1140360309 -l subparam_140 -b ../dists.dss 141 | ../qgen -s 100 -r 1148564340 -l subparam_141 -b ../dists.dss 142 | ../qgen -s 100 -r 1156768371 -l subparam_142 -b ../dists.dss 143 | ../qgen -s 100 -r 1164972402 -l subparam_143 -b ../dists.dss 144 | ../qgen -s 100 -r 1173176433 -l subparam_144 -b ../dists.dss 145 | ../qgen -s 100 -r 1181380464 -l subparam_145 -b ../dists.dss 146 | ../qgen -s 100 -r 1189584495 -l subparam_146 -b ../dists.dss 147 | ../qgen -s 100 -r 1197788526 -l subparam_147 -b ../dists.dss 148 | ../qgen -s 100 -r 1205992557 -l subparam_148 -b ../dists.dss 149 | ../qgen -s 100 -r 1214196588 -l subparam_149 -b ../dists.dss 150 | ../qgen -s 100 -r 1231235959 -l subparam_150 -b ../dists.dss 151 | -------------------------------------------------------------------------------- /reference/cmd_qgen_sf300: -------------------------------------------------------------------------------- 1 | ../qgen -s 300 -r 0101000000 -l subparam_1 -b ../dists.dss 2 | ../qgen -s 300 -r 8204031 -l subparam_2 -b ../dists.dss 3 | ../qgen -s 300 -r 16408062 -l subparam_3 -b ../dists.dss 4 | ../qgen -s 300 -r 24612093 -l subparam_4 -b ../dists.dss 5 | ../qgen -s 300 -r 32816124 -l subparam_5 -b ../dists.dss 6 | ../qgen -s 300 -r 41020155 -l subparam_6 -b ../dists.dss 7 | ../qgen -s 300 -r 49224186 -l subparam_7 -b ../dists.dss 8 | ../qgen -s 300 -r 57428217 -l subparam_8 -b ../dists.dss 9 | ../qgen -s 300 -r 65632248 -l subparam_9 -b ../dists.dss 10 | ../qgen -s 300 -r 73836279 -l subparam_10 -b ../dists.dss 11 | ../qgen -s 300 -r 82040310 -l subparam_11 -b ../dists.dss 12 | ../qgen -s 300 -r 90244341 -l subparam_12 -b ../dists.dss 13 | ../qgen -s 300 -r 98448372 -l subparam_13 -b ../dists.dss 14 | ../qgen -s 300 -r 106652403 -l subparam_14 -b ../dists.dss 15 | ../qgen -s 300 -r 114856434 -l subparam_15 -b ../dists.dss 16 | ../qgen -s 300 -r 123060465 -l subparam_16 -b ../dists.dss 17 | ../qgen -s 300 -r 131264496 -l subparam_17 -b ../dists.dss 18 | ../qgen -s 300 -r 139468527 -l subparam_18 -b ../dists.dss 19 | ../qgen -s 300 -r 147672558 -l subparam_19 -b ../dists.dss 20 | ../qgen -s 300 -r 155876589 -l subparam_20 -b ../dists.dss 21 | ../qgen -s 300 -r 164080620 -l subparam_21 -b ../dists.dss 22 | ../qgen -s 300 -r 172284651 -l subparam_22 -b ../dists.dss 23 | ../qgen -s 300 -r 180488682 -l subparam_23 -b ../dists.dss 24 | ../qgen -s 300 -r 188692713 -l subparam_24 -b ../dists.dss 25 | ../qgen -s 300 -r 196896744 -l subparam_25 -b ../dists.dss 26 | ../qgen -s 300 -r 205100775 -l subparam_26 -b ../dists.dss 27 | ../qgen -s 300 -r 213304806 -l subparam_27 -b ../dists.dss 28 | ../qgen -s 300 -r 221508837 -l subparam_28 -b ../dists.dss 29 | ../qgen -s 300 -r 229712868 -l subparam_29 -b ../dists.dss 30 | ../qgen -s 300 -r 237916899 -l subparam_30 -b ../dists.dss 31 | ../qgen -s 300 -r 246120930 -l subparam_31 -b ../dists.dss 32 | ../qgen -s 300 -r 254324961 -l subparam_32 -b ../dists.dss 33 | ../qgen -s 300 -r 262528992 -l subparam_33 -b ../dists.dss 34 | ../qgen -s 300 -r 270733023 -l subparam_34 -b ../dists.dss 35 | ../qgen -s 300 -r 278937054 -l subparam_35 -b ../dists.dss 36 | ../qgen -s 300 -r 287141085 -l subparam_36 -b ../dists.dss 37 | ../qgen -s 300 -r 295345116 -l subparam_37 -b ../dists.dss 38 | ../qgen -s 300 -r 303549147 -l subparam_38 -b ../dists.dss 39 | ../qgen -s 300 -r 311753178 -l subparam_39 -b ../dists.dss 40 | ../qgen -s 300 -r 319957209 -l subparam_40 -b ../dists.dss 41 | ../qgen -s 300 -r 328161240 -l subparam_41 -b ../dists.dss 42 | ../qgen -s 300 -r 336365271 -l subparam_42 -b ../dists.dss 43 | ../qgen -s 300 -r 344569302 -l subparam_43 -b ../dists.dss 44 | ../qgen -s 300 -r 352773333 -l subparam_44 -b ../dists.dss 45 | ../qgen -s 300 -r 360977364 -l subparam_45 -b ../dists.dss 46 | ../qgen -s 300 -r 369181395 -l subparam_46 -b ../dists.dss 47 | ../qgen -s 300 -r 377385426 -l subparam_47 -b ../dists.dss 48 | ../qgen -s 300 -r 385589457 -l subparam_48 -b ../dists.dss 49 | ../qgen -s 300 -r 393793488 -l subparam_49 -b ../dists.dss 50 | ../qgen -s 300 -r 401997519 -l subparam_50 -b ../dists.dss 51 | ../qgen -s 300 -r 410201550 -l subparam_51 -b ../dists.dss 52 | ../qgen -s 300 -r 418405581 -l subparam_52 -b ../dists.dss 53 | ../qgen -s 300 -r 426609612 -l subparam_53 -b ../dists.dss 54 | ../qgen -s 300 -r 434813643 -l subparam_54 -b ../dists.dss 55 | ../qgen -s 300 -r 443017674 -l subparam_55 -b ../dists.dss 56 | ../qgen -s 300 -r 451221705 -l subparam_56 -b ../dists.dss 57 | ../qgen -s 300 -r 459425736 -l subparam_57 -b ../dists.dss 58 | ../qgen -s 300 -r 467629767 -l subparam_58 -b ../dists.dss 59 | ../qgen -s 300 -r 475833798 -l subparam_59 -b ../dists.dss 60 | ../qgen -s 300 -r 484037829 -l subparam_60 -b ../dists.dss 61 | ../qgen -s 300 -r 492241860 -l subparam_61 -b ../dists.dss 62 | ../qgen -s 300 -r 500445891 -l subparam_62 -b ../dists.dss 63 | ../qgen -s 300 -r 508649922 -l subparam_63 -b ../dists.dss 64 | ../qgen -s 300 -r 516853953 -l subparam_64 -b ../dists.dss 65 | ../qgen -s 300 -r 525057984 -l subparam_65 -b ../dists.dss 66 | ../qgen -s 300 -r 533262015 -l subparam_66 -b ../dists.dss 67 | ../qgen -s 300 -r 541466046 -l subparam_67 -b ../dists.dss 68 | ../qgen -s 300 -r 549670077 -l subparam_68 -b ../dists.dss 69 | ../qgen -s 300 -r 557874108 -l subparam_69 -b ../dists.dss 70 | ../qgen -s 300 -r 566078139 -l subparam_70 -b ../dists.dss 71 | ../qgen -s 300 -r 574282170 -l subparam_71 -b ../dists.dss 72 | ../qgen -s 300 -r 582486201 -l subparam_72 -b ../dists.dss 73 | ../qgen -s 300 -r 590690232 -l subparam_73 -b ../dists.dss 74 | ../qgen -s 300 -r 598894263 -l subparam_74 -b ../dists.dss 75 | ../qgen -s 300 -r 607098294 -l subparam_75 -b ../dists.dss 76 | ../qgen -s 300 -r 615302325 -l subparam_76 -b ../dists.dss 77 | ../qgen -s 300 -r 623506356 -l subparam_77 -b ../dists.dss 78 | ../qgen -s 300 -r 631710387 -l subparam_78 -b ../dists.dss 79 | ../qgen -s 300 -r 639914418 -l subparam_79 -b ../dists.dss 80 | ../qgen -s 300 -r 648118449 -l subparam_80 -b ../dists.dss 81 | ../qgen -s 300 -r 656322480 -l subparam_81 -b ../dists.dss 82 | ../qgen -s 300 -r 664526511 -l subparam_82 -b ../dists.dss 83 | ../qgen -s 300 -r 672730542 -l subparam_83 -b ../dists.dss 84 | ../qgen -s 300 -r 680934573 -l subparam_84 -b ../dists.dss 85 | ../qgen -s 300 -r 689138604 -l subparam_85 -b ../dists.dss 86 | ../qgen -s 300 -r 697342635 -l subparam_86 -b ../dists.dss 87 | ../qgen -s 300 -r 705546666 -l subparam_87 -b ../dists.dss 88 | ../qgen -s 300 -r 713750697 -l subparam_88 -b ../dists.dss 89 | ../qgen -s 300 -r 721954728 -l subparam_89 -b ../dists.dss 90 | ../qgen -s 300 -r 730158759 -l subparam_90 -b ../dists.dss 91 | ../qgen -s 300 -r 738362790 -l subparam_91 -b ../dists.dss 92 | ../qgen -s 300 -r 746566821 -l subparam_92 -b ../dists.dss 93 | ../qgen -s 300 -r 754770852 -l subparam_93 -b ../dists.dss 94 | ../qgen -s 300 -r 762974883 -l subparam_94 -b ../dists.dss 95 | ../qgen -s 300 -r 771178914 -l subparam_95 -b ../dists.dss 96 | ../qgen -s 300 -r 779382945 -l subparam_96 -b ../dists.dss 97 | ../qgen -s 300 -r 787586976 -l subparam_97 -b ../dists.dss 98 | ../qgen -s 300 -r 795791007 -l subparam_98 -b ../dists.dss 99 | ../qgen -s 300 -r 803995038 -l subparam_99 -b ../dists.dss 100 | ../qgen -s 300 -r 812199069 -l subparam_100 -b ../dists.dss 101 | ../qgen -s 300 -r 820403100 -l subparam_101 -b ../dists.dss 102 | ../qgen -s 300 -r 828607131 -l subparam_102 -b ../dists.dss 103 | ../qgen -s 300 -r 836811162 -l subparam_103 -b ../dists.dss 104 | ../qgen -s 300 -r 845015193 -l subparam_104 -b ../dists.dss 105 | ../qgen -s 300 -r 853219224 -l subparam_105 -b ../dists.dss 106 | ../qgen -s 300 -r 861423255 -l subparam_106 -b ../dists.dss 107 | ../qgen -s 300 -r 869627286 -l subparam_107 -b ../dists.dss 108 | ../qgen -s 300 -r 877831317 -l subparam_108 -b ../dists.dss 109 | ../qgen -s 300 -r 886035348 -l subparam_109 -b ../dists.dss 110 | ../qgen -s 300 -r 894239379 -l subparam_110 -b ../dists.dss 111 | ../qgen -s 300 -r 902443410 -l subparam_111 -b ../dists.dss 112 | ../qgen -s 300 -r 910647441 -l subparam_112 -b ../dists.dss 113 | ../qgen -s 300 -r 918851472 -l subparam_113 -b ../dists.dss 114 | ../qgen -s 300 -r 927055503 -l subparam_114 -b ../dists.dss 115 | ../qgen -s 300 -r 935259534 -l subparam_115 -b ../dists.dss 116 | ../qgen -s 300 -r 943463565 -l subparam_116 -b ../dists.dss 117 | ../qgen -s 300 -r 951667596 -l subparam_117 -b ../dists.dss 118 | ../qgen -s 300 -r 959871627 -l subparam_118 -b ../dists.dss 119 | ../qgen -s 300 -r 968075658 -l subparam_119 -b ../dists.dss 120 | ../qgen -s 300 -r 976279689 -l subparam_120 -b ../dists.dss 121 | ../qgen -s 300 -r 984483720 -l subparam_121 -b ../dists.dss 122 | ../qgen -s 300 -r 992687751 -l subparam_122 -b ../dists.dss 123 | ../qgen -s 300 -r 1000891782 -l subparam_123 -b ../dists.dss 124 | ../qgen -s 300 -r 1009095813 -l subparam_124 -b ../dists.dss 125 | ../qgen -s 300 -r 1017299844 -l subparam_125 -b ../dists.dss 126 | ../qgen -s 300 -r 1025503875 -l subparam_126 -b ../dists.dss 127 | ../qgen -s 300 -r 1033707906 -l subparam_127 -b ../dists.dss 128 | ../qgen -s 300 -r 1041911937 -l subparam_128 -b ../dists.dss 129 | ../qgen -s 300 -r 1050115968 -l subparam_129 -b ../dists.dss 130 | ../qgen -s 300 -r 1058319999 -l subparam_130 -b ../dists.dss 131 | ../qgen -s 300 -r 1066524030 -l subparam_131 -b ../dists.dss 132 | ../qgen -s 300 -r 1074728061 -l subparam_132 -b ../dists.dss 133 | ../qgen -s 300 -r 1082932092 -l subparam_133 -b ../dists.dss 134 | ../qgen -s 300 -r 1091136123 -l subparam_134 -b ../dists.dss 135 | ../qgen -s 300 -r 1099340154 -l subparam_135 -b ../dists.dss 136 | ../qgen -s 300 -r 1107544185 -l subparam_136 -b ../dists.dss 137 | ../qgen -s 300 -r 1115748216 -l subparam_137 -b ../dists.dss 138 | ../qgen -s 300 -r 1123952247 -l subparam_138 -b ../dists.dss 139 | ../qgen -s 300 -r 1132156278 -l subparam_139 -b ../dists.dss 140 | ../qgen -s 300 -r 1140360309 -l subparam_140 -b ../dists.dss 141 | ../qgen -s 300 -r 1148564340 -l subparam_141 -b ../dists.dss 142 | ../qgen -s 300 -r 1156768371 -l subparam_142 -b ../dists.dss 143 | ../qgen -s 300 -r 1164972402 -l subparam_143 -b ../dists.dss 144 | ../qgen -s 300 -r 1173176433 -l subparam_144 -b ../dists.dss 145 | ../qgen -s 300 -r 1181380464 -l subparam_145 -b ../dists.dss 146 | ../qgen -s 300 -r 1189584495 -l subparam_146 -b ../dists.dss 147 | ../qgen -s 300 -r 1197788526 -l subparam_147 -b ../dists.dss 148 | ../qgen -s 300 -r 1205992557 -l subparam_148 -b ../dists.dss 149 | ../qgen -s 300 -r 1214196588 -l subparam_149 -b ../dists.dss 150 | ../qgen -s 300 -r 1231235959 -l subparam_150 -b ../dists.dss 151 | -------------------------------------------------------------------------------- /reference/cmd_update_sf1: -------------------------------------------------------------------------------- 1 | ../dbgen -s 1 -U 1 -S 1 -i 100 -d 100 -f -b ../dists.dss 2 | ./trim_updates.sh 1 100 3 | ../dbgen -s 1 -U 75 -S 75 -i 100 -d 100 -f -b ../dists.dss 4 | ./trim_updates.sh 75 100 5 | ../dbgen -s 1 -U 150 -S 150 -i 100 -d 100 -f -b ../dists.dss 6 | ./trim_updates.sh 150 100 7 | -------------------------------------------------------------------------------- /reference/cmd_update_sf100: -------------------------------------------------------------------------------- 1 | ../dbgen -s 100 -U 1 -S 1 -i 100 -d 100 -f -b ../dists.dss 2 | ./trim_updates.sh 1 100 3 | ../dbgen -s 100 -U 75 -S 75 -i 100 -d 100 -f -b ../dists.dss 4 | ./trim_updates.sh 75 100 5 | ../dbgen -s 100 -U 150 -S 150 -i 100 -d 100 -f -b ../dists.dss 6 | ./trim_updates.sh 150 100 7 | -------------------------------------------------------------------------------- /reference/cmd_update_sf1000: -------------------------------------------------------------------------------- 1 | ../dbgen -s 1000 -U 1 -S 1 -i 100 -d 100 -f -b ../dists.dss 2 | ./trim_updates.sh 1 100 3 | ../dbgen -s 1000 -U 75 -S 75 -i 100 -d 100 -f -b ../dists.dss 4 | ./trim_updates.sh 75 100 5 | ../dbgen -s 1000 -U 150 -S 150 -i 100 -d 100 -f -b ../dists.dss 6 | ./trim_updates.sh 150 100 7 | -------------------------------------------------------------------------------- /reference/cmd_update_sf10000: -------------------------------------------------------------------------------- 1 | ../dbgen -s 10000 -U 1 -S 1 -i 100 -d 100 -f -b ../dists.dss 2 | ./trim_updates.sh 1 100 3 | ../dbgen -s 10000 -U 75 -S 75 -i 100 -d 100 -f -b ../dists.dss 4 | ./trim_updates.sh 75 100 5 | ../dbgen -s 10000 -U 150 -S 150 -i 100 -d 100 -f -b ../dists.dss 6 | ./trim_updates.sh 150 100 7 | -------------------------------------------------------------------------------- /reference/cmd_update_sf100000: -------------------------------------------------------------------------------- 1 | ../dbgen -s 100000 -U 1 -S 1 -i 100 -d 100 -f -b ../dists.dss 2 | ./trim_updates.sh 1 100 3 | ../dbgen -s 100000 -U 75 -S 75 -i 100 -d 100 -f -b ../dists.dss 4 | ./trim_updates.sh 75 100 5 | ../dbgen -s 100000 -U 150 -S 150 -i 100 -d 100 -f -b ../dists.dss 6 | ./trim_updates.sh 150 100 7 | -------------------------------------------------------------------------------- /reference/cmd_update_sf300: -------------------------------------------------------------------------------- 1 | ../dbgen -s 300 -U 1 -S 1 -i 100 -d 100 -f -b ../dists.dss 2 | ./trim_updates.sh 1 100 3 | ../dbgen -s 300 -U 75 -S 75 -i 100 -d 100 -f -b ../dists.dss 4 | ./trim_updates.sh 75 100 5 | ../dbgen -s 300 -U 150 -S 150 -i 100 -d 100 -f -b ../dists.dss 6 | ./trim_updates.sh 150 100 7 | -------------------------------------------------------------------------------- /reference/cmd_update_sf3000: -------------------------------------------------------------------------------- 1 | ../dbgen -s 3000 -U 1 -S 1 -i 100 -d 100 -f -b ../dists.dss 2 | ./trim_updates.sh 1 100 3 | ../dbgen -s 3000 -U 75 -S 75 -i 100 -d 100 -f -b ../dists.dss 4 | ./trim_updates.sh 75 100 5 | ../dbgen -s 3000 -U 150 -S 150 -i 100 -d 100 -f -b ../dists.dss 6 | ./trim_updates.sh 150 100 7 | -------------------------------------------------------------------------------- /reference/cmd_update_sf30000: -------------------------------------------------------------------------------- 1 | ../dbgen -s 30000 -U 1 -S 1 -i 100 -d 100 -f -b ../dists.dss 2 | ./trim_updates.sh 1 100 3 | ../dbgen -s 30000 -U 75 -S 75 -i 100 -d 100 -f -b ../dists.dss 4 | ./trim_updates.sh 75 100 5 | ../dbgen -s 30000 -U 150 -S 150 -i 100 -d 100 -f -b ../dists.dss 6 | ./trim_updates.sh 150 100 7 | -------------------------------------------------------------------------------- /reference/do_base.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # this makes all the cmd_base scripts in parallel for each scale factor, wating for each 3 | # scale factor to be done before going on to the next 4 | 5 | tmp=`mktemp` 6 | if [ -z $1 ];then 7 | scalefactors="1 100 300 1000 3000 10000 30000 100000" 8 | else 9 | scalefactors=$1 10 | fi 11 | echo Generating base table data for scale factors $scalefactors 12 | 13 | for sf in $scalefactors;do 14 | c=cmd_base_sf$sf 15 | echo STARTING $c at `date` 16 | # just add a '&' at the end of each line 17 | sed <$c 's/$/ \&/' >$tmp 18 | . $tmp 19 | wait 20 | mkdir -p $sf 21 | mv *.tbl.* $sf 22 | echo FINISHED $c at `date` 23 | done 24 | 25 | 26 | -------------------------------------------------------------------------------- /reference/do_qgen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # run all the cmd_qgen scripts serially 3 | 4 | tmp=`mktemp` 5 | cp ../queries/*.sql . 6 | if [ -z $1 ];then 7 | scalefactors="1 100 300 1000 3000 10000 30000 100000" 8 | else 9 | scalefactors=$1 10 | fi 11 | echo Generating substitution params for scale factors $scalefactors 12 | 13 | for sf in $scalefactors;do 14 | c=cmd_qgen_sf$sf 15 | echo STARTING $c at `date` 16 | . $c >/dev/null 2>&1 17 | mkdir -p $sf 18 | mv subparam_* $sf 19 | echo FINISHED $c at `date` 20 | done 21 | rm *.sql 22 | -------------------------------------------------------------------------------- /reference/do_update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # run the update scripts serially 3 | tmp=`mktemp` 4 | if [ -z $1 ];then 5 | scalefactors="1 100 300 1000 3000 10000 30000 100000" 6 | else 7 | scalefactors=$1 8 | fi 9 | echo Generating update data for scale factors $scalefactors 10 | 11 | for sf in $scalefactors;do 12 | c=cmd_update_sf$sf 13 | echo STARTING $c at `date` 14 | . $c 15 | mkdir -p $sf 16 | mv *.u* $sf 17 | echo FINISHED $c at `date` 18 | done 19 | 20 | 21 | -------------------------------------------------------------------------------- /reference/trim_updates.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if [ $# -ne 2 ] 3 | then 4 | echo "USAGE: `basename $0` " 5 | echo " trim all files in the named update set, retaining only the first" 6 | echo " lines" 7 | exit 8 | fi 9 | if [ -z "$DSS_PATH" ] 10 | then 11 | DSS_PATH=. 12 | export DSS_PATH 13 | fi 14 | tmp=`mktemp` 15 | for f in $DSS_PATH/*u$1.* 16 | do 17 | head -$2 $f > $tmp 18 | mv $tmp $f 19 | done 20 | -------------------------------------------------------------------------------- /release.h: -------------------------------------------------------------------------------- 1 | /* 2 | * release.h 3 | */ 4 | #define VERSION 2 5 | #define RELEASE 14 6 | #define PATCH 0 7 | #define BUILD 0 8 | -------------------------------------------------------------------------------- /rnd.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: rnd.c,v 1.7 2006/07/31 17:23:09 jms Exp $ 3 | * 4 | * Revision History 5 | * =================== 6 | * $Log: rnd.c,v $ 7 | * Revision 1.7 2006/07/31 17:23:09 jms 8 | * fix to parallelism problem 9 | * 10 | * Revision 1.6 2005/10/25 17:26:38 jms 11 | * check in integration between microsoft changes and baseline code 12 | * 13 | * Revision 1.5 2005/10/14 23:16:54 jms 14 | * fix for answer set compliance 15 | * 16 | * Revision 1.4 2005/09/23 22:29:35 jms 17 | * fix to assume 64b support in the 32b RNG calls. Should speed generation, and corrects a problem with FK between Customer and Orders 18 | * 19 | * Revision 1.3 2005/03/04 21:43:23 jms 20 | * correct segfult in random() 21 | * 22 | * Revision 1.2 2005/01/03 20:08:59 jms 23 | * change line terminations 24 | * 25 | * Revision 1.1.1.1 2004/11/24 23:31:47 jms 26 | * re-establish external server 27 | * 28 | * Revision 1.7 2004/04/08 17:34:15 jms 29 | * cleanup SOLARIS/SUN ifdefs; now all use SUN 30 | * 31 | * Revision 1.6 2004/03/26 20:22:56 jms 32 | * correct Solaris header 33 | * 34 | * Revision 1.5 2004/03/02 20:50:50 jms 35 | * MP/RAS porting changes 36 | * 37 | * Revision 1.4 2004/02/18 16:37:33 jms 38 | * add int32_t for solaris 39 | * 40 | * Revision 1.3 2004/02/18 16:26:49 jms 41 | * 32/64 bit changes for overflow handling needed additional changes when ported back to windows 42 | * 43 | * Revision 1.2 2004/02/18 16:17:32 jms 44 | * add 32bit specific changes to UnifInt 45 | * 46 | * Revision 1.1.1.1 2003/08/08 21:50:34 jms 47 | * recreation after CVS crash 48 | * 49 | * Revision 1.3 2003/08/08 21:35:26 jms 50 | * first integration of rng64 for o_custkey and l_partkey 51 | * 52 | * Revision 1.2 2003/08/07 17:58:34 jms 53 | * Convery RNG to 64bit space as preparation for new large scale RNG 54 | * 55 | * Revision 1.1.1.1 2003/04/03 18:54:21 jms 56 | * initial checkin 57 | * 58 | * 59 | */ 60 | /* 61 | * RANDOM.C -- Implements Park & Miller's "Minimum Standard" RNG 62 | * 63 | * (Reference: CACM, Oct 1988, pp 1192-1201) 64 | * 65 | * NextRand: Computes next random integer 66 | * UnifInt: Yields an long uniformly distributed between given bounds 67 | * UnifReal: ields a real uniformly distributed between given bounds 68 | * Exponential: Yields a real exponentially distributed with given mean 69 | * 70 | */ 71 | 72 | #include "config.h" 73 | #include 74 | #include 75 | #if (defined(LINUX)||defined(_POSIX_SOURCE)) 76 | #include 77 | #endif 78 | #ifdef IBM 79 | #include 80 | #endif 81 | #ifdef SUN 82 | #include 83 | #endif 84 | #ifdef ATT 85 | #include 86 | #endif 87 | #ifdef WIN32 88 | #define int32_t __int32 89 | #endif 90 | #include "dss.h" 91 | #include "rnd.h" 92 | 93 | char *env_config PROTO((char *tag, char *dflt)); 94 | void NthElement(DSS_HUGE, DSS_HUGE *); 95 | 96 | void 97 | dss_random(DSS_HUGE *tgt, DSS_HUGE lower, DSS_HUGE upper, long stream) 98 | { 99 | *tgt = UnifInt(lower, upper, stream); 100 | Seed[stream].usage += 1; 101 | 102 | return; 103 | } 104 | 105 | void 106 | row_start(int t) \ 107 | { 108 | int i; 109 | for (i=0; i <= MAX_STREAM; i++) 110 | Seed[i].usage = 0 ; 111 | 112 | return; 113 | } 114 | 115 | void 116 | row_stop(int t) \ 117 | { 118 | int i; 119 | 120 | /* need to allow for handling the master and detail together */ 121 | if (t == ORDER_LINE) 122 | t = ORDER; 123 | if (t == PART_PSUPP) 124 | t = PART; 125 | 126 | for (i=0; i <= MAX_STREAM; i++) 127 | if ((Seed[i].table == t) || (Seed[i].table == tdefs[t].child)) 128 | { 129 | if (set_seeds && (Seed[i].usage > Seed[i].boundary)) 130 | { 131 | fprintf(stderr, "\nSEED CHANGE: seed[%d].usage = %ld\n", 132 | i, Seed[i].usage); 133 | Seed[i].boundary = Seed[i].usage; 134 | } 135 | else 136 | { 137 | NthElement((Seed[i].boundary - Seed[i].usage), &Seed[i].value); 138 | #ifdef RNG_TEST 139 | Seed[i].nCalls += Seed[i].boundary - Seed[i].usage; 140 | #endif 141 | } 142 | } 143 | return; 144 | } 145 | 146 | void 147 | dump_seeds(int tbl) 148 | { 149 | int i; 150 | 151 | for (i=0; i <= MAX_STREAM; i++) 152 | if (Seed[i].table == tbl) 153 | #ifdef RNG_TEST 154 | printf("%d(%ld):\t%ld\n", i, Seed[i].nCalls, Seed[i].value); 155 | #else 156 | printf("%d:\t%ld\n", i, Seed[i].value); 157 | #endif 158 | return; 159 | } 160 | 161 | /****************************************************************** 162 | 163 | NextRand: Computes next random integer 164 | 165 | *******************************************************************/ 166 | 167 | /* 168 | * long NextRand( long nSeed ) 169 | */ 170 | DSS_HUGE 171 | NextRand(DSS_HUGE nSeed) 172 | 173 | /* 174 | * nSeed is the previous random number; the returned value is the 175 | * next random number. The routine generates all numbers in the 176 | * range 1 .. nM-1. 177 | */ 178 | 179 | { 180 | nSeed = (nSeed * 16807) % 2147483647; 181 | return (nSeed); 182 | } 183 | 184 | /****************************************************************** 185 | 186 | UnifInt: Yields an long uniformly distributed between given bounds 187 | 188 | *******************************************************************/ 189 | 190 | /* 191 | * long UnifInt( long nLow, long nHigh, long nStream ) 192 | */ 193 | DSS_HUGE 194 | UnifInt(DSS_HUGE nLow, DSS_HUGE nHigh, long nStream) 195 | 196 | /* 197 | * Returns an integer uniformly distributed between nLow and nHigh, 198 | * including * the endpoints. nStream is the random number stream. 199 | * Stream 0 is used if nStream is not in the range 0..MAX_STREAM. 200 | */ 201 | 202 | { 203 | double dRange; 204 | DSS_HUGE nTemp, 205 | nRange; 206 | int32_t nLow32 = (int32_t)nLow, 207 | nHigh32 = (int32_t)nHigh; 208 | 209 | if (nStream < 0 || nStream > MAX_STREAM) 210 | nStream = 0; 211 | 212 | if ((nHigh == MAX_LONG) && (nLow == 0)) 213 | { 214 | dRange = DOUBLE_CAST (nHigh32 - nLow32 + 1); 215 | nRange = nHigh32 - nLow32 + 1; 216 | } 217 | else 218 | { 219 | dRange = DOUBLE_CAST (nHigh - nLow + 1); 220 | nRange = nHigh - nLow + 1; 221 | } 222 | 223 | Seed[nStream].value = NextRand(Seed[nStream].value); 224 | #ifdef RNG_TEST 225 | Seed[nStream].nCalls += 1; 226 | #endif 227 | nTemp = (DSS_HUGE) (((double) Seed[nStream].value / dM) * (dRange)); 228 | return (nLow + nTemp); 229 | } 230 | 231 | 232 | 233 | -------------------------------------------------------------------------------- /rnd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: rnd.h,v 1.4 2006/08/01 04:13:17 jms Exp $ 3 | * 4 | * Revision History 5 | * =================== 6 | * $Log: rnd.h,v $ 7 | * Revision 1.4 2006/08/01 04:13:17 jms 8 | * fix parallel generation 9 | * 10 | * Revision 1.3 2006/07/31 17:23:09 jms 11 | * fix to parallelism problem 12 | * 13 | * Revision 1.2 2005/01/03 20:08:59 jms 14 | * change line terminations 15 | * 16 | * Revision 1.1.1.1 2004/11/24 23:31:47 jms 17 | * re-establish external server 18 | * 19 | * Revision 1.1.1.1 2003/08/08 21:50:34 jms 20 | * recreation after CVS crash 21 | * 22 | * Revision 1.3 2003/08/08 21:35:26 jms 23 | * first integration of rng64 for o_custkey and l_partkey 24 | * 25 | * Revision 1.2 2003/08/07 17:58:34 jms 26 | * Convery RNG to 64bit space as preparation for new large scale RNG 27 | * 28 | * Revision 1.1.1.1 2003/04/03 18:54:21 jms 29 | * initial checkin 30 | * 31 | * 32 | */ 33 | /* 34 | * rnd.h -- header file for use withthe portable random number generator 35 | * provided by Frank Stephens of Unisys 36 | */ 37 | 38 | /* function protypes */ 39 | DSS_HUGE NextRand PROTO((DSS_HUGE)); 40 | DSS_HUGE UnifInt PROTO((DSS_HUGE, DSS_HUGE, long)); 41 | 42 | static long nA = 16807; /* the multiplier */ 43 | static long nM = 2147483647;/* the modulus == 2^31 - 1 */ 44 | static long nQ = 127773; /* the quotient nM / nA */ 45 | static long nR = 2836; /* the remainder nM % nA */ 46 | 47 | double dM = 2147483647.0; 48 | 49 | /* 50 | * macros to control RNG and assure reproducible multi-stream 51 | * runs without the need for seed files. Keep track of invocations of RNG 52 | * and always round-up to a known per-row boundary. 53 | */ 54 | /* 55 | * preferred solution, but not initializing correctly 56 | */ 57 | #define VSTR_MAX(len) (long)(len / 5 + (len % 5 == 0)?0:1 + 1) 58 | seed_t Seed[MAX_STREAM + 1] = 59 | { 60 | {PART, 1, 0, 1}, /* P_MFG_SD 0 */ 61 | {PART, 46831694, 0, 1}, /* P_BRND_SD 1 */ 62 | {PART, 1841581359, 0, 1}, /* P_TYPE_SD 2 */ 63 | {PART, 1193163244, 0, 1}, /* P_SIZE_SD 3 */ 64 | {PART, 727633698, 0, 1}, /* P_CNTR_SD 4 */ 65 | {NONE, 933588178, 0, 1}, /* text pregeneration 5 */ 66 | {PART, 804159733, 0, 2}, /* P_CMNT_SD 6 */ 67 | {PSUPP, 1671059989, 0, SUPP_PER_PART}, /* PS_QTY_SD 7 */ 68 | {PSUPP, 1051288424, 0, SUPP_PER_PART}, /* PS_SCST_SD 8 */ 69 | {PSUPP, 1961692154, 0, SUPP_PER_PART * 2}, /* PS_CMNT_SD 9 */ 70 | {ORDER, 1227283347, 0, 1}, /* O_SUPP_SD 10 */ 71 | {ORDER, 1171034773, 0, 1}, /* O_CLRK_SD 11 */ 72 | {ORDER, 276090261, 0, 2}, /* O_CMNT_SD 12 */ 73 | {ORDER, 1066728069, 0, 1}, /* O_ODATE_SD 13 */ 74 | {LINE, 209208115, 0, O_LCNT_MAX}, /* L_QTY_SD 14 */ 75 | {LINE, 554590007, 0, O_LCNT_MAX}, /* L_DCNT_SD 15 */ 76 | {LINE, 721958466, 0, O_LCNT_MAX}, /* L_TAX_SD 16 */ 77 | {LINE, 1371272478, 0, O_LCNT_MAX}, /* L_SHIP_SD 17 */ 78 | {LINE, 675466456, 0, O_LCNT_MAX}, /* L_SMODE_SD 18 */ 79 | {LINE, 1808217256, 0, O_LCNT_MAX}, /* L_PKEY_SD 19 */ 80 | {LINE, 2095021727, 0, O_LCNT_MAX}, /* L_SKEY_SD 20 */ 81 | {LINE, 1769349045, 0, O_LCNT_MAX}, /* L_SDTE_SD 21 */ 82 | {LINE, 904914315, 0, O_LCNT_MAX}, /* L_CDTE_SD 22 */ 83 | {LINE, 373135028, 0, O_LCNT_MAX}, /* L_RDTE_SD 23 */ 84 | {LINE, 717419739, 0, O_LCNT_MAX}, /* L_RFLG_SD 24 */ 85 | {LINE, 1095462486, 0, O_LCNT_MAX * 2}, /* L_CMNT_SD 25 */ 86 | {CUST, 881155353, 0, 9}, /* C_ADDR_SD 26 */ 87 | {CUST, 1489529863, 0, 1}, /* C_NTRG_SD 27 */ 88 | {CUST, 1521138112, 0, 3}, /* C_PHNE_SD 28 */ 89 | {CUST, 298370230, 0, 1}, /* C_ABAL_SD 29 */ 90 | {CUST, 1140279430, 0, 1}, /* C_MSEG_SD 30 */ 91 | {CUST, 1335826707, 0, 2}, /* C_CMNT_SD 31 */ 92 | {SUPP, 706178559, 0, 9}, /* S_ADDR_SD 32 */ 93 | {SUPP, 110356601, 0, 1}, /* S_NTRG_SD 33 */ 94 | {SUPP, 884434366, 0, 3}, /* S_PHNE_SD 34 */ 95 | {SUPP, 962338209, 0, 1}, /* S_ABAL_SD 35 */ 96 | {SUPP, 1341315363, 0, 2}, /* S_CMNT_SD 36 */ 97 | {PART, 709314158, 0, 92}, /* P_NAME_SD 37 */ 98 | {ORDER, 591449447, 0, 1}, /* O_PRIO_SD 38 */ 99 | {LINE, 431918286, 0, 1}, /* HVAR_SD 39 */ 100 | {ORDER, 851767375, 0, 1}, /* O_CKEY_SD 40 */ 101 | {NATION, 606179079, 0, 2}, /* N_CMNT_SD 41 */ 102 | {REGION, 1500869201, 0, 2}, /* R_CMNT_SD 42 */ 103 | {ORDER, 1434868289, 0, 1}, /* O_LCNT_SD 43 */ 104 | {SUPP, 263032577, 0, 1}, /* BBB offset 44 */ 105 | {SUPP, 753643799, 0, 1}, /* BBB type 45 */ 106 | {SUPP, 202794285, 0, 1}, /* BBB comment 46 */ 107 | {SUPP, 715851524, 0, 1} /* BBB junk 47 */ 108 | }; 109 | -------------------------------------------------------------------------------- /rng64.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: rng64.c,v 1.7 2008/03/21 17:38:39 jms Exp $ 3 | * 4 | * This software contains proprietary and confidential information of Gradient 5 | * Systems Inc. By accepting transfer of this copy, Recipient agrees 6 | * to retain this software in confidence, to prevent disclosure to others, and 7 | * to make no use of this software other than that for which it was delivered. 8 | * This is an unpublished copyright work Gradient Systems, Inc. Execpt as 9 | * permitted by federal law, 17 USC 117, copying is strictly prohibited. 10 | * 11 | * Gradient Systems Inc. CONFIDENTIAL - (Gradient Systems Inc. Confidential 12 | * when combined with the aggregated modules for this product) 13 | * OBJECT CODE ONLY SOURCE MATERIALS 14 | * (C) COPYRIGHT Gradient Systems Inc. 2003 15 | * 16 | * All Rights Reserved 17 | * THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF GRADIENT SYSTEMS, INC. 18 | * The copyright notice above does not evidence any 19 | * actual or intended publication of such source code. 20 | * 21 | * Revision History 22 | * =================== 23 | * $Log: rng64.c,v $ 24 | * Revision 1.7 2008/03/21 17:38:39 jms 25 | * changes for 2.6.3 26 | * 27 | * Revision 1.6 2006/04/26 23:20:05 jms 28 | * Data type clenaup for qgen 29 | * 30 | * Revision 1.5 2006/03/08 21:25:27 jms 31 | * change to RNG64 to address overflow/underflow issues 32 | * 33 | * Revision 1.4 2005/10/25 17:26:38 jms 34 | * check in integration between microsoft changes and baseline code 35 | * 36 | * Revision 1.3 2005/03/04 19:48:39 jms 37 | * Changes from Doug Johnson to address very large scale factors 38 | * 39 | * Revision 1.2 2005/01/03 20:08:59 jms 40 | * change line terminations 41 | * 42 | * Revision 1.1.1.1 2004/11/24 23:31:47 jms 43 | * re-establish external server 44 | * 45 | * Revision 1.2 2004/02/18 16:45:30 jms 46 | * remove C++ style comments for AIX compiler 47 | * 48 | * Revision 1.1.1.1 2003/08/08 21:57:34 jms 49 | * recreation after CVS crash 50 | * 51 | * Revision 1.1 2003/08/08 21:57:34 jms 52 | * first integration of rng64 for o_custkey and l_partkey 53 | * 54 | */ 55 | #include "config.h" 56 | #include "dss.h" 57 | #include 58 | #include 59 | #include "rng64.h" 60 | extern double dM; 61 | 62 | extern seed_t Seed[]; 63 | 64 | void 65 | dss_random64(DSS_HUGE *tgt, DSS_HUGE nLow, DSS_HUGE nHigh, long nStream) 66 | { 67 | DSS_HUGE nTemp; 68 | 69 | if (nStream < 0 || nStream > MAX_STREAM) 70 | nStream = 0; 71 | 72 | if (nLow > nHigh) 73 | { 74 | nTemp = nLow; 75 | nLow = nHigh; 76 | nHigh = nTemp; 77 | } 78 | 79 | Seed[nStream].value = NextRand64(Seed[nStream].value); 80 | nTemp = Seed[nStream].value; 81 | if (nTemp < 0) 82 | nTemp = -nTemp; 83 | nTemp %= (nHigh - nLow + 1); 84 | *tgt = nLow + nTemp; 85 | Seed[nStream].usage += 1; 86 | #ifdef RNG_TEST 87 | Seed[nStream].nCalls += 1; 88 | #endif 89 | 90 | return; 91 | } 92 | 93 | DSS_HUGE 94 | NextRand64(DSS_HUGE nSeed){ 95 | 96 | DSS_HUGE a = (unsigned DSS_HUGE) RNG_A; 97 | DSS_HUGE c = (unsigned DSS_HUGE) RNG_C; 98 | nSeed = (nSeed * a + c); /* implicitely truncated to 64bits */ 99 | 100 | return (nSeed); 101 | } 102 | 103 | DSS_HUGE AdvanceRand64( DSS_HUGE nSeed, 104 | DSS_HUGE nCount) { 105 | unsigned DSS_HUGE a = RNG_A ; 106 | unsigned DSS_HUGE c = RNG_C ; 107 | int nBit; 108 | unsigned DSS_HUGE Apow=a, Dsum=c; 109 | 110 | /* if nothing to do, do nothing ! */ 111 | if( nCount == 0 ) return nSeed; 112 | 113 | /* Recursively compute X(n) = A * X(n-1) + C */ 114 | /* */ 115 | /* explicitely: */ 116 | /* X(n) = A^n * X(0) + { A^(n-1) + A^(n-2) + ... A + 1 } * C */ 117 | /* */ 118 | /* we write this as: */ 119 | /* X(n) = Apow(n) * X(0) + Dsum(n) * C */ 120 | /* */ 121 | /* we use the following relations: */ 122 | /* Apow(n) = A^(n%2)*Apow(n/2)*Apow(n/2) */ 123 | /* Dsum(n) = (n%2)*Apow(n/2)*Apow(n/2) + (Apow(n/2) + 1) * Dsum(n/2) */ 124 | /* */ 125 | 126 | /* first get the highest non-zero bit */ 127 | for( nBit = 0; (nCount >> nBit) != RNG_C ; nBit ++){} 128 | 129 | /* go 1 bit at the time */ 130 | while( --nBit >= 0 ) { 131 | Dsum *= (Apow + 1); 132 | Apow = Apow * Apow; 133 | if( ((nCount >> nBit) % 2) == 1 ) { /* odd value */ 134 | Dsum += Apow; 135 | Apow *= a; 136 | } 137 | } 138 | nSeed = nSeed * Apow + Dsum * c; 139 | return nSeed; 140 | } 141 | -------------------------------------------------------------------------------- /rng64.h: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: rng64.h,v 1.2 2005/01/03 20:08:59 jms Exp $ 3 | * 4 | * Revision History 5 | * =================== 6 | * $Log: rng64.h,v $ 7 | * Revision 1.2 2005/01/03 20:08:59 jms 8 | * change line terminations 9 | * 10 | * Revision 1.1.1.1 2004/11/24 23:31:47 jms 11 | * re-establish external server 12 | * 13 | * Revision 1.1.1.1 2003/08/08 21:57:34 jms 14 | * recreation after CVS crash 15 | * 16 | * Revision 1.1 2003/08/08 21:57:34 jms 17 | * first integration of rng64 for o_custkey and l_partkey 18 | * 19 | * 20 | */ 21 | DSS_HUGE AdvanceRand64( DSS_HUGE nSeed, DSS_HUGE nCount); 22 | void dss_random64(DSS_HUGE *tgt, DSS_HUGE nLow, DSS_HUGE nHigh, long stream); 23 | DSS_HUGE NextRand64(DSS_HUGE nSeed); 24 | -------------------------------------------------------------------------------- /shared.h: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: shared.h,v 1.2 2005/01/03 20:08:59 jms Exp $ 3 | * 4 | * Revision History 5 | * =================== 6 | * $Log: shared.h,v $ 7 | * Revision 1.2 2005/01/03 20:08:59 jms 8 | * change line terminations 9 | * 10 | * Revision 1.1.1.1 2004/11/24 23:31:47 jms 11 | * re-establish external server 12 | * 13 | * Revision 1.1.1.1 2003/04/03 18:54:21 jms 14 | * recreation after CVS crash 15 | * 16 | * Revision 1.1.1.1 2003/04/03 18:54:21 jms 17 | * initial checkin 18 | * 19 | * 20 | */ 21 | #define N_CMNT_LEN 72 22 | #define N_CMNT_MAX 152 23 | #define R_CMNT_LEN 72 24 | #define R_CMNT_MAX 152 25 | #define MONEY_SCL 0.01 26 | #define V_STR_HGH 1.6 27 | #define P_NAME_LEN 55 28 | #define P_MFG_LEN 25 29 | #define P_BRND_LEN 10 30 | #define P_TYPE_LEN 25 31 | #define P_CNTR_LEN 10 32 | #define P_CMNT_LEN 14 33 | #define P_CMNT_MAX 23 34 | #define S_NAME_LEN 25 35 | #define S_ADDR_LEN 25 36 | #define S_ADDR_MAX 40 37 | #define S_CMNT_LEN 63 38 | #define S_CMNT_MAX 101 39 | #define PS_CMNT_LEN 124 40 | #define PS_CMNT_MAX 199 41 | #define C_NAME_LEN 18 42 | #define C_ADDR_LEN 25 43 | #define C_ADDR_MAX 40 44 | #define C_MSEG_LEN 10 45 | #define C_CMNT_LEN 73 46 | #define C_CMNT_MAX 117 47 | #define O_OPRIO_LEN 15 48 | #define O_CLRK_LEN 15 49 | #define O_CMNT_LEN 49 50 | #define O_CMNT_MAX 79 51 | #define L_CMNT_LEN 27 52 | #define L_CMNT_MAX 44 53 | #define L_INST_LEN 25 54 | #define L_SMODE_LEN 10 55 | #define T_ALPHA_LEN 10 56 | #define DATE_LEN 13 /* long enough to hold either date format */ 57 | #define NATION_LEN 25 58 | #define REGION_LEN 25 59 | #define PHONE_LEN 15 60 | #define MAXAGG_LEN 20 /* max component length for a agg str */ 61 | #define P_CMNT_SD 6 62 | #define PS_CMNT_SD 9 63 | #define O_CMNT_SD 12 64 | #define C_ADDR_SD 26 65 | #define C_CMNT_SD 31 66 | #define S_ADDR_SD 32 67 | #define S_CMNT_SD 36 68 | #define L_CMNT_SD 25 69 | 70 | -------------------------------------------------------------------------------- /speed_seed.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: speed_seed.c,v 1.9 2009/06/28 14:01:08 jms Exp $ 3 | * 4 | * Revision History 5 | * =================== 6 | * $Log: speed_seed.c,v $ 7 | * Revision 1.9 2009/06/28 14:01:08 jms 8 | * bug fix for DOP 9 | * 10 | * Revision 1.8 2006/08/01 04:13:17 jms 11 | * fix parallel generation 12 | * 13 | * Revision 1.7 2006/07/31 17:23:09 jms 14 | * fix to parallelism problem 15 | * 16 | * Revision 1.6 2006/05/16 16:26:51 jms 17 | * remove calls to FAKE_V_STR 18 | * 19 | * Revision 1.5 2006/04/26 23:14:28 jms 20 | * Declaraion cleanup of fakeVStr() 21 | * 22 | * Revision 1.4 2006/04/26 23:01:10 jms 23 | * address update generation problems 24 | * 25 | * Revision 1.3 2005/10/25 17:26:38 jms 26 | * check in integration between microsoft changes and baseline code 27 | * 28 | * Revision 1.2 2005/01/03 20:08:59 jms 29 | * change line terminations 30 | * 31 | * Revision 1.1.1.1 2004/11/24 23:31:47 jms 32 | * re-establish external server 33 | * 34 | * Revision 1.2 2004/01/22 03:54:12 jms 35 | * 64 bit support changes for customer address 36 | * 37 | * Revision 1.1.1.1 2003/08/08 22:37:36 jms 38 | * recreation after CVS crash 39 | * 40 | * Revision 1.3 2003/08/08 22:37:36 jms 41 | * first integration of rng64 for o_custkey and l_partkey 42 | * 43 | * Revision 1.2 2003/08/07 17:58:34 jms 44 | * Convery RNG to 64bit space as preparation for new large scale RNG 45 | * 46 | * Revision 1.1.1.1 2003/04/03 18:54:21 jms 47 | * initial checkin 48 | * 49 | * 50 | */ 51 | #include 52 | #include 53 | #include "dss.h" 54 | #include "rng64.h" 55 | #include "dss.h" 56 | 57 | /* _tal long RandSeed = "Random^SeedFromTimestamp" (void); */ 58 | 59 | #define ADVANCE_STREAM(stream_id, num_calls) \ 60 | advanceStream(stream_id, num_calls, 0) 61 | #define ADVANCE_STREAM64(stream_id, num_calls) \ 62 | advanceStream(stream_id, num_calls, 1) 63 | #define MAX_COLOR 92 64 | long name_bits[MAX_COLOR / BITS_PER_LONG]; 65 | extern seed_t Seed[]; 66 | void fakeVStr(int nAvg, long nSeed, DSS_HUGE nCount); 67 | void NthElement (DSS_HUGE N, DSS_HUGE *StartSeed); 68 | 69 | 70 | void 71 | advanceStream(int nStream, DSS_HUGE nCalls, int bUse64Bit) 72 | { 73 | if (bUse64Bit) 74 | Seed[nStream].value = AdvanceRand64(Seed[nStream].value, nCalls); 75 | else 76 | NthElement(nCalls, &Seed[nStream].value); 77 | 78 | #ifdef RNG_TEST 79 | Seed[nStream].nCalls += nCalls; 80 | #endif 81 | 82 | return; 83 | } 84 | 85 | /* WARNING! This routine assumes the existence of 64-bit */ 86 | /* integers. The notation used here- "HUGE" is *not* ANSI standard. */ 87 | /* Hopefully, you have this extension as well. If not, use whatever */ 88 | /* nonstandard trick you need to in order to get 64 bit integers. */ 89 | /* The book says that this will work if MAXINT for the type you choose */ 90 | /* is at least 2**46 - 1, so 64 bits is more than you *really* need */ 91 | 92 | static DSS_HUGE Multiplier = 16807; /* or whatever nonstandard */ 93 | static DSS_HUGE Modulus = 2147483647; /* trick you use to get 64 bit int */ 94 | 95 | /* Advances value of Seed after N applications of the random number generator 96 | with multiplier Mult and given Modulus. 97 | NthElement(Seed[],count); 98 | 99 | Theory: We are using a generator of the form 100 | X_n = [Mult * X_(n-1)] mod Modulus. It turns out that 101 | X_n = [(Mult ** n) X_0] mod Modulus. 102 | This can be computed using a divide-and-conquer technique, see 103 | the code below. 104 | 105 | In words, this means that if you want the value of the Seed after n 106 | applications of the generator, you multiply the initial value of the 107 | Seed by the "super multiplier" which is the basic multiplier raised 108 | to the nth power, and then take mod Modulus. 109 | */ 110 | 111 | /* Nth Element of sequence starting with StartSeed */ 112 | void NthElement (DSS_HUGE N, DSS_HUGE *StartSeed) 113 | { 114 | DSS_HUGE Z; 115 | DSS_HUGE Mult; 116 | static int ln=-1; 117 | int i; 118 | 119 | if ((verbose > 0) && ++ln % 1000 == 0) 120 | { 121 | i = ln % LN_CNT; 122 | fprintf(stderr, "%c\b", lnoise[i]); 123 | } 124 | Mult = Multiplier; 125 | Z = (DSS_HUGE) *StartSeed; 126 | while (N > 0 ) 127 | { 128 | if (N % 2 != 0) /* testing for oddness, this seems portable */ 129 | Z = (Mult * Z) % Modulus; 130 | N = N / 2; /* integer division, truncates */ 131 | Mult = (Mult * Mult) % Modulus; 132 | } 133 | *StartSeed = Z; 134 | 135 | return; 136 | } 137 | 138 | 139 | /* updates Seed[column] using the a_rnd algorithm */ 140 | void 141 | fake_a_rnd(int min, int max, int column) 142 | { 143 | DSS_HUGE len; 144 | DSS_HUGE itcount; 145 | 146 | RANDOM(len, min, max, column); 147 | if (len % 5L == 0) 148 | itcount = len/5; 149 | else 150 | itcount = len/5 + 1L; 151 | NthElement(itcount, &Seed[column].usage); 152 | #ifdef RNG_TEST 153 | Seed[column].nCalls += itcount; 154 | #endif 155 | return; 156 | } 157 | 158 | 159 | long 160 | sd_part(int child, DSS_HUGE skip_count) 161 | { 162 | int i; 163 | 164 | for (i=P_MFG_SD; i<= P_CNTR_SD; i++) 165 | ADVANCE_STREAM(i, skip_count); 166 | 167 | ADVANCE_STREAM(P_CMNT_SD, skip_count * 2); 168 | ADVANCE_STREAM(P_NAME_SD, skip_count * 92); 169 | 170 | return(0L); 171 | } 172 | 173 | long 174 | sd_line(int child, DSS_HUGE skip_count) 175 | { 176 | int i,j; 177 | 178 | for (j=0; j < O_LCNT_MAX; j++) 179 | { 180 | for (i=L_QTY_SD; i<= L_RFLG_SD; i++) 181 | /* 182 | if (scale >= 30000 && i == L_PKEY_SD) 183 | ADVANCE_STREAM64(i, skip_count); 184 | else 185 | */ 186 | ADVANCE_STREAM(i, skip_count); 187 | ADVANCE_STREAM(L_CMNT_SD, skip_count * 2); 188 | } 189 | 190 | /* need to special case this as the link between master and detail */ 191 | if (child == 1) 192 | { 193 | ADVANCE_STREAM(O_ODATE_SD, skip_count); 194 | ADVANCE_STREAM(O_LCNT_SD, skip_count); 195 | } 196 | 197 | return(0L); 198 | } 199 | 200 | long 201 | sd_order(int child, DSS_HUGE skip_count) 202 | { 203 | ADVANCE_STREAM(O_LCNT_SD, skip_count); 204 | /* 205 | if (scale >= 30000) 206 | ADVANCE_STREAM64(O_CKEY_SD, skip_count); 207 | else 208 | */ 209 | ADVANCE_STREAM(O_CKEY_SD, skip_count); 210 | ADVANCE_STREAM(O_CMNT_SD, skip_count * 2); 211 | ADVANCE_STREAM(O_SUPP_SD, skip_count); 212 | ADVANCE_STREAM(O_CLRK_SD, skip_count); 213 | ADVANCE_STREAM(O_PRIO_SD, skip_count); 214 | ADVANCE_STREAM(O_ODATE_SD, skip_count); 215 | 216 | return (0L); 217 | } 218 | 219 | long 220 | sd_psupp(int child, DSS_HUGE skip_count) 221 | { 222 | int j; 223 | 224 | for (j=0; j < SUPP_PER_PART; j++) 225 | { 226 | ADVANCE_STREAM(PS_QTY_SD, skip_count); 227 | ADVANCE_STREAM(PS_SCST_SD, skip_count); 228 | ADVANCE_STREAM(PS_CMNT_SD, skip_count * 2); 229 | } 230 | 231 | return(0L); 232 | } 233 | 234 | long 235 | sd_cust(int child, DSS_HUGE skip_count) 236 | { 237 | 238 | ADVANCE_STREAM(C_ADDR_SD, skip_count * 9); 239 | ADVANCE_STREAM(C_CMNT_SD, skip_count * 2); 240 | ADVANCE_STREAM(C_NTRG_SD, skip_count); 241 | ADVANCE_STREAM(C_PHNE_SD, 3L * skip_count); 242 | ADVANCE_STREAM(C_ABAL_SD, skip_count); 243 | ADVANCE_STREAM(C_MSEG_SD, skip_count); 244 | return(0L); 245 | } 246 | 247 | long 248 | sd_supp(int child, DSS_HUGE skip_count) 249 | { 250 | ADVANCE_STREAM(S_NTRG_SD, skip_count); 251 | ADVANCE_STREAM(S_PHNE_SD, 3L * skip_count); 252 | ADVANCE_STREAM(S_ABAL_SD, skip_count); 253 | ADVANCE_STREAM(S_ADDR_SD, skip_count * 9); 254 | ADVANCE_STREAM(S_CMNT_SD, skip_count * 2); 255 | ADVANCE_STREAM(BBB_CMNT_SD, skip_count); 256 | ADVANCE_STREAM(BBB_JNK_SD, skip_count); 257 | ADVANCE_STREAM(BBB_OFFSET_SD, skip_count); 258 | ADVANCE_STREAM(BBB_TYPE_SD, skip_count); /* avoid one trudge */ 259 | 260 | return(0L); 261 | } 262 | -------------------------------------------------------------------------------- /tests/check55.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | SF="1 100 300 1000 3000 10000 30000 100000" 3 | case $# in 4 | 2) 5 | SF=$2; 6 | dop=$1; 7 | ;; 8 | 1) 9 | dop=$1; 10 | ;; 11 | *) 12 | echo "USAGE: $0 [sf]" 13 | echo " work through each SF value using parallel processes" 14 | echo " and the defined DOP settings for bug 55 verification" 15 | exit 16 | ;; 17 | esac 18 | for sf in $SF 19 | do 20 | ./new55.sh $sf "`./dop.sh $sf`" $dop 21 | done 22 | -------------------------------------------------------------------------------- /tests/check_dirs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | er=0 4 | 5 | if [ -z "$1" ]; then 6 | DIRS='1* 300*' 7 | else 8 | DIRS=$1 9 | fi 10 | 11 | for d in $DIRS;do 12 | echo Checking dir $d 13 | cd $d 14 | for f in results.*;do 15 | c=`sed 's/^[0-9]* *//' <$f |uniq |wc -l` 16 | if [ $c -ne 1 ]; then 17 | echo BAD RESULT $d/$f 18 | er=1; 19 | fi 20 | done 21 | cd .. 22 | done 23 | if [ $er -eq 0 ]; then 24 | echo ALL TESTS PASSED 25 | fi 26 | 27 | -------------------------------------------------------------------------------- /tests/dop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/ksh 2 | 3 | # alter the scale factor as desired, testing with sf=1 might be a good idea! 4 | # it is assumed to be run from the dbgen directory and will create 5 | # flat_files_sf into which it will put the flat files for DOP=1 6 | # flat_files_sf for the files for DOP 7 | 8 | 9 | sf=1 10 | tables="lineitem orders part partsupp supplier customer" 11 | 12 | export DSS_CONFIG=`pwd` 13 | mkdir -p flat_files_sf$sf 14 | cd flat_files_sf$sf 15 | ../dbgen -s $sf -f >/dev/null 2>&1 16 | 17 | for dop in 8 13 33;do 18 | mkdir -p DOP$dop 19 | cd DOP$dop 20 | echo 'Starting test for DOP =' $dop at `date` 21 | rm -f *.tbl.* 22 | for ((d=1; d<=dop; d++));do 23 | ../../dbgen -s $sf -S $d -C $dop -f >/dev/null 2>&1 & 24 | done 25 | wait 26 | rm -f *.conc 27 | for ((d=1; d<=dop; d++));do 28 | for table in $tables;do 29 | cat ${table}.tbl.${d} >> ${table}.conc & 30 | done 31 | wait 32 | done 33 | for table in $tables;do 34 | x=`cksum ../$table.tbl |awk '{print $1 $2}'` 35 | y=`cksum $table.conc |awk '{print $1 $2}'` 36 | if [ "$x" = "$y" ];then 37 | echo table $table matches 38 | rm $table.conc $table.tbl.* 39 | else 40 | echo failure for table $table 41 | fi 42 | done 43 | cd .. 44 | done 45 | 46 | -------------------------------------------------------------------------------- /tests/gen_tasks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | COMMAND="./last_row.sh" 3 | if [ -d "c:/" ] 4 | then COMMAND="./no_tail.sh" 5 | fi 6 | 7 | if [ $# -eq 0 ] 8 | then 9 | echo "USAGE: `basename $0` [...]" 10 | echo " generate the commands for the load balancer" 11 | echo " if DOP is ommitted, {1,2,3,4,7,8,11,13,16,17,32,64} is used" 12 | exit 13 | fi 14 | 15 | SF=$1 16 | DOP="1 2 3 4 7 8 11 13 16 17 32 64" 17 | shift 18 | [ $# -ge 1 ] && DOP="$*" 19 | for D in $DOP 20 | do 21 | echo "$COMMAND c $SF $D" 22 | echo "$COMMAND L $SF $D" 23 | echo "$COMMAND O $SF $D" 24 | echo "$COMMAND P $SF $D" 25 | echo "$COMMAND S $SF $D" 26 | echo "$COMMAND s $SF $D" 27 | done 28 | 29 | -------------------------------------------------------------------------------- /tests/last_row.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ## 3 | # use named pipes to get the last row of a given DBGEN data chunk 4 | ## 5 | usage() 6 | { 7 | [ $# -gt 1 ] && echo "ERROR: $2" 8 | echo "USAGE: `basename $1` " 9 | echo " gather final row of table (e.g., -T ) at named and " 10 | exit 11 | } 12 | ## 13 | # MAIN 14 | ## 15 | SF=1 16 | DOP=1 17 | # parse command line 18 | case $# in 19 | 1) 20 | [ $1 = "-h" ] && usage $0 21 | [ $1 = "--help" ] && usage $0 22 | t=$1 23 | ;; 24 | 2) 25 | t=$1 26 | SF=$2 27 | ;; 28 | 3) 29 | t=$1 30 | SF=$2 31 | DOP=$3 32 | ;; 33 | *) 34 | usage $0 "invalid argument count" 35 | ;; 36 | esac 37 | 38 | # assure a setting for DSS_PATH 39 | [ -z "$DSS_PATH" ] && DSS_PATH="." 40 | [ ! -d "$DSS_PATH/$SF" ] && mkdir $DSS_PATH/$SF 41 | chmod 777 $DSS_PATH 42 | DSS_PATH=$DSS_PATH/$SF 43 | export DSS_PATH 44 | 45 | # set the other args 46 | case $t in 47 | n) f="nation"; DOP=1;; # special case for tiny table 48 | r) f="region"; DOP=1;; # special case for tiny table 49 | c) f="customer";; 50 | s) f="supplier";; 51 | P) f="part";; 52 | S) f="partsupp";; 53 | O) f="orders";; 54 | L) f="lineitem";; 55 | *) usage "bad table abreviation: $t" 56 | esac 57 | if [ $DOP -eq 1 ] 58 | then PIPE="$DSS_PATH/${f}.tbl" 59 | else PIPE="$DSS_PATH/${f}.tbl.${DOP}" 60 | fi 61 | 62 | # create a named pipe for each table 63 | rm -rf $PIPE 64 | mknod $PIPE p 65 | # generate data into it 66 | ./dbgen -q -f -s $SF -T $t -S $DOP -C $DOP & 67 | # assure that data is being written to the pipe 68 | sleep 30 69 | # read the last row from the pipe 70 | tail -1 $PIPE > $f.last_row.$SF.$DOP & 71 | wait 72 | rm $PIPE 73 | -------------------------------------------------------------------------------- /tests/load_balance.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DOP=4 3 | # 4 | lock() 5 | { 6 | while [ true ] 7 | do 8 | sleep 1 9 | [ -f $LOCK ] && continue 10 | echo $$ > $LOCK 11 | [ `cat $LOCK` -ne $$ ] && continue 12 | return 13 | done 14 | } 15 | unlock() 16 | { 17 | rm -f $LOCK 18 | } 19 | usage() 20 | { 21 | echo "USAGE: `basename $0` []" 22 | echo " work through commands in , keeping tasks active" 23 | exit 24 | } 25 | # 26 | ### 27 | # MAIN 28 | ### 29 | case $# in 30 | 0) # no args, summarize usage and exit 31 | usage 32 | ;; 33 | 1) # default DOP 34 | [ $1 = "-h" ] && usage 35 | [ $1 = "--help" ] && usage 36 | TASKS=$1 37 | ;; 38 | 2) # set DOP and tasks 39 | TASKS=$1 40 | DOP=$2 41 | ;; 42 | 3) # worker invocation 43 | TASKS=$1 44 | DOP=$2 45 | JOBID=$3 46 | ;; 47 | esac 48 | # validate commands 49 | if [ ! -f "$TASKS" ] 50 | then 51 | echo "ERROR: no list of tasks found" 52 | exit 53 | fi 54 | # launch children or execute next command 55 | if [ -z "$JOBID" ] 56 | then 57 | JOBID=$$ 58 | LOCK=$JOBID.lck 59 | TID=$JOBID.task 60 | echo 1 > $TID 61 | unlock 62 | while [ $DOP -gt 0 ] 63 | do 64 | ./`basename $0` $TASKS $DOP $JOBID & 65 | DOP=`expr $DOP - 1` 66 | done 67 | wait 68 | rm -f $TID $LOCK 69 | else 70 | LOCK=$JOBID.lck 71 | TID=$JOBID.task 72 | while [ true ] 73 | do 74 | lock 75 | CMD_NUM=`cat $TID` 76 | echo `expr $CMD_NUM + 1` > $TID 77 | unlock 78 | CMD=`sed -n ${CMD_NUM}p $TASKS` 79 | [ -z "$CMD" ] && break 80 | echo -n "." 81 | $CMD >> lb_${JOBID}_$DOP.out 2>&1 82 | done 83 | fi 84 | 85 | -------------------------------------------------------------------------------- /tests/new55.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ## 3 | # verify data set at different DOP levels 4 | ## 5 | usage() 6 | { 7 | [ $# -gt 1 ] && echo "ERROR: $2" 8 | echo "USAGE: `basename $1` []" 9 | echo " collect last rows for each table at a set of SF and DOP values" 10 | echo " and try to keep tasks running at all times" 11 | echo " NOTE: multiple values for SF/DOP must be enclosed in quotation marks and separated by spaces" 12 | exit 13 | } 14 | ## 15 | # MAIN 16 | ## 17 | PROCS=4 18 | [ -z "$DSS_PATH" ] && DSS_PATH="." 19 | export DSS_PATH 20 | 21 | # parse command line 22 | case $# in 23 | 3) 24 | PROCS=$3 25 | DOP=$2 26 | SF=$1 27 | ;; 28 | 2) 29 | DOP=$2 30 | SF=$1 31 | ;; 32 | *) usage $0;; 33 | esac 34 | 35 | # generate a task list 36 | CMDS=$$.cmds 37 | rm -f $CMDS 38 | for s in $SF 39 | do 40 | ./gen_tasks.sh $s $DOP >> $CMDS 41 | done 42 | 43 | # run parallel tasks to get last rows 44 | echo "Begining `wc -l $CMDS|cut -f1 -d\ ` tasks with PROCS=$PROCS" 45 | 46 | if [ ! -x ./dbgen ] 47 | then 48 | echo "ERROR: dbgen not found in `pwd`" 49 | exit 50 | fi 51 | ./load_balance.sh $CMDS $PROCS 52 | echo "done" 53 | 54 | # gather the results by table 55 | for f in *.last_row.* 56 | do 57 | t=`echo $f | cut -f1 -d\.` 58 | s=`echo $f | cut -f3 -d\.` 59 | d=`echo $f | cut -f4 -d\.` 60 | echo -n "$d " >> ${DSS_PATH}/$s/results.$t 61 | cat $f >> ${DSS_PATH}/$s/results.$t 62 | rm $f 63 | done 64 | 65 | # clean up 66 | rm $CMDS 67 | for f in lb_*.out 68 | do 69 | if [ -s $f ] 70 | then 71 | echo "There is output in $f. Not removed" 72 | else 73 | rm $f 74 | fi 75 | done 76 | -------------------------------------------------------------------------------- /tpcd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: tpcd.h,v 1.2 2005/01/03 20:08:59 jms Exp $ 3 | * 4 | * Revision History 5 | * =================== 6 | * $Log: tpcd.h,v $ 7 | * Revision 1.2 2005/01/03 20:08:59 jms 8 | * change line terminations 9 | * 10 | * Revision 1.1.1.1 2004/11/24 23:31:47 jms 11 | * re-establish external server 12 | * 13 | * Revision 1.1.1.1 2003/04/03 18:54:21 jms 14 | * recreation after CVS crash 15 | * 16 | * Revision 1.1.1.1 2003/04/03 18:54:21 jms 17 | * initial checkin 18 | * 19 | * 20 | */ 21 | /***************************************************************** 22 | * Title: tpcd.h for TPC D 23 | ***************************************************************** 24 | */ 25 | #define DFLT 0x0001 26 | #define OUTPUT 0x0002 27 | #define EXPLAIN 0x0004 28 | #define DBASE 0x0008 29 | #define VERBOSE 0x0010 30 | #define TIMING 0x0020 31 | #define LOG 0x0040 32 | #define QUERY 0x0080 33 | #define REFRESH 0x0100 34 | #define ANSI 0x0200 35 | #define SEED 0x0400 36 | #define COMMENT 0x0800 37 | #define INIT 0x1000 38 | #define TERMINATE 0x2000 39 | #define DFLT_NUM 0x4000 40 | 41 | /* 42 | * general defines 43 | */ 44 | #define VTAG ':' /* flags a variable substitution */ 45 | #define ofp stdout /* make the routine a filter */ 46 | #define QDIR_TAG "DSS_QUERY" /* variable to point to queries */ 47 | #define QDIR_DFLT "." /* and its default */ 48 | 49 | /* 50 | * database portability defines 51 | */ 52 | #ifdef DB2 53 | #define GEN_QUERY_PLAN "SET CURRENT EXPLAIN SNAPSHOT ON;" 54 | #define START_TRAN "" 55 | #define END_TRAN "COMMIT WORK;" 56 | #define SET_OUTPUT "" 57 | #define SET_ROWCOUNT "--#SET ROWS_FETCH %d\n" 58 | #define SET_DBASE "CONNECT TO %s ;\n" 59 | #endif 60 | 61 | #ifdef INFORMIX 62 | #define GEN_QUERY_PLAN "SET EXPLAIN ON;" 63 | #define START_TRAN "BEGIN WORK;" 64 | #define END_TRAN "COMMIT WORK;" 65 | #define SET_OUTPUT "OUTPUT TO " 66 | #define SET_ROWCOUNT "FIRST %d" 67 | #define SET_DBASE "database %s ;\n" 68 | #endif 69 | 70 | #ifdef ORACLE 71 | #define GEN_QUERY_PLAN "" 72 | #define START_TRAN "" 73 | #define END_TRAN "" 74 | #define SET_OUTPUT "" 75 | #define SET_ROWCOUNT "where rownum <= %d;\n" 76 | #define SET_DBASE "" 77 | #endif 78 | 79 | #ifdef SQLSERVER 80 | #define GEN_QUERY_PLAN "set showplan on\nset noexec on\ngo\n" 81 | #define START_TRAN "begin transaction\ngo\n" 82 | #define END_TRAN "commit transaction\ngo\n" 83 | #define SET_OUTPUT "" 84 | #define SET_ROWCOUNT "set rowcount %d\ngo\n\n" 85 | #define SET_DBASE "use %s\ngo\n" 86 | #endif 87 | 88 | #ifdef SYBASE 89 | #define GEN_QUERY_PLAN "set showplan on\nset noexec on\ngo\n" 90 | #define START_TRAN "begin transaction\ngo\n" 91 | #define END_TRAN "commit transaction\ngo\n" 92 | #define SET_OUTPUT "" 93 | #define SET_ROWCOUNT "set rowcount %d\ngo\n\n" 94 | #define SET_DBASE "use %s\ngo\n" 95 | #endif 96 | 97 | #ifdef TDAT 98 | #define GEN_QUERY_PLAN "EXPLAIN" 99 | #define START_TRAN "BEGIN TRANSACTION" 100 | #define END_TRAN "END TRANSACTION" 101 | #define SET_OUTPUT ".SET FORMAT OFF\n.EXPORT REPORT file=" 102 | #define SET_ROWCOUNT ".SET RETCANCEL ON\n.SET RETLIMIT %d\n" 103 | #define SET_DBASE ".LOGON %s\n" 104 | #endif 105 | 106 | #define MAX_VARS 8 /* max number of host vars in any query */ 107 | #define QLEN_MAX 2048 /* max length of any query */ 108 | #define QUERIES_PER_SET 22 109 | 110 | EXTERN int flags; 111 | EXTERN int s_cnt; 112 | EXTERN char *osuff; 113 | EXTERN int stream; 114 | EXTERN char *lfile; 115 | EXTERN char *ifile; 116 | EXTERN char *tfile; 117 | 118 | #define MAX_PERMUTE 41 119 | #ifdef DECLARER 120 | int rowcnt_dflt[QUERIES_PER_SET + 1] = 121 | {-1,-1,100,10,-1,-1,-1,-1,-1,-1,20,-1,-1,-1,-1,-1,-1,-1,100,-1,-1,100,-1}; 122 | int rowcnt; 123 | #define SEQUENCE(stream, query) permutation[stream % MAX_PERMUTE][query - 1] 124 | #else 125 | extern int rowcnt_dflt[]; 126 | extern int rowcnt; 127 | #endif 128 | -------------------------------------------------------------------------------- /tpch.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "dbgen"=".\dbgen.dsp" - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "test"=".\test\test.dsp" - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | Global: 31 | 32 | Package=<5> 33 | {{{ 34 | }}} 35 | 36 | Package=<3> 37 | {{{ 38 | }}} 39 | 40 | ############################################################################### 41 | 42 | -------------------------------------------------------------------------------- /tpch.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 9.00 3 | # Visual Studio 2005 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tpch", "tpch.vcproj", "{659CDC00-AE59-4839-B79E-93A846C8FDA2}" 5 | EndProject 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "qgen", "qgen.vcproj", "{9BAF8942-2DFD-4BD1-B5ED-DBDDF0169E22}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {659CDC00-AE59-4839-B79E-93A846C8FDA2}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {659CDC00-AE59-4839-B79E-93A846C8FDA2}.Debug|Win32.Build.0 = Debug|Win32 16 | {659CDC00-AE59-4839-B79E-93A846C8FDA2}.Release|Win32.ActiveCfg = Release|Win32 17 | {659CDC00-AE59-4839-B79E-93A846C8FDA2}.Release|Win32.Build.0 = Release|Win32 18 | {9BAF8942-2DFD-4BD1-B5ED-DBDDF0169E22}.Debug|Win32.ActiveCfg = Debug|Win32 19 | {9BAF8942-2DFD-4BD1-B5ED-DBDDF0169E22}.Debug|Win32.Build.0 = Debug|Win32 20 | {9BAF8942-2DFD-4BD1-B5ED-DBDDF0169E22}.Release|Win32.ActiveCfg = Release|Win32 21 | {9BAF8942-2DFD-4BD1-B5ED-DBDDF0169E22}.Release|Win32.Build.0 = Release|Win32 22 | EndGlobalSection 23 | GlobalSection(SolutionProperties) = preSolution 24 | HideSolutionNode = FALSE 25 | EndGlobalSection 26 | EndGlobal 27 | -------------------------------------------------------------------------------- /tpch.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 13 | 14 | 15 | 16 | 17 | 24 | 27 | 30 | 33 | 36 | 39 | 50 | 53 | 56 | 59 | 64 | 67 | 70 | 73 | 76 | 79 | 82 | 85 | 88 | 89 | 97 | 100 | 103 | 106 | 109 | 112 | 119 | 122 | 125 | 128 | 135 | 138 | 141 | 144 | 147 | 150 | 153 | 156 | 159 | 160 | 161 | 162 | 163 | 164 | 169 | 172 | 173 | 176 | 177 | 180 | 181 | 184 | 185 | 188 | 189 | 192 | 193 | 196 | 197 | 200 | 201 | 204 | 205 | 208 | 209 | 210 | 215 | 218 | 219 | 222 | 223 | 226 | 227 | 230 | 231 | 234 | 235 | 238 | 239 | 242 | 243 | 246 | 247 | 250 | 251 | 254 | 255 | 256 | 261 | 262 | 263 | 264 | 265 | 266 | -------------------------------------------------------------------------------- /variants/12a.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Shipping Modes and Order Priority Query(Q12) 3 | -- Variant A 4 | -- Approved February 1998 5 | :x 6 | :o 7 | select 8 | l_shipmode, 9 | sum(decode(o_orderpriority, '1-URGENT', 1, '2-HIGH', 1, 0)) as 10 | high_line_count, 11 | sum(decode(o_orderpriority, '1-URGENT', 0, '2-HIGH', 0, 1)) as 12 | low_line_count 13 | from 14 | orders, 15 | lineitem 16 | where 17 | o_orderkey = l_orderkey 18 | and l_shipmode in (':1', ':2') 19 | and l_commitdate < l_receiptdate 20 | and l_shipdate < l_commitdate 21 | and l_receiptdate >= date ':3' 22 | and l_receiptdate < date ':3' + interval '1' year 23 | group by 24 | l_shipmode 25 | order by 26 | l_shipmode; 27 | :n -1 28 | -------------------------------------------------------------------------------- /variants/13a.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Customer Distribution Query (Q13) 3 | -- Variant A 4 | -- Approved March 1998 5 | :x 6 | create view orders_per_cust:s (custkey, ordercount) as 7 | select 8 | c_custkey, 9 | count(o_orderkey) 10 | from 11 | customer left outer join orders on 12 | c_custkey = o_custkey 13 | and o_comment not like '%:1%:2%' 14 | group by 15 | c_custkey; 16 | 17 | :o 18 | select 19 | ordercount, 20 | count(*) as custdist 21 | from 22 | orders_per_cust:s 23 | group by 24 | ordercount 25 | order by 26 | custdist desc, 27 | ordercount desc; 28 | 29 | drop view orders_per_cust:s; 30 | :n -1 31 | -------------------------------------------------------------------------------- /variants/14a.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Promotion Effect Query (Q14) 3 | -- Variant A 4 | -- Approved March 1998 5 | :x 6 | :o 7 | select 8 | 100.00 * sum(decode(substring(p_type from 1 for 5), 'PROMO', 9 | l_extendedprice * (1-l_discount), 0)) / 10 | sum(l_extendedprice * (1-l_discount)) as promo_revenue 11 | from 12 | lineitem, 13 | part 14 | where 15 | l_partkey = p_partkey 16 | and l_shipdate >= date ':1' 17 | and l_shipdate < date ':1' + interval '1' month; 18 | :n -1 19 | -------------------------------------------------------------------------------- /variants/15a.sql: -------------------------------------------------------------------------------- 1 | -- $ID$ 2 | -- TPC-H/TPC-R Top Supplier Query (Q15) 3 | -- Variant A 4 | -- Approved February 1998 5 | :x 6 | with revenue (supplier_no, total_revenue) as ( 7 | select 8 | l_suppkey, 9 | sum(l_extendedprice * (1-l_discount)) 10 | from 11 | lineitem 12 | where 13 | l_shipdate >= date ':1' 14 | and l_shipdate < date ':1' + interval '3' month 15 | group by 16 | l_suppkey 17 | ) 18 | 19 | :o 20 | select 21 | s_suppkey, 22 | s_name, 23 | s_address, 24 | s_phone, 25 | total_revenue 26 | from 27 | supplier, 28 | revenue 29 | where 30 | s_suppkey = supplier_no 31 | and total_revenue = ( 32 | select 33 | max(total_revenue) 34 | from 35 | revenue 36 | ) 37 | order by 38 | s_suppkey; 39 | :n -1 40 | -------------------------------------------------------------------------------- /variants/8a.sql: -------------------------------------------------------------------------------- 1 | -- @(#)8a.sql 2.1.8.1 2 | 3 | -- TPC-H/TPC-R National Market Share Query (Q8) 4 | 5 | -- Variant A 6 | 7 | -- Approved February 1998 8 | 9 | :x 10 | 11 | :o 12 | 13 | select 14 | 15 | o_year, 16 | 17 | sum(decode(nation, ':1', volume, 0)) / sum(volume) as mkt_share 18 | 19 | from 20 | ( 21 | 22 | select 23 | 24 | extract(year from o_orderdate) as o_year, 25 | l_extendedprice * (1-l_discount) as volume, 26 | n2.n_name as nation 27 | 28 | from 29 | 30 | part, 31 | 32 | supplier, 33 | 34 | lineitem, 35 | 36 | orders, 37 | 38 | customer, 39 | 40 | nation n1, 41 | 42 | nation n2, 43 | 44 | region 45 | 46 | where 47 | 48 | p_partkey = l_partkey 49 | 50 | and s_suppkey = l_suppkey 51 | 52 | and l_orderkey = o_orderkey 53 | 54 | and o_custkey = c_custkey 55 | 56 | and c_nationkey = n1.n_nationkey 57 | 58 | and n1.n_regionkey = r_regionkey 59 | 60 | and r_name = ':2' 61 | 62 | and s_nationkey = n2.n_nationkey 63 | 64 | and o_orderdate between date '1995-01-01' and date '1996-12-31' 65 | 66 | and p_type = ':3' 67 | 68 | ) all_nations 69 | 70 | group by 71 | 72 | o_year 73 | order by 74 | 75 | o_year; 76 | 77 | :n -1 78 | --------------------------------------------------------------------------------