parent
9e6918943e
commit
fb7eb065b0
@ -0,0 +1,271 @@ |
||||
END USER LICENSE AGREEMENT |
||||
VERSION 2.0 |
||||
|
||||
|
||||
READ THE TERMS AND CONDITIONS OF THIS AGREEMENT (“AGREEMENT”) |
||||
CAREFULLY BEFORE INSTALLING OR USING THE ACCOMPANYING |
||||
SOFTWARE. BY INSTALLING OR USING THE SOFTWARE OR RELATED |
||||
DOCUMENTATION, YOU AGREE TO BE BOUND BY THE TERMS OF THIS |
||||
AGREEMENT. IF YOU DO NOT AGREE TO THE TERMS OF THIS AGREEMENT, |
||||
DO NOT INSTALL OR USE THE SOFTWARE. IF YOU ARE ACCESSING THE |
||||
SOFTWARE ON BEHALF OF YOUR ORGANIZATION, YOU REPRESENT AND |
||||
WARRANT THAT YOU HAVE SUFFICIENT AUTHORITY TO BIND YOUR |
||||
ORGANIZATION TO THIS AGREEMENT. |
||||
|
||||
USE AND RE-EXPORT OF THE SOFTWARE IS SUBJECT TO THE UNITED STATES |
||||
EXPORT CONTROL ADMINISTRATION REGULATIONS. THE SOFTWARE MAY |
||||
NOT BE USED BY UNLICENSED PERSONS OR ENTITIES, AND MAY NOT BE RE- |
||||
EXPORTED TO ANOTHER COUNTRY. SEE EXPORT ASSURANCE (CLAUSE 15) |
||||
OF THIS LICENSE. |
||||
|
||||
This is a legal agreement between you (or, if you are accessing the software on behalf of your |
||||
organization, your organization) (“You” or “User”) and the Transaction Processing Performance |
||||
Council (“TPC”). This Agreement states the terms and conditions upon which TPC offers to |
||||
license the Software, including, but not limited to, the source code, scripts, executable programs, |
||||
drivers, libraries and data files associated with such programs, and modifications thereof (the |
||||
“Software”), and online, electronic or printed documentation (“Documentation,” together with |
||||
the Software, “Materials”). |
||||
|
||||
The Software may contain proprietary third-party software which has been licensed to the TPC |
||||
to bundle and distribute as part of the benchmark. Any third-party software is subject to the |
||||
terms and conditions in its associated third-party license. |
||||
|
||||
|
||||
LICENSE |
||||
|
||||
1. Definitions |
||||
“Executive Summary” shall mean a short summary of a TPC Benchmark Result that shows the |
||||
configuration, primary metrics, performance data, and pricing details. The exact requirements |
||||
for the Executive Summary are defined in each TPC Benchmark Standard. |
||||
“Full Disclosure Report (FDR)” shall mean a document that describes The TPC Benchmark |
||||
Result in sufficient detail such that the Result could be recreated. The exact requirements for the |
||||
FDR are defined in each TPC Benchmark Standard. |
||||
|
||||
“TPC Benchmark Result (Result)” shall mean a performance test submitted to the TPC |
||||
attested to meet the requirements of a TPC Benchmark Standard at the time of submission. A |
||||
Result is documented by an Executive Summary and, if required, a FDR |
||||
“TPC Benchmark Standard” shall mean a TPC Benchmark Specification and any associated |
||||
code or binaries approved by the TPC. The various TPC Benchmark Standards can be found |
||||
at http://www.tpc.org/information/current_specifications.asp. |
||||
“TPC Policies” shall mean the guiding principles for how the TPC conducts its operations and |
||||
business. The current TPC Policies can be found at |
||||
http://www.tpc.org/information/current_specifications.asp. |
||||
2. Ownership. The Materials are licensed, not sold, to You for use only under the |
||||
terms of this Agreement. As between You and TPC (and, to the extent applicable, its licensors), |
||||
TPC retains all rights, title and interest to and ownership of the Materials and reserves all rights |
||||
not expressly granted to You. |
||||
3. License Grant. Subject to Your compliance in all material respects with the |
||||
terms and conditions of this Agreement, TPC grants You a restricted, non-exclusive, revocable |
||||
license to install and use the Materials, but only as expressly permitted herein. You may only |
||||
use the Software on computer systems under Your direct control. You may download multiple |
||||
copies of the Materials and make verbatim copies of the original of the Software so long as Your |
||||
use of such copies complies with the terms of this Agreement. |
||||
a. Use by Individual. If You are accessing the Materials as an individual, |
||||
only You (as an individual) may access and use the Materials. |
||||
b. Use by Organization. If You are accessing the Materials on behalf of Your |
||||
organization, only You and those within Your organization may use the Materials. Your |
||||
organization must identify a contact person to TPC and conduct communications with TPC |
||||
through that contact person. |
||||
4. Restrictions. The following restrictions apply to all use of the Materials by You. |
||||
a. General: You may not: (i) use, copy, print, modify, adapt, create derivative |
||||
works from, market, deliver, rent, lease, sublicense, make, have made, assign, pledge, transfer, |
||||
sell, offer to sell, import, reproduce, distribute, publicly perform, publicly display or otherwise |
||||
grant rights to the Materials, or any copy thereof, in whole or in part, except as expressly |
||||
permitted under this Agreement; (ii) use the Materials in any way that does not comply with all |
||||
applicable laws and regulations; or (iii) submit or contribute the Materials, or any part thereof, to |
||||
any open source software project or as part of any third-party software or project without the |
||||
express written consent of the TPC chair. |
||||
b. Public Disclosure: You may not publicly disclose any performance results |
||||
produced while using the Software except in the following circumstances: |
||||
(1) as part of a TPC Benchmark Result. For purposes of this |
||||
Agreement, a “TPC Benchmark Result” is a performance test submitted to the TPC, documented |
||||
by a Full Disclosure Report and Executive Summary, claiming to meet the requirements of an |
||||
official TPC Benchmark Standard. You agree that TPC Benchmark Results may only be |
||||
published in accordance with the TPC Policies. viewable at http: //www.tpc.org |
||||
(2) as part of an academic or research effort that does not imply or |
||||
state a marketing position |
||||
(3) any other use of the Software, provided that: |
||||
(a) any performance results must be clearly identified as not |
||||
being comparable to TPC Benchmark Results unless specifically authorized by TPC, and |
||||
(b) You secure written permission from the TPC. |
||||
5. License Modification. Requests for modification of this license shall be |
||||
addressed to info@tpc.org. You may not remove or modify this license without permission. |
||||
6. Copyright. The Materials are owned by TPC and/or its licensors, and are |
||||
protected by United States copyright laws and international treaty provisions. You may not |
||||
remove the copyright notice from the original or any copy of the Materials, and You must apply |
||||
the notice if You extract part of the Materials not bearing a notice. |
||||
7. Use of Name. You acknowledge and agree that TPC owns all trademark and trade |
||||
name rights in the names, trademarks and logos used by TPC in the Materials. User shall |
||||
preserve any notices regarding such ownership. User may only use such names, trademarks and |
||||
logos in accordance with the usage guidelines specified by the TPC Policies. |
||||
8. Merger or Integration. Any portion of the Materials merged into or integrated |
||||
with other software or documentation will continue to be subject to the terms and conditions of |
||||
this Agreement. |
||||
9. Limited Grants of Sublicense. You may distribute the Software as provided or |
||||
as modified as permitted under clause 5 of this Agreement, provided You comply with all of the |
||||
terms of this Agreement and the following conditions: |
||||
a. If You distribute any portion of the Software in its original form You may |
||||
do so only under this Agreement by including a complete copy of this Agreement with Your |
||||
distribution, and if You distribute the Software in modified form, You may only do so under a |
||||
license that at a minimum provides all of the protections and conditions of use contained within |
||||
this Agreement; |
||||
b. You must include on each copy of the Software that You distribute the |
||||
following legend in all caps, at the top of the label and license, and in a font not less than 12 |
||||
point and no less prominent than any other printing: “THE TPC SOFTWARE IS AVAILABLE |
||||
WITHOUT CHARGE FROM TPC.”; |
||||
c. You must retain all copyright, patent, trademark, and attribution notices |
||||
that are present in the Software; and |
||||
d. You may not generate revenue directly or indirectly (e.g., by charging |
||||
service fees) for distribution of the Software or of any modifications permitted under clause 5.c. |
||||
10. Term and Termination. |
||||
a. Term. The license granted to You is effective until terminated. |
||||
b. Termination. |
||||
i. By You. You may terminate this Agreement at any time by |
||||
returning the Materials (including any portions or copies thereof) to TPC or providing written |
||||
notice to the TPC that all copies of the Materials within Your custody or control have been |
||||
deleted or destroyed. |
||||
ii. By TPC. In the event You materially fail to comply with any term |
||||
or condition of this Agreement, and You fail to remedy such non-compliance within 30 days |
||||
after the receipt of notice to that effect, then TPC shall have the right to terminate this Agreement |
||||
immediately upon written notice at the end of such 30-day period. |
||||
c. Effect of Termination. Termination of this Agreement in accordance with |
||||
this clause 10 will not terminate the rights of end users sublicensed by You pursuant to this |
||||
Agreement. Moreover, upon termination and at TPC’s written request, You agree to either (1) |
||||
return the Materials (including any portions or copies thereof) to TPC or (2) immediately destroy |
||||
all copies of the Materials within Your custody or control and inform the TPC of the destruction |
||||
of the Materials. Upon termination, TPC may also enforce any rights provided by law. The |
||||
provisions of this Agreement that protect the proprietary rights of TPC and its Licensors will |
||||
continue in force after termination. |
||||
11. No Warranty; Materials Provided “As Is”. TO THE MAXIMUM EXTENT |
||||
PERMITTED BY APPLICABLE LAW, THE MATERIALS ARE PROVIDED “AS IS” AND |
||||
WITH ALL FAULTS, AND TPC (AND ITS LICENSORS) AND THE AUTHORS AND |
||||
DEVELOPERS OF THE MATERIALS HEREBY DISCLAIM ALL WARRANTIES, |
||||
REPRESENTATIONS AND CONDITIONS, EITHER EXPRESS, IMPLIED OR |
||||
STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES, |
||||
DUTIES OR CONDITIONS RELATING TO MERCHANTABILITY, FITNESS FOR A |
||||
PARTICULAR PURPOSE, ACCURACY OR COMPLETENESS OF RESPONSES, |
||||
RESULTS, WORKMANLIKE EFFORT, LACK OF VIRUSES, LACK OF NEGLIGENCE, |
||||
TITLE, QUIET ENJOYMENT, QUIET POSSESSION, CORRESPONDENCE TO |
||||
DESCRIPTION OR NONINFRINGEMENT. |
||||
USER RECOGNIZES THAT THE MATERIALS ARE THE RESULT OF A |
||||
COOPERATIVE, NON-PROFIT EFFORT AND THAT TPC DOES NOT CONDUCT A |
||||
TYPICAL BUSINESS. USER ACCEPTS THE MATERIALS “AS IS” AND WITHOUT ANY |
||||
WARRANTY, EXPRESS OR IMPLIED. |
||||
Without limitation, TPC (and its licensors) do not warrant that the functions contained in |
||||
the Software or Materials will meet Your requirements or that the operation of the Software will |
||||
be uninterrupted, error-free or free from malicious code. For purposes of this paragraph, |
||||
“malicious code” means any program code designed to contaminate other computer programs or |
||||
computer data, consume computer resources, modify, destroy, record, or transmit data, or in |
||||
some other fashion usurp the normal operation of the computer, computer system, or computer |
||||
network, including viruses, Trojan horses, droppers, worms, logic bombs, and the like. |
||||
TPC (and its licensors) shall not be liable for the accuracy of any information provided |
||||
by TPC or third-party technical support personnel, or any damages caused, either directly or |
||||
indirectly, by acts taken or omissions made by You as a result of such technical support. |
||||
You assume full responsibility for the selection of the Materials to achieve Your intended |
||||
results, and for the installation, use and results obtained from the Materials. You also assume the |
||||
entire risk as it applies to the quality and performance of the Materials. Should the Materials |
||||
prove defective, You (and not TPC) assume the entire liability of any and all necessary servicing, |
||||
repair or correction. |
||||
Some countries/states do not allow the exclusion of implied warranties, so the above |
||||
exclusion may not apply to You. TPC (and its licensors) further disclaims all warranties of any |
||||
kind if the Materials were customized, repackaged or altered in any way by any party other than |
||||
TPC (or its licensors). |
||||
12. Disclaimer of Liability. TPC (and its licensors) assumes no liability with respect |
||||
to the Materials, including liability for infringement of intellectual property rights, negligence, or |
||||
any other liability. TPC is not aware of any infringement of copyright or patent that may result |
||||
from its grant of rights to User of the Materials. If User receives any notice of infringement, such |
||||
notice shall be immediately communicated to TPC who will have sole discretion to take action to |
||||
evaluate the claim and, if practicable, modify the Materials as necessary to avoid infringement. |
||||
In the event that TPC determines that the Materials cannot be modified to avoid such |
||||
infringement (or any other infringement claim communicated to TPC), TPC may terminate this |
||||
Agreement immediately. User shall suspend use of the Materials until modifications to avoid |
||||
claims of infringement have been completed. User waives any claim against TPC in the event of |
||||
such infringement claims by others. |
||||
13. Export Assurance. Use and re-export of the Materials and related technical |
||||
information is subject to the Export Administration Regulations (EAR) of the United States |
||||
Department of Commerce. User hereby agrees that User (a) assumes responsibility for |
||||
compliance with the EAR in its use of the Materials and technical information, and (b) will not |
||||
export, re-export, or otherwise disclose directly or indirectly, the Materials, technical data, or any |
||||
direct product of the Materials or technical data in violation of the EAR. |
||||
14. Limitation of Remedies And Damages. IN NO EVENT WILL TPC OR ITS |
||||
LICENSORS OR LICENSEE BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL |
||||
OR CONSEQUENTIAL DAMAGES OR FOR ANY LOST PROFITS, LOST SAVINGS, LOST |
||||
REVENUES OR LOST DATA ARISING FROM OR RELATING TO THE MATERIALS OR |
||||
THIS AGREEMENT, EVEN IF TPC OR ITS LICENSORS OR LICENSEE HAVE BEEN |
||||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. IN NO EVENT WILL TPC’S OR |
||||
ITS LICENSORS’ LIABILITY OR DAMAGES TO YOU OR ANY OTHER PERSON EVER |
||||
EXCEED U.S. ONE HUNDRED DOLLARS (US $100), REGARDLESS OF THE FORM OF |
||||
THE CLAIM. IN NO EVENT WILL LICENSEE'S LIABILITY OR DAMAGES TO TPC OR |
||||
ANY OTHER PERSON EVER EXCEED $1,000,000, REGARDLESS OF THE FORM OF |
||||
THE CLAIM. Some countries/states do not allow the limitation or exclusion of liability for |
||||
incidental or consequential damages, so the above limitation or exclusion may not apply to You. |
||||
15. U.S. Government Restricted Rights. All Software and related documentation |
||||
are provided with restricted rights. Use, duplication or disclosure by the U.S. Government is |
||||
subject to restrictions as set forth in subdivision (b)(3)(ii) of the Rights in Technical Data and |
||||
Computer Software Clause at 252.227-7013. If You are using the Software outside of the United |
||||
States, You will comply with the applicable local laws of Your country, U.S. export control law, |
||||
and the English version of this Agreement. |
||||
16. Contractor/Manufacturer. The Contractor/Manufacturer for the Software is: |
||||
Transaction Processing Performance Council |
||||
572B Ruger Street, P.O. Box 29920 |
||||
San Francisco, CA 94129 |
||||
|
||||
17. General. This Agreement is binding on You as well as Your employees, |
||||
employers, contractors and agents, and on any successors and assignees. This Agreement is |
||||
governed by the laws of the State of California (except to the extent federal law governs |
||||
copyrights and trademarks) without respect to any provisions of California law that would cause |
||||
application of the law of another state or country. The parties agree that the United Nations |
||||
Convention on Contracts for the International Sale of Goods will not govern this Agreement. |
||||
This Agreement is the entire agreement between us regarding the subject matter hereof and |
||||
supersedes any other understandings or agreements with respect to the Materials or the subject |
||||
matter hereof. If any provision of this Agreement is deemed invalid or unenforceable by any |
||||
court having jurisdiction, that particular provision will be deemed modified to the extent |
||||
necessary to make the provision valid and enforceable, and the remaining provisions will remain |
||||
in full force and effect. |
||||
|
||||
|
||||
|
||||
|
||||
SPECIAL PROVISIONS APPLICABLE TO THE EUROPEAN UNION |
||||
|
||||
If You acquired the Materials in the European Union (EU), the following provisions also |
||||
apply to You. If there is any inconsistency between the terms of the Software License Agreement |
||||
set out earlier and the following provisions, the following provisions shall take precedence. |
||||
|
||||
1. Distribution. You may sublicense modifications of the Software covered in this |
||||
Agreement if they meet the requirements of clause 9 above. |
||||
2. Limited Warranty. EXCEPT AS STATED EARLIER IN THIS AGREEMENT, AND |
||||
AS PROVIDED UNDER THE HEADING “STATUTORY RIGHTS”, THE SOFTWARE IS |
||||
PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR |
||||
IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES, |
||||
NONINFRINGEMENT, OR CONDITIONS OF MERCHANTABILITY, QUALITY AND |
||||
FITNESS FOR A PARTICULAR PURPOSE. |
||||
3. Limitation of Remedy and Damages. THE LIMITATIONS OF REMEDIES AND |
||||
DAMAGES IN THE SOFTWARE LICENSE AGREEMENT SHALL NOT APPLY TO |
||||
PERSONAL INJURY (INCLUDING DEATH) TO ANY PERSON CAUSED BY TPC’S |
||||
NEGLIGENCE AND ARE SUBJECT TO THE PROVISION SET OUT UNDER THE |
||||
HEADING “STATUTORY RIGHTS”. |
||||
4. Statutory Rights: Irish law provides that certain conditions and warranties may be |
||||
implied in contracts for the sale of goods and in contracts for the supply of services. Such |
||||
conditions and warranties are hereby excluded, to the extent such exclusion, in the context of this |
||||
transaction, is lawful under Irish law. Conversely, such conditions and warranties, insofar as they |
||||
may not be lawfully excluded, shall apply. Accordingly nothing in this Agreement shall |
||||
prejudice any rights that You may enjoy by virtue of Sections 12, 13, 14 or 15 of the Irish Sale of |
||||
Goods Act 1893 (as amended). |
||||
5. General. This Agreement is governed by the laws of the Republic of Ireland. The local |
||||
language version of this agreement shall apply to Materials acquired in the EU. This Agreement |
||||
is the entire agreement between us with respect to the subject matter hereof and You agree that |
||||
TPC will not have any liability for any untrue statement or representation made by it, its agents |
||||
or anyone else (whether innocently or negligently) upon which You relied upon entering this |
||||
Agreement, unless such untrue statement or representation was made fraudulently. |
||||
|
||||
|
||||
|
||||
|
||||
-7- |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,993 @@ |
||||
# @(#) BUGS 2.1.8.20@(#) |
||||
# The following is a list of the various DBGEN/QGEN bugs that have been |
||||
# and are being fixed. Each entry is of the form: |
||||
# |
||||
# Problem #xx: STATUS -- MR ID and OPEN/closed |
||||
# followed by a detailed explanation |
||||
# TYPE: -- classification of the bug or issue |
||||
# SPEC FIX: -- details of any change to the spec |
||||
# DBGEN FIX: -- details of any change needed to QGEN/DBGEN |
||||
# ANSWER SETS: -- any effect on answer sets |
||||
# WORKAROUND: -- temporary fix, if available |
||||
# HELP NEEDED: -- any work/assistance required |
||||
# AUDITORS NOTIFIED: -- date auditors were notified, if appropriate |
||||
# OPENED AGAINST: -- date and effected versions |
||||
# CLOSED IN: -- date and fixed version |
||||
# |
||||
# OPEN BUGS |
||||
# ========== |
||||
# Problem #33: Parallel load doesn't work under NT |
||||
# |
||||
# OPEN Feature Requests |
||||
# ================= |
||||
# Problem #9: would like to include answer set formatting in query templates |
||||
# Problem #37: need way to validate DBGEN without large storage requriement |
||||
# Problem #58: Need way to track changes from one release to the next |
||||
# |
||||
# OPEN Documentation Errors |
||||
# ================= |
||||
# None |
||||
#--------------------------------------------------------------------- |
||||
#Complete Bug List |
||||
#================== |
||||
Problem #1: closed |
||||
Summary: Q10 returns no rows |
||||
Since orders can only be returned (l_returnflag = 'R') after they |
||||
have been received, and can't be received in the future, the |
||||
number of permissible orders for query 10 tails off early in |
||||
1995. If you are lucky enough to get a parameter substitution |
||||
after February '95 (allowed in 2.12.3), things can go "quickly". |
||||
SEVERITY: |
||||
SPEC FIX: replace 2.12.3 (1) with "DATE is the first day in a |
||||
rundomly selected month between the first month of 1993 and the |
||||
last month of 1994" |
||||
DBGEN FIX: change permisible substitution range for query 10, |
||||
parameter 1 |
||||
ANSWER SETS: not effected. |
||||
WORKAROUND: use a different seed for qgen parameter substitution |
||||
HELP NEEDED: |
||||
AUDITORS NOTIFIED: |
||||
OPENED AGAINST: 1.0 |
||||
CLOSED IN: 1.0.1 (dbgen and qgen) |
||||
|
||||
Problem #2: closed |
||||
Summary: parallelism in load to gen differing data sets |
||||
the parallel load code was based on extensible data sets; since |
||||
each "extension" made an assumption of scale factor, the data |
||||
could end up clustered. Further, since the RNG is |
||||
self-modifying, different numbers of extension led to different |
||||
final data sets. |
||||
SEVERITY: |
||||
SPEC FIX: none. |
||||
DBGEN FIX: remove -E(xtensible) option and implement pure parallel |
||||
load with a known scale factor; rebuild seed files |
||||
ANSWER SETS: not effected. (parallelism not implemented for SF <= 1) |
||||
WORKAROUND: don't use the parallel load (-C) option to DBGEN |
||||
HELP NEEDED: testers needed. |
||||
AUDITORS NOTIFIED: yes. |
||||
OPENED AGAINST: 1.0 |
||||
CLOSED IN: 1.0.1 |
||||
|
||||
Problem #3: closed |
||||
Summary: some arithmetic tends to overflow at large SF |
||||
retailprice tends to SF/10 as SF increases. this can lead to |
||||
data corruption in extendedprice and aggregate calculations |
||||
SEVERITY: |
||||
SPEC FIX: will need rework of 1.3 wrt retailprice calculation |
||||
DBGEN FIX: modification to second term of rpb_routine() calcuation |
||||
to limit contibution of second term to the maximum seen at |
||||
SF=.1 |
||||
ANSWER SETS: not effected |
||||
WORKAROUND: code retail/extended price calculations as long long; |
||||
build smaller data sets |
||||
HELP NEEDED: |
||||
AUDITORS NOTIFIED: |
||||
OPENED AGAINST: 1.0 |
||||
CLOSED IN: 1.0.1 |
||||
|
||||
Problem #4: closed |
||||
Summary: dbgen not ported to NT |
||||
SEVERITY: |
||||
SPEC FIX: none |
||||
DBGEN FIX: need to roll in changes supplied by IBM |
||||
ANSWER SETS: not effected |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: N/A |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 1.0 |
||||
CLOSED IN: 1.1.0 |
||||
|
||||
Problem #5: closed |
||||
Summary: QGEN seed init inconsistent |
||||
A prior fix assured that parameter values were query order |
||||
independent when a seed was provided on the command line. need |
||||
to make this true when no seed is provided |
||||
SEVERITY: |
||||
SPEC FIX: none |
||||
DBGEN FIX: rework seed init loop in qgen.c |
||||
ANSWER SETS: not effected |
||||
WORKAROUND: supply seeds on command line |
||||
HELP NEEDED: none |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 1.0 |
||||
CLOSED IN: 1.0.1 |
||||
|
||||
Problem #6: closed |
||||
Summary: command line options with abutting arguments mishandled |
||||
SEVERITY: |
||||
SPEC FIX: none |
||||
DBGEN FIX: minor fix to getopt routine in bm_utils.c |
||||
ANSWER SETS: not effected |
||||
WORKAROUND: separate options and arguments with a space |
||||
HELP NEEDED: none |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 1.0 |
||||
CLOSED IN: 1.0.1 |
||||
|
||||
Problem #7: closed |
||||
Summary: '-O f' asking for new file names twice |
||||
SEVERITY: |
||||
SPEC FIX: none |
||||
DBGEN FIX: rework of set_files() in driver.c |
||||
ANSWER SETS: not effected |
||||
WORKAROUND: none |
||||
HELP NEEDED: none |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 1.0 |
||||
CLOSED IN: 1.0.1 |
||||
|
||||
Problem #8: closed |
||||
Summary: Seed generation taking too long |
||||
SEVERITY: |
||||
SPEC FIX: N/A |
||||
DBGEN FIX: implement "skip and trudge" as discussed |
||||
ANSWER SETS: not effected |
||||
WORKAROUND: none |
||||
HELP NEEDED: |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 1.0 |
||||
CLOSED IN: 1.0.1 |
||||
|
||||
Problem #9: OPEN |
||||
Summary: would like to include answer set formatting in query templates |
||||
SEVERITY: feature request |
||||
SPEC FIX: none |
||||
DBGEN FIX: additional flag in qgen() |
||||
ANSWER SETS: not effected |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: asked for reproduction info 25 Oct 95 |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 1.0 |
||||
CLOSED IN: |
||||
|
||||
Problem #10: closed |
||||
Summary: need to re-introduce ability to do incremental, flat file builds |
||||
SEVERITY: feature request |
||||
SPEC FIX: none |
||||
DBGEN FIX: add -S(tep) option to build one of many partial data sets |
||||
ANSWER SETS: not effected |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 1.0 |
||||
CLOSED IN: 1.0.1 |
||||
|
||||
Problem #11: closed |
||||
Summary: Row count for first delete at 10/100 is incorrect |
||||
SEVERITY: Error |
||||
SPEC FIX: None |
||||
DBGEN FIX: |
||||
ANSWER SETS: No Effect |
||||
WORKAROUND: hand edit of first delete file |
||||
HELP NEEDED: |
||||
AUDITORS NOTIFIED: No |
||||
OPENED AGAINST: 1.0.1 |
||||
CLOSED IN: 2.0.0 (not sure of precise release) |
||||
CLOSED BY: jms@gradientsystems.com |
||||
|
||||
Problem #12: closed |
||||
Summary: Bad default rowcount generated for query 17 |
||||
SEVERITY: Error |
||||
SPEC FIX: None |
||||
DBGEN FIX: corrected rowcnt[] entries to be 1-based |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: hand edit query or add explicit row count to template |
||||
HELP NEEDED: |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 1.0.0 |
||||
CLOSED IN: 1.1.0 |
||||
|
||||
Problem #13: closed |
||||
Summary: Bad expansion of SET_OUTPUT for Teradata |
||||
SEVERITY: Error |
||||
SPEC FIX: N/A |
||||
DBGEN FIX: new macro in tpcd.h |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: Hand edit query or hardcode output directive in templates |
||||
HELP NEEDED: |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 1.0.1 |
||||
CLOSED IN: 1.1.0 |
||||
|
||||
Problem #14: closed |
||||
Summary: Badly formed range deletes |
||||
SEVERITY: Error |
||||
SPEC FIX: N/A |
||||
DBGEN FIX: TBD |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: hand edit delete files |
||||
HELP NEEDED: asked for reproduction info 25 Oct 95 |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 1.0.1 |
||||
CLOSED IN: 2.0.0 (not sure of precise release) |
||||
CLOSED BY: jms@gradientsystems.com |
||||
|
||||
Problem #15: closed |
||||
Summary: in a multi-stage load, parent tables are not properly named |
||||
when parent and child are build simultaneously |
||||
SEVERITY: Error |
||||
SPEC FIX: N/A |
||||
DBGEN FIX: reworked tdef[].name in pr_X_Y routines for master/detail |
||||
tables |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: Build master/detail tables separately |
||||
HELP NEEDED: |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 1.0.1 |
||||
CLOSED IN: 1.1.0 |
||||
|
||||
Problem #16: closed |
||||
Summary: update generation at large scale factors produced the wrong number |
||||
of rows due to overflow of 32-bit integer |
||||
SEVERITY: BUG |
||||
SPEC FIX: N/A |
||||
DBGEN FIX: corrected order of operations in row count calcuation in |
||||
driver.c |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: use 64 bit integers |
||||
HELP NEEDED: None |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 1.0.1 |
||||
CLOSED IN: 1.1.0 |
||||
|
||||
Problem #17: closed |
||||
Summary: comment fields may be truncated when using columnar output, due to |
||||
rounding/truncation in the length calculation |
||||
SEVERITY: BUG |
||||
SPEC FIX: N/A |
||||
DBGEN FIX: add ceil() calls around all PR_VSTR() calls in print.c |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: None |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 1.0.1 |
||||
CLOSED IN: 1.1.0 |
||||
|
||||
Problem #18: closed |
||||
Summary: the output format for identifier fields in columnar output is |
||||
unneccessarily large, and is inconsistant |
||||
SEVERITY: minor |
||||
SPEC FIX: N/A |
||||
DBGEN FIX: revised PR_BCD2 macro |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: avoid columnar output, or rework macro |
||||
HELP NEEDED: none |
||||
AUDITORS NOTIFIED: no |
||||
OPENED AGAINST: 1.1.0 |
||||
OPENED BY: jenn@torolab2.vnet.ibm.com |
||||
CLOSED IN: 1.1.0A |
||||
CLOSED BY: jms@informix.com |
||||
|
||||
Problem #19: closed |
||||
Summary: the case statement used to decipher substitution points in the |
||||
query template allowed extraneous :'s to re-initialize the |
||||
parameter substitution |
||||
SEVERITY: bug |
||||
SPEC FIX: N/A |
||||
DBGEN FIX: rework flag switch in qgen.c to explicitly call out numerics |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: be sure that there are no "unknown" flags in the template |
||||
HELP NEEDED: none |
||||
AUDITORS NOTIFIED: yes |
||||
OPENED AGAINST: 1.0.1 |
||||
OPENED BY: jenn@torolab2.vnet.ibm.com |
||||
CLOSED IN: 1.1.0A |
||||
CLOSED BY: jms@informix.com |
||||
|
||||
Problem #20: closed |
||||
Summary: parameter substitution values were not effected by small changes |
||||
in seed values |
||||
SEVERITY: bug |
||||
SPEC FIX: N/A |
||||
DBGEN FIX: add UnifInt() calls to RNG init in qgen.c |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: be sure seed values provide sufficient randomness in EQT |
||||
HELP NEEDED: none |
||||
AUDITORS NOTIFIED: yes |
||||
OPENED AGAINST: 1.1.0 |
||||
OPENED BY: alain_crolotte@elsegundoca.attgis.com |
||||
CLOSED IN: 1.1.0B |
||||
CLOSED BY: jms@informix.com |
||||
|
||||
Problem #21: closed |
||||
Summary: parameter logging doesn't properly handle the variable length of |
||||
the substitution list |
||||
SEVERITY: bug |
||||
SPEC FIX: N/A |
||||
DBGEN FIX: assure null termination of param list and bound the output |
||||
loop that logs parameter usage |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: none |
||||
HELP NEEDED: none |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 1.1.0B |
||||
OPENED BY: |
||||
CLOSED IN: 1.1.0C |
||||
CLOSED BY: jms@informix.com |
||||
|
||||
Problem #22: closed |
||||
Summary: parameter output for Q11 can overflow default formatting at very |
||||
large volumes |
||||
SEVERITY: bug |
||||
SPEC FIX: N/A |
||||
DBGEN FIX: expand format string to %11.10f |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: hand code queries for large volumes |
||||
HELP NEEDED: none |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 1.1.0B |
||||
OPENED BY: francois@ip.com |
||||
CLOSED IN: 1.1.0C |
||||
CLOSED BY: jms@informix.com |
||||
|
||||
Problem #23: closed |
||||
Summary: typos in variant 14c |
||||
SEVERITY: |
||||
SPEC FIX: N/A |
||||
DBGEN FIX: corrected query template |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: none |
||||
HELP NEEDED: none |
||||
AUDITORS NOTIFIED: no |
||||
OPENED AGAINST: 1.1.0B |
||||
OPENED BY: francois@ip.com |
||||
CLOSED IN: 1.1.0C |
||||
CLOSED BY: jms@informix.com |
||||
|
||||
Problem #24: closed |
||||
Summary: macro PR_DATE was hard-coded to print t->alpha even though a |
||||
target was passed in as a parameter |
||||
SEVERITY: minor |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: re-worked macro to properly use its arguments |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: none |
||||
HELP NEEDED: none |
||||
AUDITORS NOTIFIED: no |
||||
OPENED AGAINST: 1.1.0A |
||||
OPENED BY: Robert.Lane@eng.sun.com |
||||
CLOSED IN: dbgen 1.1.0B |
||||
CLOSED BY: jms@informix.com |
||||
|
||||
Problem #25: closed |
||||
Summary: typos in variant 10a |
||||
SEVERITY: |
||||
SPEC FIX: N/A |
||||
DBGEN FIX: corrected query template |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: none |
||||
HELP NEEDED: none |
||||
AUDITORS NOTIFIED: no |
||||
OPENED AGAINST: 1.1.0B |
||||
OPENED BY: francois@ip.com |
||||
CLOSED IN: 1.1.0C |
||||
CLOSED BY: jms@informix.com |
||||
|
||||
Problem #26: closed |
||||
Summary: the version numbers for QGEN and DBGEN do not match |
||||
SEVERITY: minor |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: unified version numbers starting with 1.1.0C |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: none |
||||
AUDITORS NOTIFIED: no |
||||
OPENED AGAINST: 1.1.0B (or 1.1.0C, depending) |
||||
OPENED BY: Robert.Lane@eng.sun.com |
||||
CLOSED IN: 1.1.0C |
||||
CLOSED BY: jms@informix.com |
||||
|
||||
Problem #27: closed |
||||
Summary: correcting typos in 7, 9, 13 |
||||
SEVERITY: minor |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: fixed them |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: none |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 1.1.0C (pre-release) |
||||
OPENED BY: tblank@vnet.ibm.com |
||||
CLOSED IN: 1.1.0C |
||||
CLOSED BY: jms@informix.com |
||||
|
||||
Problem #28: closed |
||||
Summary: Seed generation fails with SF > 1000 due to 32 bit integer |
||||
arithmetic used to verify "divisible-ness" of data set |
||||
SEVERITY: bug |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: TBD |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: none |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 1.1.0C |
||||
OPENED BY: alain_colotte@elsegundoca.ncr.com |
||||
CLOSED IN: 1.3.0 |
||||
CLOSED BY: jms@gradientsystems.com |
||||
|
||||
Problem #29: closed |
||||
Summary: Compile time errors on Solaris 2.5.1 and SunOS |
||||
SEVERITY: bug |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: Solaris fixed by renaming lineitem field from extended to |
||||
eprice; SunOS problem documented in Porting.Notes |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: N/A |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 1.1.0D |
||||
OPENED BY: jms@informix.com |
||||
CLOSED IN: 1.2.0 |
||||
CLOSED BY: jms@informix.com |
||||
|
||||
Problem #30: closed |
||||
Summary: Cryptic comments in dists.dss |
||||
SEVERITY: flaw |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: Cleaned up the comments in the file |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: N/A |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 1.2.0 |
||||
OPENED BY: francois@sizing.com |
||||
CLOSED IN: 1.2.3 ALPHA 1 |
||||
CLOSED BY: jms@informix.com |
||||
|
||||
Problem #31: closed |
||||
Summary: Inconsistant handling of fopen() failures |
||||
SEVERITY: bug |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: introduced OPEN_CHECK macro (defined in dss.h) |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: none |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 1.2.0 |
||||
OPENED BY: schiefer@ca.ibm.com |
||||
CLOSED IN: 1.3.0 |
||||
CLOSED BY: jms@gradientsystems.com |
||||
|
||||
Problem #32: closed |
||||
Summary: Path separators were hard-coded |
||||
SEVERITY: bug |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: introduced PATH_SEP in config.h |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: none |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 1.2.0 |
||||
OPENED BY: |
||||
CLOSED IN: 1.3.0 |
||||
CLOSED BY: jms@gradientsystems.com |
||||
|
||||
Problem #33: OPEN |
||||
Summary: Parallel load doesn't work under NT |
||||
SEVERITY: bug |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: use -S option to build each step independently |
||||
HELP NEEDED: none |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 1.1.0 |
||||
OPENED BY: |
||||
CLOSED IN: |
||||
CLOSED BY: |
||||
|
||||
Problem #34: closed |
||||
Summary: P_NAME not properly populated |
||||
SEVERITY: bug |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: Corrected color selection logic in agg_str() |
||||
ANSWER SETS: NFI for 1.x since it effect answer sets |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: None |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 1.2.3 |
||||
OPENED BY: schiefer@ca.ibm.com |
||||
CLOSED IN: 2.0.0 |
||||
CLOSED BY: jms@gradientsystems.com |
||||
|
||||
Problem #35: closed |
||||
Summary: mk_sparse() returning bad orderkeys |
||||
SEVERITY: bug |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: corrected logic in mk_sparse() and bcd2_bin() |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: None |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 1.3.0 |
||||
OPENED BY: jennc@ca.ibm.com |
||||
CLOSED IN: 1.3.1 |
||||
CLOSED BY: jms@gradientsystems.com |
||||
|
||||
Problem #36: closed |
||||
Summary: a_rnd() doesn't mask properly, uses small 'alphabet' |
||||
SEVERITY: bug |
||||
SPEC FIX: Corrected 4.2.2.6 to reflect 64 character set |
||||
SOURCE FIX: changed mask in a_rnd() from 067 to 077 |
||||
ANSWER SETS: NFI for 1.x since answers would be effected |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: None |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 1.2.3 |
||||
OPENED BY: pek@elsegundoca.ncr.com |
||||
CLOSED IN: 2.0.0 |
||||
CLOSED BY: jms@gradientsystems.com |
||||
|
||||
Problem #37: OPEN |
||||
Summary: need way to validate DBGEN without large storage requriement |
||||
SEVERITY: Feature Request |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: Provide vrf_xxx routine to generate checksums |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: None |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 1.2.3 |
||||
OPENED BY: jms@gradientsystems.com |
||||
CLOSED IN: |
||||
CLOSED BY: |
||||
|
||||
Problem #38: closed |
||||
Summary: need to be able to generate specific update set |
||||
SEVERITY: Feature Request |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: Update update generation to use -S <n> option |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: None |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 1.3.1 |
||||
OPENED BY: jennc@ca.ibm.com |
||||
CLOSED IN: 2.0.0 (not certain of fix version) |
||||
CLOSED BY: jms@gradientsystems.com |
||||
|
||||
Problem #39: closed |
||||
Summary: README for dbgen is out of date |
||||
SEVERITY: Documentation error |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: Rewrite of README |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: None |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 2.0.0.6b |
||||
OPENED BY: jennc@ca.ibm.com |
||||
CLOSED IN: 2.0.0 |
||||
CLOSED BY: jms@gradientsystems.com |
||||
|
||||
Problem #40: closed |
||||
Summary: O_CUSTKEY is generated out of range at 10GB |
||||
SEVERITY: Bug |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: Correction of CUST_MORTALITY calculation |
||||
ANSWER SETS: Unknown |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: None |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 2.0.0.7 |
||||
OPENED BY: wayne.smith@intel.com |
||||
CLOSED IN: 2.0.0.8 |
||||
CLOSED BY: jms@gradientsystems.com |
||||
|
||||
Problem #41: closed |
||||
Summary: V2 appears slower than V1 |
||||
SEVERITY: Bug |
||||
SPEC FIX: |
||||
SOURCE FIX: Used NthElement() in row_stop() |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: None |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 2.0.0.8 |
||||
OPENED BY: jennc@ca.ibm.com |
||||
CLOSED IN: 2.01a |
||||
CLOSED BY: jms@gradientsystems.com |
||||
|
||||
Problem #42: closed |
||||
Summary: Dual declaration of articles causes C++ compilation error |
||||
SEVERITY: Bug |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: Duplicate declaration removed |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: None |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 2.0.0 |
||||
OPENED BY: jpm@informix.com |
||||
CLOSED IN: 2.0.0a |
||||
CLOSED BY: jms@gradientsystems.com |
||||
|
||||
Problem #43: closed |
||||
Summary: Subselect wild card not consistant with spec |
||||
SEVERITY: Bug |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: Query templates corrected |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: None |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 2.0.0 |
||||
OPENED BY: jpm@informix.com |
||||
CLOSED IN: 2.0.0a |
||||
CLOSED BY: jms@gradientsystems.com |
||||
|
||||
Problem #44: closed |
||||
Summary: small money values incorrect |
||||
SEVERITY: Bug |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: reworked PR_xxx macros |
||||
ANSWER SETS: new answer included for Q22 |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: None |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 2.0.0 |
||||
OPENED BY: ac4@elsegundoca.ncr.com |
||||
CLOSED IN: 1.0.1 |
||||
CLOSED BY: jms@gradientsystems.com |
||||
|
||||
Problem #45: closed |
||||
Summary: L_ORDERKEY/O_ORDERKEY incorrect |
||||
SEVERITY: Bug |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: corrected pointer arithmetic in print.c |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: None |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 1.0.1 |
||||
OPENED BY: jpm@informix.com |
||||
CLOSED IN: 1.0.1a |
||||
CLOSED BY: jms@gradientsystems.com |
||||
|
||||
Problem #46: closed |
||||
Summary: L_ORDERKEY/O_ORDERKEY incorrect |
||||
SEVERITY: Dup (see #45) |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: N/A |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: None |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 1.0.1 |
||||
OPENED BY: jennc@ca.ibm.com |
||||
CLOSED IN: 1.0.1a |
||||
CLOSED BY: jms@gradientsystems.com |
||||
|
||||
Problem #47: closed |
||||
Summary: QGEN parameter substitution not random |
||||
SEVERITY: BUG |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: corrected varsub RANDOM usage to reflect seed file removal |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: None |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 1.0.1 |
||||
OPENED BY: wayne.smith@intel.com |
||||
CLOSED IN: 1.0.1a |
||||
CLOSED BY: jms@gradientsystems.com |
||||
|
||||
Problem #48: closed |
||||
Summary: QGEN parameter substitution not random for Q21 |
||||
SEVERITY: BUG |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: corrected varsub to only reference nations2 distribution |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: None |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 1.0.1a |
||||
OPENED BY: wayne.smith@intel.com |
||||
CLOSED IN: 1.0.1b |
||||
CLOSED BY: jms@gradientsystems.com |
||||
|
||||
Problem #49: closed |
||||
Summary: Extraneous trailing separator in delete files |
||||
SEVERITY: BUG |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: special-cased the handling of deletes using PR_KEY |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: None |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 1.0.1b |
||||
OPENED BY: wayne.smith@intel.com |
||||
CLOSED IN: 1.0.1c |
||||
CLOSED BY: jms@gradientsystems.com |
||||
|
||||
Problem #50: closed |
||||
Summary: qgen not generating valid parameter log files for defaults |
||||
SEVERITY: BUG |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: corrected params/default reference |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: None |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 1.0.1 |
||||
OPENED BY: cta@elsegundoca.ncr.com |
||||
CLOSED IN: 1.0.1d |
||||
CLOSED BY: jms@gradientsystems.com |
||||
|
||||
Problem #51: closed |
||||
Summary: inconistent/invariant substitutions in Q16, Q17, Q19 |
||||
SEVERITY: BUG |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: corrected "brand" selection to make order irrelevent |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: None |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 1.0.1 |
||||
OPENED BY: jennc@ca.ibm.com |
||||
CLOSED IN: 1.0.1d |
||||
CLOSED BY: jms@gradientsystems.com |
||||
|
||||
Problem #52: closed |
||||
Summary: qgen seeds make parameter substitutions position dependant |
||||
The current scheme uses an individual RNG stream for each query, and seeds |
||||
all streams identically. Accordingly, two queries that use the same domain |
||||
for the same parameter will always have the same value (e.g., q9 and q20). |
||||
SEVERITY: BUG |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: seed the individual streams with the sequence of random |
||||
numbers produced by the global seed value |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: None |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 990708 |
||||
OPENED BY: jennc@ca.ibm.com |
||||
CLOSED IN: 1.0.1a/1.1.0a (990727) |
||||
CLOSED BY: jms@gradientsystems.com |
||||
CHECKED BY: qa52 |
||||
|
||||
Problem #53: closed |
||||
Summary: number of lineitems in update files no longer varies |
||||
The RNG is not being set at the start of update generation; accordingly |
||||
the original data (including rowcounts) is being "regenerated" |
||||
SEVERITY: |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: None |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 990708 |
||||
OPENED BY: jennc@ca.ibm.com |
||||
CLOSED IN: 990810 |
||||
CLOSED BY: jms@gradientsystems.com |
||||
CHECKED BY: qa53 |
||||
|
||||
Problem #54: closed |
||||
Summary: segmented update files fail when rows per file is small |
||||
A round off error could cause the wrong number of rows to be output to a |
||||
given update file |
||||
SEVERITY: BUG |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: correction to driver.c and print.c to use division and modulo |
||||
to produce comparably sized files regardless of divisor |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: None |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 990708 |
||||
OPENED BY: v-larryk@microsoft.com |
||||
CLOSED IN: 1.0.1a/1.1.0a (990727) |
||||
CLOSED BY: jms@gradientsystems.com (using code from larry) |
||||
CHECKED BY: |
||||
|
||||
Problem #55: closed |
||||
Summary: -S <n> generates bad data when used with updates |
||||
The RNG is not being properly set |
||||
SEVERITY: BUG |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: added the appropriate offset to the RNG, and simplified the |
||||
update generation code |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: None |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 990708 |
||||
OPENED BY: jms@gradientsystems.com |
||||
CLOSED IN: 990816 |
||||
CLOSED BY: jms@gradientsystems.com (using code from larry) |
||||
CHECKED BY: qa55 |
||||
|
||||
Problem #56: closed |
||||
Summary: Need way to specify dists.dss location on the command line |
||||
SEVERITY: FEATURE |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: added -b switch to driver.c and qgen.c |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: None |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 990708 |
||||
OPENED BY: clevine@microsoft.com |
||||
CLOSED IN: 990830 |
||||
CLOSED BY: jms@gradientsystems.com |
||||
CHECKED BY: N/A |
||||
|
||||
Problem #57: closed |
||||
Summary: Need way to remove all DBGEN output unless there is an error |
||||
SEVERITY: FEATURE |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: added -q switch to driver.c and changed verbose if's |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: None |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 990708 |
||||
OPENED BY: clevine@microsoft.com |
||||
CLOSED IN: 990830 |
||||
CLOSED BY: jms@gradientsystems.com |
||||
CHECKED BY: N/A |
||||
|
||||
Problem #00058: OPEN |
||||
Summary: Need way to track changes from one release to the next |
||||
SEVERITY: FEATURE |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: reintroduce and automate the CHANGES file. Require MRs for |
||||
all source code changes |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: None |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 990708 |
||||
OPENED BY: mpoess@us.oracle.com |
||||
CLOSED IN: |
||||
CLOSED BY: |
||||
CHECKED BY: |
||||
|
||||
Problem #00059: closed |
||||
Summary: extra comma in Q2 template |
||||
SEVERITY: BUG |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: Template corrected |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: None. |
||||
HELP NEEDED: None. |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 990830 |
||||
OPENED BY: jpm@informix.com |
||||
CLOSED ON: 990908 |
||||
CLOSED BY: jms@gradientsystems.com |
||||
CHECKED BY: N/A |
||||
|
||||
|
||||
Problem #00060: closed |
||||
Summary: segmented inserts/deletes creating an extra file |
||||
SEVERITY: BUG |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: Adding in missed change from original roll-in |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: N/A |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 990830 |
||||
OPENED BY: larryk@microsoft.com |
||||
CLOSED ON: 990111 |
||||
CLOSED BY: jms@gradientsystems.com |
||||
CHECKED BY: N/A |
||||
|
||||
Problem #00061: closed |
||||
Summary: 64-bit support under DigUnix leads to math errors |
||||
SEVERITY: BUG |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: Calculation of dRange in rnd.c now uses double cast |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: N/A |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 990830 |
||||
OPENED BY: nramesh@us.oracle.com |
||||
CLOSED ON: 000131 |
||||
CLOSED BY: jms@gradientsystems.com |
||||
CHECKED BY: N/A |
||||
|
||||
Problem #00062: closed |
||||
Summary: bad update rollover after 1000 refreshes |
||||
This test uses tpcH scale 0.01. We've encountered |
||||
an situation in which dbgen doesn't generate |
||||
the correct data for delete files delete.1000 and |
||||
above. In particular, file delete.1000 contains |
||||
keys to be deleted that have never been loaded. |
||||
Because of this problem, keys that should have been |
||||
deleted never are causing duplicate unique values |
||||
to appear in the incremental loads after we cycle |
||||
from the 4000th incremental update back around starting |
||||
again with the 1st one. |
||||
SEVERITY: BUG |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: N/A |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: N/A |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 19991101 |
||||
OPENED BY: Roger.McNicol@sybase.com |
||||
CLOSED ON: 20000509 |
||||
CLOSED BY: jms |
||||
CHECKED BY: N/A |
||||
|
||||
Problem #00063: closed |
||||
Summary: update copyright notice |
||||
N/A |
||||
SEVERITY: BUG |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: N/A |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: N/A |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: N/A |
||||
OPENED BY: jms@gradientsystems.com |
||||
CLOSED ON: 20000131 |
||||
CLOSED BY: jms@gradientsystems.com |
||||
CHECKED BY: N/A |
||||
|
||||
Problem #00064: closed |
||||
Summary: permute() introduce 0 selection in [1..50] for q16 |
||||
N/A |
||||
SEVERITY: BUG |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: rework permute() to be 1-based |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: N/A |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 20000413 |
||||
OPENED BY: lorna@permetrics.com |
||||
CLOSED ON: 20000414 |
||||
CLOSED BY: jms@gradientsystems.com |
||||
CHECKED BY: N/A |
||||
|
||||
Problem #00065: OPEN |
||||
Summary: permute correction caused dataset changes |
||||
initial fix for #64 caused qa failures due to data set changes. New fix |
||||
is limited to query parameter substitution changes and has passed qa |
||||
SEVERITY: BUG |
||||
SPEC FIX: N/A |
||||
SOURCE FIX: N/A |
||||
ANSWER SETS: N/A |
||||
WORKAROUND: N/A |
||||
HELP NEEDED: N/A |
||||
AUDITORS NOTIFIED: N/A |
||||
OPENED AGAINST: 20000511 |
||||
OPENED BY: jms |
||||
CLOSED ON: N/A |
||||
CLOSED BY: N/A |
||||
CHECKED BY: N/A |
||||
|
||||
*********** |
||||
this file has been superceded by the bug tracking system available to |
||||
TPC members at: |
||||
www2.gradient system.com |
||||
*********** |
@ -0,0 +1,535 @@ |
||||
# @(#)HISTORY 2.1.8.3 |
||||
Changes as of 10/11/99 |
||||
-- versions: TPCH 1.2.0a, TPCR 1.1.0a |
||||
-- Correction to segmented updates that was causing extra file to be |
||||
generated |
||||
-- Porting changes for DigUnix |
||||
Changes as of 08/28/99 |
||||
-- versions: TPCH 1.2.0, TPCR 1.1.0 |
||||
-- reduced parameter substitution range for Q18 |
||||
-- added new option to specify location of dists file (-b) |
||||
-- added DBGEN option to suppress all output (-q) |
||||
Changes as of 08/16/99 |
||||
-- versions: TPCH 1.1.0a, TPCR 1.0.1e |
||||
-- prevent "reuse" of original data in update files |
||||
-- correction to lint target in makefile.suite |
||||
-- removal of vestigal l_partkey predicate from 21.sql |
||||
-- reorder lineitem/order join in q5 |
||||
-- removal of table aliases from 2.sql |
||||
-- randomize seeding of qgen RNG to close bug 52 |
||||
-- correct possible round off error in segmented update files |
||||
-- corrected soft copy answer set for Q22 |
||||
-- corrected percision of answer set for Q19 |
||||
Changes as of 07/08/99 |
||||
-- versions: TPCH 1.1.0, TPCR 1.0.1 |
||||
-- WORKLOAD must be set to either TPCH or TPCR in the makefile |
||||
-- unneeded reference to part table removed from q21 template |
||||
Changes as of 06/04/99 |
||||
-- version 1.0.1d |
||||
-- Restarted version numbering to match specification revisions for |
||||
TPC-H and TPC-R |
||||
-- Corrected answer set for for Q13 |
||||
-- Corrected parameter substitutions for Q16, Q17, Q19, Q20, Q21, Q22 |
||||
-- Corrected RNG initialization in qgen.c |
||||
-- added adhoc.c adhoc.h to code base to support randomized data sets; |
||||
currently disabled |
||||
-- replaced calls to UnifInt() row_stop with call to NthElement() |
||||
-- Corrected a problem that caused small negative money values to print as |
||||
a positive value |
||||
-- Simplication of PR_xxx macros |
||||
-- QGEN building correct parameter logs again |
||||
|
||||
****************** |
||||
* NOTE NOTE NOTE * |
||||
****************** |
||||
Below this line the file refers to TPC-D which was retired in favor of |
||||
TPC-H and TPC-R. Since the new speicifications are numbered from 1.0.0 |
||||
the program version was reset. |
||||
****************** |
||||
* NOTE NOTE NOTE * |
||||
****************** |
||||
|
||||
Changes as of 01/05/99 |
||||
-- version 2.0.1 |
||||
-- added 1999 to the copyright notice |
||||
-- corrected C++ compilation problem |
||||
-- sub-select phrasing corrected in Q4, Q21, Q22 |
||||
-- added support for segmenting update files (contributed by Larry Kemp, HP) |
||||
Changes as of 12/08/98 |
||||
-- version 2.0.0 |
||||
-- removed permute.h from clean target in makefile |
||||
Changes as of 11/17/98 |
||||
-- version 2.0.0 Alpha 8 |
||||
-- corrected o_custkey overrun bug |
||||
-- removed upper bound on -C command option |
||||
-- added static permute.h to distribution to match the specification |
||||
Changes as of 10/23/98 |
||||
-- version 2.0.0 Alpha 7 |
||||
-- removed references to DSS_SEED and SEED_TAG |
||||
-- minor query template cleanup |
||||
-- V2 answer sets added |
||||
-- correction to hd_sparse for SF > 300 |
||||
-- added static declaration to row types in gen_tbl to fix update problem |
||||
-- permuted params to Q22 |
||||
Changes as of 5/19/98 |
||||
-- version 2.0.0 Alpha6b |
||||
-- removed trailing apostrophe from dists.dss nouns for Tandem loader |
||||
-- corrected mk_sparse() problem with alpha6 |
||||
-- added 64b support for NCR/Metaware |
||||
-- corrected revision problem with 2.0.0.6 |
||||
Changes as of 5/7/98 |
||||
-- version 2.0.0 Alpha6 |
||||
-- corrected generation of parent/child tables in parallel |
||||
-- renamed ORDER table to ORDERS table |
||||
-- revision of DBGEN synced with revision of 2.0 specification |
||||
-- portability changes to process termination provided by John Matzka |
||||
-- portability changes for Watcom C provided by Andrew Eisenberg |
||||
-- indentation of specifications/templates now matches |
||||
-- queries now include a consistant header format |
||||
Changes as of 4/28/98 |
||||
-- version 2.0.0 Alpha5 |
||||
-- NO RELEASE OF ALPHA 5 ; skipped to sync spec/DBGEN revision levels |
||||
Changes as of 4/6/98 |
||||
-- version 2.0.0 Alpha4 |
||||
-- corrected parallel table generation |
||||
-- minor corrections to query templates |
||||
-- portability changes for HP |
||||
Changes as of 3/24/98 |
||||
-- version 2.0.0 Alpha3 |
||||
-- include substitution parameters for Q22 |
||||
-- correct substitution parameters for Q16 under AIX |
||||
-- include permute.h until unix/NT makefile fix |
||||
-- correct orderkey generation |
||||
Changes as of 3/20/98 |
||||
-- version 2.0.0 Alpha2 |
||||
-- correct runtime malloc error from bad INIT_HUGE macro |
||||
-- improve pseudo text distribution in comments |
||||
-- fix problem with parallelism of data gen |
||||
-- re-enable generation of parent/child tables |
||||
-- remove recombinaton code for parallel flat files |
||||
Changes as of 3/11/98 |
||||
-- version 2.0.0 Alpha1 |
||||
-- removed the TIME table |
||||
-- removed the need for seed files |
||||
-- made 1GB the validation database size |
||||
-- add pseudo text support in comments |
||||
-- correct character selection in a_rnd() |
||||
-- correct population of P_NAME |
||||
-- removed unclaimed variants |
||||
-- added new queries 18-22, replaced Q13 |
||||
Changes as of 2/6/98 |
||||
-- version 1.3.1 |
||||
-- Revised 64 bit support to clean up bcd2_bin()and mk_sparse() |
||||
-- Add 64b support for NT |
||||
Changes as of 12/31/97 |
||||
-- version 1.3.0 |
||||
-- support for seed generation > 1TB (data gen still to be tested) |
||||
-- rework of 64b support |
||||
-- added bcd support for subtraction, comparison, modulo |
||||
-- added 1998 to the copyright notice |
||||
-- clarified comments in dists.dss |
||||
-- corrected substitution problem in Q11 |
||||
-- standardized fopen() error messages with OPEN_CHECK() |
||||
-- introduced PATH_SEP in config.h to allow changes in path separators |
||||
Changes as of 12/15/96 |
||||
-- version 1.2.0 |
||||
-- corrected typos in queries 8a, 8c, 8d, 11a, 12F and 14F, 17a |
||||
-- added variant 15c |
||||
-- defined MAX_SCALE and MIN_SCALE; issued error messages for SF > 1000 |
||||
since implementation is incomplete |
||||
-- seed file generation can now be resumed with dbgen -R <n> ... |
||||
-- corrected slight compile bug under Solaris 2.5.1 |
||||
-- documented compile problems under SunOS |
||||
Changes as of 8/1/96 |
||||
-- version 1.1.0D |
||||
-- included new variants for queries 8 and 15 |
||||
-- re-introduced answer sets in the source tree |
||||
Changes as of 5/1/96 |
||||
-- version 1.1.0C |
||||
-- unified version numbering of DBGEN and QGEN |
||||
-- updated BUGS list |
||||
-- removed FAQ from soft appendix; web site will keep the current |
||||
version of the FAQ |
||||
-- added 1996 to the copyright notice |
||||
-- corrected bug in PR_DATE macro; NO CHANGE TO DATA SET |
||||
-- properly initialize param values for cleaner logging |
||||
-- adjusted output format of Q11 partam to allow scaling to 1TB |
||||
-- corrected typos in variant 14c |
||||
-- corrected data type for YEAR in variant 8c |
||||
-- corrected typos in variant 10a |
||||
-- added variant 8d |
||||
Changes as of 1/23/96 |
||||
-- qgen version 1.1.0B |
||||
-- include support for ANSI semantics |
||||
-- improved patch for seed sensetivity |
||||
Changes as of 1/23/96 |
||||
-- updated BUGS list |
||||
-- dbgen version 1.1.0A |
||||
-- patch to limit BCD2 fields to 12 characters for columnar output |
||||
-- qgen version 1.1.0A |
||||
-- patch to fix the "unknown flag" problem |
||||
-- patch to fix the seed sensetivity problem |
||||
Changes as of 12/19/95 |
||||
-- updated BUGS list |
||||
-- dbgen version 1.1.0 |
||||
-- upped default value of MAX_CHILDREN to 1000 |
||||
-- corrected naming of detail tables in incremental load |
||||
-- corrected range delete output |
||||
-- forced delete files to truncate existing files |
||||
-- removed fixed size tables from seed generation |
||||
-- corrected overflow problem with large scale seed generation |
||||
-- allow date generation as MM-DD-YY based on config.h #define |
||||
-- correct truncation problem with columnar output in PR_VSTR() |
||||
-- added support for Windows NT |
||||
-- added PLATFORM macro to makefile, removed platform defines from |
||||
config.h |
||||
-- removed MAX_CHILDREN define from config.h (set to 1000 in dss.h) |
||||
-- qgen version 1.1.0 |
||||
-- correct SET_OUTPUT macro to TDAT |
||||
-- use %ld in output for q17; portability |
||||
-- add support for SQLSERVER database dialect |
||||
-- add support for SYBASE database dialect |
||||
-- adjust parameter ranges for Q1, Q3, Q6 |
||||
-- add -T/-t option to usage summary |
||||
-- added support for Windows NT |
||||
Changes as of 09/01/95 |
||||
-- qgen version 1.0.1 |
||||
-- formalized version numbering |
||||
-- -p now generates correct query permutations |
||||
-- added separate verion number for qgen |
||||
-- corrected Q3 substitution problem |
||||
-- updated permissible range for Q10 |
||||
-- corrected rowcount_dflt and the MAX row indicator (-1) |
||||
-- expanded param logging to include all possible parameters |
||||
-- allowed qgen's -d option to be used at all scale factors |
||||
-- made parameter substitution permutation-independent |
||||
-- added qgen suppport for END_TRAN (-E) and DFLT_NUM (-N) |
||||
-- correct handling of :n directive |
||||
-- added more complete explanation of QGEN to README |
||||
-- rename of random to rndm, for portability |
||||
-- dbgen version 1.0.1 |
||||
-- formalized version numbering |
||||
-- inclusion of SF=1 seed file |
||||
-- correct typo in usage() update example |
||||
-- patch to driver.c to allow correct updates |
||||
-- documentation change to README to clarify seed/stage/update |
||||
intereaction |
||||
-- corrected minor glitch in "open failed" error msg in print.c |
||||
-- added missing line continuation to makefile.suite |
||||
-- seed files are now based on scale factor and number of generators |
||||
-- seed files now hold seeds for one "step" of a given build |
||||
-- clean up of parallel load routines |
||||
-- inclusion of faster seed generation routines from Susanne Englert |
||||
-- removed the -E(xisting) option |
||||
-- assure proper scaling of O_CUSTKEY |
||||
-- corrected default update percentage |
||||
-- proper handling of child tables with '-O f' |
||||
-- removed seed files from the distribution |
||||
-- modified rpb_routine() to limit contribution of partkey in |
||||
retailprice |
||||
-- added '-S(tep)' option to allow multi-stage loads |
||||
-- roll in of 32 bit speed_seed routines from Dick Shelton |
||||
-- miscelaneous typo corrections in the documentation |
||||
-- cleanup of usage output |
||||
Changes as of 05/08/95 |
||||
-- version 1.0 |
||||
-- add Teradata defines to tpcd.h for QGEN |
||||
-- add :c to query templates for database CONNECT syntax |
||||
-- add examples of DBGEN and QGEN usage to README |
||||
-- add -T option to qgen to allow time able usage |
||||
-- query template names only requre .sql suffix, rest is arbitrary |
||||
Changes as of 03/13/95 |
||||
-- version 9.1 |
||||
-- surround DBNAME with ifndef in config.h |
||||
-- remove -DDBNAME from makefile.suite |
||||
-- sync varchar handling with 9.1 draft |
||||
Changes as of 02/21/95 |
||||
-- version 9.0a |
||||
-- fixed bug in qgen that incorrectly included rnd.h |
||||
-- included revised DDL with changes for char/varchar and l_quantity |
||||
-- updated DBGEN help message to include new single table options for |
||||
order/lineitem and part/partsupp |
||||
-- included handling for multi-set seed files TPCDSEED.xxx |
||||
-- generated seeds up through 400GB; headed to 1TB! |
||||
-- ANSI lint cleanup; more needed |
||||
-- UF2 now defaults to key lists; use "-O r" to generate key ranges |
||||
also note, this routine this routine does NOT use the BCD2_* |
||||
routines. As a result, it WILL fail if the keys being deleted |
||||
exceed 32 bits. Since this would require ~660 update iterations, |
||||
this seems an acceptable oversight |
||||
Changes as of 01/19/95 |
||||
-- version 9.0 |
||||
-- allowed command line seeding of RNG for QGEN |
||||
-- order and number of params in QGEN now matches |
||||
presentation in spec |
||||
-- fixed bug in time table format of O_ORDERDATE |
||||
-- changed l_QUANTITY to FLOAT in dss.ddl |
||||
-- reworked QGEN options to be more useful |
||||
-- allowed creation of sparse keys beyond 32 bits (for 1TB) |
||||
-- removed unused '#ifdef' and associated code |
||||
-- allowed independent generation of master/detail tables |
||||
(eg, order/lineitem) |
||||
Changes as of 12/06/94 |
||||
-- version 8.6 |
||||
-- fixed renaming of flat files for child tables |
||||
-- various documentation fixes |
||||
-- added naming convention section to Porting.Notes |
||||
-- added -DIBM flag to config.h |
||||
-- synced up QGEN with draft 8.1 |
||||
Changes as of 10/25/94 |
||||
-- version 8.5a |
||||
-- corrected bug in columnar output of pr_supp |
||||
-- added pr_drange to generate a list of order keys to be |
||||
deleted instead of generating SQL |
||||
-- added '-O d' to generate range delete as SQL |
||||
-- updated default values for QGEN to sync with spec 8.1 |
||||
-- corrected MK_SPARSE to reflect groups of 8 |
||||
-- corrected a bug in o_orderstatus |
||||
-- regenerated seed files for SF in [1,10] |
||||
-- ANSI cleanup (primarily function declarations) |
||||
Changes as of 10/11/94 |
||||
-- version 8.5 |
||||
-- remove deletes/inserts to other than order/lineitem |
||||
-- increased cardinality for part.type part.container |
||||
-- '-r' argument is now integer; percentage in basis points |
||||
-- initial roll-in of new update scheme |
||||
-- added BBB comments to supplier table |
||||
Changes as of 9/27/94 |
||||
-- version 8.4 |
||||
-- all money calculations now use integer math. This should |
||||
bring everyone's data sets into exact aggreement. |
||||
Changes as of 9/21/94 |
||||
-- version 8.3b |
||||
-- fixed handling of MAX_STREAM |
||||
-- added floor function to RPRICE bridge |
||||
-- misc lint cleanup (type fixes, new prototypes, etc.) |
||||
-- MONEY format becomes lf for DOS |
||||
-- further cleanup of PR_VSTR and its length argument |
||||
-- change to parameter generation for Q6 to allow for float |
||||
discount |
||||
Changes as of 9/15/94 |
||||
-- version 8.3a |
||||
-- isolated MONEY format for Unisys (Lf) using DOS |
||||
-- make sure all arguments to MAKE_MONEY were double's |
||||
-- rolled in NEW_PTEXT to allow Berni to experiment |
||||
Changes as of 9/12/94 |
||||
-- version 8.3 |
||||
-- added -T n and -T r to usage to match getopt() and README |
||||
-- changed PR_MONEY to remove leading blanks |
||||
-- included revised DDL from Berni |
||||
-- included some MVS portability fixes in re malloc.h |
||||
-- cleaned up error messages in qgen and made #define ofp usage |
||||
universal |
||||
-- additional DOS portability changes |
||||
-- added {c,a}len to provide specific length for columnar |
||||
output of varchar |
||||
-- added PR_VSTR to handle varchar printing under MVS |
||||
-- fixed bit masking in a_rnd and cleaned up prototype match |
||||
with V_STR |
||||
-- PR_MONEY now used %Lf |
||||
-- added revised pseudo text under NEW_PTEXT ifdef for |
||||
experiments |
||||
Changes as of 9/09/94 |
||||
-- version 8.2 |
||||
-- l_discount and l_tax are now fractional (per teleconference) |
||||
-- money calculations moved to scaled integer math to clean up |
||||
answer sets |
||||
-- changed PR_FLT() to PR_MONEY to clarify usage |
||||
-- portability changes for SYBASE: dbname --> db_name |
||||
STATUS --> DBGEN_STATUS |
||||
-- added nations2 to dists.dss to handle qgen needs for now |
||||
-- reintroduced #ifndef DOS |
||||
-- reintroduced U2200 define to control kill_load() |
||||
-- broke out nation and region separately in -T option |
||||
-- updated dss.ddl based on mail from Berni |
||||
Changes as of 8/31/94 |
||||
-- version 8.1 |
||||
-- scaling for clerks needed to be 1000 (was 100) |
||||
-- added qgen parameter for scale |
||||
-- changed qgen parameter from s)tream to p)ermutation |
||||
-- synced qgen paramter values with 8.0 spec |
||||
-- corrected duplications in dists.dss |
||||
Changes as of 8/24/94 |
||||
-- version 8.0 |
||||
-- added sparse keys to lineitem/order |
||||
-- added varchar generation for comments/addresses |
||||
-- added variable lineitems/orders |
||||
-- removed ifdef for normalized code_tables |
||||
-- included code for parameter generation and template->EQT |
||||
routines |
||||
-- updated README and Porting.Notes to reflect QGEN |
||||
-- included DDL and RI examples from Berni |
||||
Changes as of 6/15/94 |
||||
-- version 7.0b (numbers now match spec revsion) |
||||
-- rework of code tables to properly map nation/region; when |
||||
compiled with -DCODE_TABLES distributions are taken from |
||||
code.dss and two additional fields are generated for |
||||
customers and suppliers, [cs]_ncode and [cs]_rcode, |
||||
immediately following [cs]_region |
||||
-- replaced ifdef's around DEAD_DATA with opposites. DEAD_DATA |
||||
is now the default |
||||
-- worked through code to see that it conformed to 7.0 |
||||
specification |
||||
-- adjusted scale factors/rowcounts for 1 GB == sf1 |
||||
-- brought help message in line with current code |
||||
-- fixed order per customer at 10 |
||||
-- make suppkey scalable in lineitem/partsupp |
||||
Changes as of 4/25/94 |
||||
-- version 1.5 |
||||
-- added the customers with no orders; Compile with -DDEAD_DATA |
||||
to activate the change. |
||||
-- added the code table for nation and region; |
||||
Compile with -DCODE_TABLES to activate the change. |
||||
Changes as of 3/17/94 |
||||
-- version 1.41 |
||||
-- completed implementation of JULIAN_DAY after talks with Berni |
||||
-- misc cleanup in usage/README files |
||||
-- removed all tabs and capped line length at 75 |
||||
-- added -n option to allowing naming of inline-loaded database |
||||
Changes as of 3/16/94 |
||||
-- version 1.4 |
||||
-- prottyped julian day/month for query re-write work. Compile |
||||
with -DJULIAN_DAY to enable |
||||
-- removed gen_times() from driver.c |
||||
-- added VMS ifdef to config.h to clean up fork/signal issues |
||||
-- added ICL ifdef to config.h to clean up getopt() issues |
||||
-- changed header file references to config.h from machine.h |
||||
Changes as of 3/2/94 |
||||
-- version 1.31 |
||||
-- corrected format of C_NAME to match S_NAME and O_CLERK |
||||
-- re-allowed fractional scale factors < 1 (updates not |
||||
contiguous) |
||||
-- added DSS_CONFIG environemnt variable |
||||
-- reworked read_dist() to look for DSS_DIST in DSS_CONFIG |
||||
-- updated the README file |
||||
Changes as of 2/16/94 |
||||
-- version 1.3 |
||||
-- added command line options for parallel load and data set |
||||
expansion |
||||
-- changed dists.dss delimiter to | for portability |
||||
-- limited scale factors to integer values |
||||
-- added command line option for seed file generation |
||||
-- added all seed files to distribution for SFs 1 - 10 |
||||
-- moved machine.h to config.h and added MAX_CHILDREN define |
||||
-- added 'f' flag to options to allow renaming of output files |
||||
-- added generation of SQL delete statements to match updates |
||||
(Note: updates are still single-threaded; -C is cleared |
||||
by -U) |
||||
-- corrected field sizing in dsstypes.h typedefs to match v 6.4 |
||||
-- update percentage default set to 1% |
||||
Changes as of 12/3/93 |
||||
-- version 1.2 |
||||
-- added command line option to adjust update percentage |
||||
-- fixed update gneration for proper primary key ordering |
||||
-- renamed UUSR/PRC to RUSSIA/CHINA in dists.dss |
||||
-- cleaned up phone number generation to be consistant regard- |
||||
less of order of evaluation |
||||
-- adjusted size of lineitem comment to bring data in line with |
||||
100 MB == SF=1 |
||||
Changes as of 10/15/93 |
||||
-- added command line option for update data creation |
||||
-- miscelaneous porting and cleanup changes |
||||
-- reworked table generation to allow reuse for updates |
||||
-- added comment field to tdefs structure |
||||
-- added load_state and store_state to sync data gen and |
||||
update gen |
||||
Changes as of 7/26/93 |
||||
-- combined loader and header stubs in load_stubs.c |
||||
-- separated Revision History (this file) from README |
||||
-- simplified makefile |
||||
-- removed redundancies from colors distribution |
||||
-- added getopt() for portability |
||||
-- created Porting.Notes |
||||
-- adjusted scaling rules |
||||
-- added help option to the command line |
||||
Changes as of 2/26/93 |
||||
-- combined all typedefs in one header: dsstypes.h |
||||
-- combined flat file generation in print.ec |
||||
-- combined typedef population in build.ec |
||||
-- added -P to control rowcnt scaling (P for percentage) |
||||
-- added -D option for Direct data generation and added |
||||
appropriate hooks in tdefs[] structure |
||||
-- added -F option for flat file generation |
||||
-- reused -T option (use -P 0.1 to build test size database) |
||||
now accepts suboptions c,o,p,s for single table builds. |
||||
-- dropped -M option (scaling is now by rowcount) |
||||
-- added -O option for optional controls. Currently defined: |
||||
-O t -- generate optional time table a join fields in |
||||
order/lineitem |
||||
-O h -- generate headers for flat file output |
||||
-O m -- generate fixed column-length output |
||||
-- removed dynamic memory allocation, redundant calls to |
||||
UnifInt, etc to improve performance |
||||
Changes as of 1/12/92 |
||||
-- julian() changed to handle orders->orderdate correctly |
||||
-- rflag distributions corrected in dists.dss |
||||
-- sea, gold removed from color distribution to clean up substring |
||||
problems |
||||
-- part->number and supplier-> adjusted for 1-based indexing |
||||
-- time->day changed to be day of month, not day of year |
||||
-- t.week changed to be week in year, not day of week |
||||
Changes as of 11/18/92 |
||||
-- checked line length and tab for transmission |
||||
-- another chapter in the portability wars. added #include |
||||
"machine.h" to dss.h (which is included by everyone else). Any |
||||
machine particular porting changes should go here. |
||||
-- fixed fixed-field formats to prevent double printing |
||||
-- expanded PR_FLT formats to %010.2 |
||||
Changes as of 10/21/92 |
||||
-- added fixed format and column header handling; users of headers |
||||
will have to define the header functions to be called in |
||||
int (*tdefs.header)() |
||||
Changes as of 10/09/92: |
||||
-- added ansi prototypes and recompiled with gcc -ansi. users may |
||||
need to change the CC definition in the makefile and the contents |
||||
of CFLAGS to reflect their particular ansi compiler. |
||||
-- replaced all int references with long |
||||
-- replaced all float references with double |
||||
-- found and fixed odate/julian problem TS mentioned in 10/09 phone |
||||
call |
||||
|
||||
Changes as of 9/09/92: |
||||
-- Park/Miller random number generator included |
||||
-- clerk scaling changed to 100 * scale |
||||
-- parts.name always built from 5 selections from colors set |
||||
-- test scaling changed to ~60MB (TEST_SCALING == 10) |
||||
-- logarithmic scaling removed |
||||
-- mfgcost removed and retail/supplier cost bounds adjusted |
||||
-- agg_str memory leak fixed |
||||
-- independent RNG streams on a per column basis |
||||
|
||||
This is the revised data generator for DSS. |
||||
|
||||
The rewrite tried to accomplish three things: (1) identify and isolate |
||||
all the implicit assumptions about limits, bounds, ranges, distribu- |
||||
tions, etc.; (2) standardize the way any given table was generated/ |
||||
printed to ease understanding and maintenance; (3) bring the generator |
||||
in line with the current work of the committee and the excellent spec |
||||
the Indira put together; (4) provide an easy way to adjust distribu- |
||||
tions, string contents and to facilitate experimentation to get a |
||||
better idea of the impact of data population changes. |
||||
|
||||
The files included are: |
||||
|
||||
driver.c ------- main and the calling routines for the generators |
||||
dist.c ------- should really be named dss_util.c; misc routines |
||||
customer.c ------- generation and print routines for customer table |
||||
orders.c ------- "" "" order table |
||||
parts.c ------- "" "" parts/partsupp |
||||
suppliers.c ------- "" "" suppliers table |
||||
time.c ------- "" "" time table |
||||
customer.h ------- associate header files; contain structure |
||||
definitions |
||||
dss.h dss.h holds the large number of assumptions and |
||||
orders.h values that have been used as IFDEFs. |
||||
parts.h |
||||
suppliers.h |
||||
time.h |
||||
dists.dss ------- string selections and weights; used to build |
||||
distributions |
||||
|
||||
Running make will create an executable (using the compiler flags in |
||||
CFLAGS, the ld flags in LDFLAGS and the libraries in LIBS [-O, -s, |
||||
and -lm by default]) which will create flat files suitable for dbload. |
||||
t |
||||
|
@ -0,0 +1,220 @@ |
||||
# @(#)PORTING.NOTES 2.1.8.1 |
||||
|
||||
Table of Contents |
||||
================== |
||||
1. General Program Structure |
||||
2. Naming Conventions and Variable Usage |
||||
3. Porting Procedures |
||||
4. Compilation Options |
||||
5. Customizing QGEN |
||||
6. Further Enhancements |
||||
7. Known Porting Problems |
||||
8. Reporting Problems |
||||
|
||||
1. General Program Structure |
||||
|
||||
The code provided with TPC-H and TPC-R benchmarks includes a database |
||||
population generator (DBGEN) and a query template translator(QGEN). It |
||||
is written in ANSI-C, and is meant to be easily portable to a broad variety |
||||
of platforms. The program is composed of five source files and some |
||||
support and header files. The main modules are: |
||||
|
||||
build.c: each table in the database schema is represented by a |
||||
routine mk_XXXX, which populates a structure |
||||
representing one row in table XXXX. |
||||
See Also: dss_types.h, bm_utils.c, rnd.* |
||||
print.c: each table in the database schema is represented by a |
||||
routine pr_XXXX, which prints the contents of a |
||||
structure representing one row in table XXX. |
||||
See Also: dss_types.h, dss.h |
||||
driver.c: this module contains the main control functions for |
||||
DBGEN, including command line parsing, distribution |
||||
management, database scaling and the calls to mk_XXXX |
||||
and pr_XXXX for each table generated. |
||||
qgen.c: this module contains the main control functions for |
||||
QGEN, including query template parsing. |
||||
varsub.c: each query template includes one or more parameter |
||||
substitution points; this routine handles the |
||||
parameter generation for the TPC-H/TPC-R benchmark. |
||||
|
||||
The support utilities provide a generalized set of functions for data |
||||
generation and include: |
||||
|
||||
bm_utils.c: data type generators, string management and |
||||
portability routines. |
||||
|
||||
rnd.*: a general purpose random number generator used |
||||
throughout the code. |
||||
|
||||
dss.h: |
||||
shared.h: a set of '#defines' for limits, formats and fixed |
||||
values |
||||
dsstypes.h: structure definitions for each table definition |
||||
|
||||
2. Naming Conventions and Variable Usage |
||||
|
||||
Since DBGEN will be maintained by a large number of people, it is |
||||
particularly important to observe the coding, variable naming and usage |
||||
conventions detailed here. |
||||
|
||||
#define |
||||
-------- |
||||
All #define directives are found in header files (*.h). In general, |
||||
the header files segregate variables and macros as follows: |
||||
rnd.h -- anything exclusively referenced by rnd.c |
||||
dss.h -- general defines for the benchmark, including *all* |
||||
extern declarations (see below). |
||||
shared.h -- defines related to the tuple definitions in |
||||
dsstypes.h. Isolated to ease automatic processing needed by many |
||||
direct load routines (see below). |
||||
dsstypes.h -- structure definitons and typedef directives to |
||||
detail the contents of each table's tuples. |
||||
config.h -- any porting and configuration related defines should |
||||
go here, to localize the changes necessary to move the suite |
||||
from one machine to another. |
||||
tpcd.h -- defines related to QGEN, rather than DBGEN |
||||
|
||||
extern |
||||
------ |
||||
DBGEN and QGEN make extensive use of extern declarations. This could |
||||
probably stand to be changed at some point, but has made the rapid |
||||
turnaround of prototypes easier. In order to be sure that each |
||||
declaration was matched by exactly one definition per executatble, |
||||
they are all declared as EXTERN, a macro dependent on DECLARER. In |
||||
any module that defines DECLARER, all variables declared EXTERN will |
||||
be defined as globals. DECLARER should be declared only in modules |
||||
containing a main() routine. |
||||
|
||||
Naming Conventions |
||||
------------------ |
||||
defines |
||||
o All defines use upper case |
||||
o All defines use a table prefix, if appropriate: |
||||
O_* relates to orders table |
||||
L_* realtes to lineitem table |
||||
P_* realtes to part table |
||||
PS_* relates to partsupplier table |
||||
C_* realtes to customer table |
||||
S_* relates to supplier table |
||||
N_* relates to nation table |
||||
R_* realtes to region table |
||||
T_* relates to time table |
||||
o All defines have a usage prefix, if appropriate: |
||||
*_TAG environment variable name |
||||
*_DFLT environment variable default |
||||
*_MAX upper bound |
||||
*_MIN lower bound |
||||
*_LEN average length |
||||
*_SD random number seed (see rnd.*) |
||||
*_FMT printf format string |
||||
*_SCL divisor (for scaled arithmetic) |
||||
*_SIZE tuple length |
||||
|
||||
3. Porting Procedures |
||||
|
||||
The code provided should be easily portable to any machine providing an |
||||
ANSI C compiler. |
||||
-- Copy makefile.suite to makefile |
||||
-- Edit the makefile to match the name of your C compiler |
||||
and to include appropriate compilation options in the CFLAGS |
||||
definition |
||||
-- make. |
||||
|
||||
Special care should be taken in modifying any of the monetary calcu- |
||||
lations in DBGEN. These have proven to be particularly sensitive to |
||||
portability problems. If you decide to create the routines for inline |
||||
data load (see below), be sure to compare the resulting data to that |
||||
generated by a flat file data generation to be sure that all numeric |
||||
conversions have been correct. |
||||
|
||||
If the compile generates errors, refer to "Compilation Options", below. |
||||
The problem you are encountering may already have been addressed in the |
||||
code. |
||||
|
||||
If the compile is successful, but QGEN is not generating the appropriate |
||||
query syntax for your environment, refer to "Customizing QGEN", below. |
||||
|
||||
For other problems, refer to "Reporting Problems" at the end of this |
||||
document. |
||||
|
||||
4. Compilation Options |
||||
|
||||
config.h and makefile.suite contain a number of compile time options intended |
||||
to make the process of porting the code provided with TPC-H/TPC-R as easy as |
||||
possible on a broad range of platforms. Most ports should consist of reviewing |
||||
the possible settings described in config.h and modifying the makefile |
||||
to employ them appropriately. |
||||
|
||||
5. Customizing QGEN |
||||
|
||||
QGEN relies on a number of vendor-specific conventions to generate |
||||
appropriate query syntax. These are controlled by #defines in tpcd.h, |
||||
and enabled by a #define in config.h. If you find that the syntax |
||||
generated by QGEN is not sufficient for your environment you will need |
||||
to modify these to files. It is strongly recomended that you not change |
||||
the general organization of the files. |
||||
|
||||
Currently defined options are: |
||||
|
||||
VTAG -- marks a variable substitution point [:] |
||||
QDIR_TAG -- environent variable which points to query templates |
||||
[DSS_QUERY] |
||||
GEN_QUERY_PLAN -- syntax to generate a query plan ["Set Explain On;"] |
||||
START_TRAN -- syntax to begin a transaction ["Begin Work;"] |
||||
END_TRAN -- syntax to end a transaction ["Commit Work;"] |
||||
SET_OUTPUT -- syntax to redirect query output ["Output to"] |
||||
SET_ROWCOUNT -- syntax to set the number of rows returned |
||||
["{return %d rows}"] |
||||
SET_DBASE -- syntax to connect to a database |
||||
|
||||
6. Further Enhancements |
||||
|
||||
load_stub.c provides entry points for two likely enhancements. |
||||
|
||||
The ld_XXXX routines make it possible to load the |
||||
database directly from DBGEN without first writing the database |
||||
population out to the filesystem. This may prove particularly useful |
||||
when loading larger database populations. Be particularly careful about |
||||
monetary amounts. To assure portability, all monetary calcualtion are |
||||
done using long integers (which hold money amounts as a number of |
||||
pennies). These will need to be scaled to dollars and cents (by dividing |
||||
by 100), before the values are presented to the DBMS. |
||||
|
||||
The hd_XXXX routines allow header information to be written before the |
||||
creation of the flat files. This should allow system which require |
||||
formatting information in database load files to use DBGEN with only |
||||
a small amount of custom code. |
||||
|
||||
qgen.c defines the translation table for query templates in the |
||||
routine qsub(). |
||||
|
||||
varsub.c defines the parameter substitutions in the routine varsub(). |
||||
|
||||
If you are porting DBGEN to a machine that is not supports a native word |
||||
size larger that 32 bits, you may wish to modify the default values for |
||||
BITS_PER_LONG and MAX_LONG. These values are used in the generation of |
||||
the sparse primary keys in the order and lineitem tables. The code has |
||||
been structured to run on any machine supporting a 32 bit long, but |
||||
may be slightly more efficient on machines that are able to make use of |
||||
a larger native type. |
||||
|
||||
7. Known Porting Problems |
||||
|
||||
The current codeline will not compile under SunOS 4.1. Solaris 2.4 and later |
||||
are supported, and anyone wishing to use DBGEN on a Sun platform is |
||||
encouraged to use one of these OS releases. |
||||
|
||||
|
||||
8. Reporting Problems |
||||
|
||||
The code provided with TPC-H/TPC-R has been written to be easily portable, |
||||
and has been tested on a wide variety of platforms, If you have any |
||||
trouble porting the code to your platform, please help us to correct |
||||
the problem in a later release by sending the following information |
||||
to the TPC D subcommittee: |
||||
|
||||
Computer Make and Model |
||||
Compiler Type and Revision Number |
||||
Brief Description of the problem |
||||
Suggested modification to correct the problem |
||||
|
@ -0,0 +1,436 @@ |
||||
# @(#)README 2.4.0 |
||||
|
||||
Table of Contents |
||||
=================== |
||||
0. What is this document? |
||||
1. What is DBGEN? |
||||
2. What will DBGEN create? |
||||
3. How is DBGEN built? |
||||
4. Command Line Options for DBGEN |
||||
5. Building Large Data Sets with DBGEN |
||||
6. DBGEN limitations and compliant usage |
||||
7. Sample DBGEN executions |
||||
8. What is QGEN? |
||||
9. What will QGEN create? |
||||
10. How is QGEN built? |
||||
11. Command Line Options for QGEN |
||||
12. Query Template Syntax |
||||
13. Sample QGEN executions and Query Templates |
||||
14. Environment variable |
||||
15. Version Numbering in DBGEN and QGEN |
||||
16. Validated Platforms |
||||
|
||||
0. What is this document? |
||||
|
||||
This is the general README file for DBGEN and QGEN, the data- |
||||
base population and executable query text generation programs |
||||
used in the TPC-H benchmark. It covers the proper use |
||||
of DBGEN and QGEN. For information on porting the utility to your |
||||
particular platform see Porting.Notes. |
||||
|
||||
1. What is DBGEN? |
||||
|
||||
DBGEN is a database population program for use with the TPC-H benchmark. |
||||
It is written in ANSI 'C' for portability, and has |
||||
been successfully ported to over a dozen different systems. While the |
||||
TPC-H specification allow an implementor to use any utility |
||||
to populate the benchmark database, the resultant population must exactly |
||||
match the output of DBGEN. The source code has been provided to make the |
||||
process of building a compliant database population as simple as possible. |
||||
|
||||
2. What will DBGEN create? |
||||
|
||||
Without any command line options, DBGEN will generate 8 separate ascii |
||||
files. Each file will contain pipe-delimited load data for one of the |
||||
tables defined in the TPC-H database schema. The default tables |
||||
will contain the load data required for a scale factor 1 database. By |
||||
default the file will be created in the current directory and be |
||||
named <table>.tbl. As an example, customer.tbl will contain the |
||||
load data for the customer table. |
||||
|
||||
When invoked with the '-U' flag, DBGEN will create the data sets to be |
||||
used in the update functions and the SQL syntax required to delete the |
||||
data sets. The update files will be created in the same directory as |
||||
the load data files and will be named "u_<table>.set". The delete |
||||
syntax will be written to "delete.set". For instance, the data set to |
||||
be used in the third query set to update the lineitem table will be |
||||
named "u_lineitem.tbl.3", and the SQL to remove those rows will be |
||||
found in "delete.3". The size of the update files can be controlled |
||||
with the '-r' flag. |
||||
|
||||
3. How is DBGEN built? |
||||
|
||||
Create an appropriate makefile, using makefile.suite as a basis, |
||||
and type make. Refer to Porting.Notes for more details and for |
||||
suggested compile time options. |
||||
|
||||
4. Command Line Options for DBGEN |
||||
|
||||
DBGEN's output is controlled by a combination of command line options |
||||
and environment variables. Command line options are assumed to be single |
||||
letter flags preceded by a minus sign. They may be followed by an |
||||
optional argument. |
||||
|
||||
option argument default action |
||||
------ -------- ------- ------ |
||||
-h Display a usage summary |
||||
|
||||
-f none Force. Existing data files will be |
||||
overwritten. |
||||
|
||||
-F none yes Flat file output. |
||||
|
||||
-D none Direct database load. ld_XXXX() routines |
||||
must be defined in load_stub.c |
||||
|
||||
-s <scale> 1 Scale of the database population. Scale |
||||
1.0 represents ~1 GB of data |
||||
|
||||
-T <table> Generate the data for a particular table |
||||
ONLY. Arguments: p -- part/partuspp, |
||||
c -- customer, s -- supplier, |
||||
o -- orders/lineitem, n -- nation, r -- region, |
||||
l -- code (same as n and r), |
||||
O -- orders, L -- lineitem, P -- part, |
||||
S -- partsupp |
||||
|
||||
-O d Generate SQL for delete function |
||||
instead of key ranges |
||||
|
||||
-O f Allow over-ride of default output file |
||||
names |
||||
|
||||
-O h Generate headers in flat ascii files. |
||||
hd_XXX routines must be defined in |
||||
load_stub.c |
||||
|
||||
-O m Flat files generate fixed length records |
||||
|
||||
-O r Generate key ranges for the UF2 update |
||||
function |
||||
|
||||
-O v Verify data set without generating it. |
||||
|
||||
-r <percentage> 10 Scale each udpate file to the given |
||||
percentage (expressed in basis points) |
||||
of the data set |
||||
|
||||
-v none Verbose. Progress messages are |
||||
displayed as data is generated. |
||||
|
||||
-n <name> Use database <name> for in-line load |
||||
|
||||
-C <children> Use <children> separate processes to |
||||
generate data |
||||
|
||||
-S <n> Generate the <n>th part of a multi-part load |
||||
or update set |
||||
|
||||
-U <updates> Create a specified number of data sets |
||||
in flat files for the update/delete |
||||
functions |
||||
|
||||
-i <n> Split the inserted rows in an refresh pair |
||||
between <n> files |
||||
|
||||
-d <n> Split the deleted rows in an refresh pair |
||||
between <n> files |
||||
|
||||
5. DBGEN limitations and compliant usage |
||||
|
||||
DBGEN is meant to be a robust population generator for use with the |
||||
TPC-H benchmark. It is hoped that DBGEN will make it easier |
||||
to experiment with and become proficient in the execution of TPC decision |
||||
support benchmarks. As a result, it includes a number of command line |
||||
options which are not, strictly speaking, necessary to generate a compliant |
||||
data set for a TPC-D run. In addition, some command line options will accept |
||||
arguments which result in the generation of NON-COMPLIANT data sets. Options |
||||
which should be used with care include: |
||||
|
||||
-s -- scale factor. TPC-H runs are only compliant when run against SF's |
||||
of 1, 10, 100, 300, 1000, 3000, 10000, 30000, 100000 |
||||
-r -- refresh percentage. TPC-H runs are only compliant when run with |
||||
-r 10, the default. |
||||
|
||||
6. Sample DBGEN executions |
||||
|
||||
DBGEN has been built to allow as much flexibility as possible, but is |
||||
fundementally intended to generate two things: a database population |
||||
against which the queries in TPC-H can be run, and the updates |
||||
that are used during the update functions in TPC-H. Here are |
||||
some sample uses of DBGEN. |
||||
|
||||
1. To generate the database population for the qualification database |
||||
dbgen -s 1 |
||||
2. To generate the lineitem table only, for a scale factor 10 database, |
||||
and over-write any existing flat files: |
||||
dbgen -s 10 -f -T L |
||||
4. To geterate a 100GB data set in 1GB pieces, generate only the part and |
||||
partsupplier tables, and include some progress reports along the way: |
||||
dbgen -s 100 -S 1 -C 100 -T p -v (to generate the first 1GB file) |
||||
dbgen -s 100 -S 2 -C 100 -T p -v (to generate the second 1GB file) |
||||
(and so on, incrementing the argument to -S each time) |
||||
5. To generate the update files needed for a 4 stream run of the throughput |
||||
test at 100 GB, using an existing set of seed files from an 8 process |
||||
load: |
||||
dbgen -s 100 -U 4 -C 8 |
||||
|
||||
|
||||
7. What is QGEN? |
||||
|
||||
QGEN is a query generation program for use with the TPC-H benchmark. |
||||
It is written in ANSI 'C' for portability, and has been successfully |
||||
ported to over a dozen different systems. While the benchmark specifications |
||||
allow an implementor to use any utility to create the benchmark query |
||||
sets, QGEN has been provided to make the process of building |
||||
a benchmark implementation as simple as possible. |
||||
|
||||
8. What will QGEN create? |
||||
|
||||
QGEN is a filter, triggered by :'s. It does line-at-a-time reads of its |
||||
input (more on that later), scanning for :foo, where foo determines the |
||||
substitution that occurs. Including: |
||||
|
||||
:<int> replace with the appropriate value for parameter <int> |
||||
:b replace with START_TRAN (from tpcd.h) |
||||
:c replace with SET_DBASE (from tpcd.h) |
||||
:n<int> replace with SET_ROWCOUNT(<int>) (from tpcd.h) |
||||
:o replace with SET_OUTPUT (from tpcd.h) |
||||
:q replace with query number |
||||
:s replace with stream number |
||||
:x replace with GEN_QUERY_PLAN (from tpcd.h) |
||||
|
||||
Qgen takes an assortment of command line options, controlling which of these |
||||
options should be active during the translation from template to EQT, and a |
||||
list of query "names". It then translates the template found in |
||||
$DSS_QUERY/<name>.sql and puts the result of stdout. |
||||
|
||||
Here is a sample query template: |
||||
|
||||
{ Sccsid: @(#)1.sql 9.1.1.1 1/25/95 10:51:56 } |
||||
:n 0 |
||||
:o |
||||
select |
||||
l_returnflag, |
||||
l_linestatus, |
||||
sum(l_quantity) as sum_qty, |
||||
sum(l_extendedprice) as sum_base_price, |
||||
sum(l_extendedprice * (1 - l_discount)) as sum_disc_price, |
||||
sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as sum_charge, |
||||
avg(l_quantity) as avg_qty, |
||||
avg(l_extendedprice) as avg_price, |
||||
avg(l_discount) as avg_disc, |
||||
count(*) as count_order |
||||
from lineitem |
||||
where l_shipdate <= date '1998-12-01' - interval :1 day |
||||
group by l_returnflag, l_linestatus |
||||
order by l_returnflag, l_linestatus; |
||||
|
||||
And here is what is generated: |
||||
$ qgen -d 1 |
||||
|
||||
{return 0 rows} |
||||
|
||||
select |
||||
l_returnflag, |
||||
l_linestatus, |
||||
sum(l_quantity) as sum_qty, |
||||
sum(l_extendedprice) as sum_base_price, |
||||
sum(l_extendedprice * (1 - l_discount)) as sum_disc_price, |
||||
sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as sum_charge, |
||||
avg(l_quantity) as avg_qty, |
||||
avg(l_extendedprice) as avg_price, |
||||
avg(l_discount) as avg_disc, |
||||
count(*) as count_order |
||||
from lineitem |
||||
where l_shipdate <= date('1998-12-01') - interval (90) day to day |
||||
group by l_returnflag, l_linestatus |
||||
order by l_returnflag, l_linestatus; |
||||
|
||||
See "Query Template Syntax" below for more detail on converting your prefered query |
||||
phrasing for use with QGEN. |
||||
|
||||
9. How is QGEN built? |
||||
|
||||
QGEN is built by the same makefile that creates DBGEN. If the makefile |
||||
is successfully creating DBGEN, no further compilation modifications |
||||
should be necessary. You may need to modify some of the options which |
||||
allow QGEN to integrate with your preferred query tool. Refer to |
||||
Porting.Notes for more detail. |
||||
|
||||
10. Command Line Options for QGEN |
||||
|
||||
Like DBGEN, QGEN is controlled by a combination of command line options |
||||
and environment variables (See "Environment Variables", below for more |
||||
detail). Command line options are assumed to be single |
||||
letter flags preceded by a minus sign. They may be followed by an |
||||
optional argument. |
||||
|
||||
option argument default action |
||||
------ -------- ------- ------ |
||||
-c none Retain comments in translation of template to |
||||
EQT |
||||
|
||||
-d none Default. Use the parameter substitutions |
||||
required for query validation |
||||
|
||||
-h Display a usage summary |
||||
|
||||
-i <file> Use contents of <file> to init a query stream |
||||
|
||||
-l <file> Save query parameters to <file> |
||||
|
||||
-n <name> Use database <name> for queries |
||||
|
||||
-N Always use default rowcount, and ignore :n directives |
||||
|
||||
-o <path> Save query n's output in <path>/n.<stream> |
||||
Uses -p option, and uses :o tag |
||||
|
||||
-p <stream> Use the query permutation defined for |
||||
stream <stream>. If this option is |
||||
omited, EQT will be generated for the |
||||
queries named on the command line. |
||||
|
||||
-r <n> Seed the rnadom number generator with <n> |
||||
|
||||
-s <n> Set scale to <n> for parameter |
||||
substitutions. |
||||
|
||||
-t <file> Use contents of <file> to complete a query |
||||
stream |
||||
|
||||
-T none Use time table format for date substitution |
||||
|
||||
-v none Verbose. Progress messages are |
||||
displayed as data is generated. |
||||
|
||||
-x none Generate a query plan as part of query |
||||
execution. |
||||
|
||||
11. Query Template Syntax |
||||
|
||||
QGEN is a simple ASCII text filter, meant to translate query generalized |
||||
query syntax("query template") into the executable query text(EQT) re- |
||||
quired by the benchmarks. It provides a number of shorthands and syntactic |
||||
extensions that allow the automatic generation of query parameters and some |
||||
control over the operation of the benchmark implementation. |
||||
|
||||
QGEN first strips all comments from the query template, recognizing both |
||||
{comment} and --comment styles. Next it traverses the query template |
||||
one line at a time, locating required substitution points, called |
||||
parameter tags. The values substituted for a given tag are summarized |
||||
below. QGEN does not support nested substitutions. That is, if |
||||
the text substituted for tag itself contains a valid tag the second tag |
||||
will not be expanded. |
||||
|
||||
Tag Converted To Based on |
||||
=== ============ ======== |
||||
:c database <dbname>;(1) -n from the command line |
||||
:x set explain on;(1) -x from the command line |
||||
:<number> paremeter <number> |
||||
:s stream number |
||||
:o output to outpath/qnum.stream;(1) |
||||
-o from command line, -s from |
||||
command line |
||||
:b BEGIN WORK;(1) -a from comand line |
||||
:e COMMIT WORK(1) -a from command line |
||||
:q query number |
||||
:n <number> sets rowcount to be returned |
||||
to <number>, unless -N appears on the command line |
||||
|
||||
Notes: |
||||
(1) This is Informix-specific syntax. Refer to Porting.Notes for |
||||
tailoring the generated text to your database environment. |
||||
|
||||
12. Sample QGEN executions and Query Templates |
||||
|
||||
QGEN translates generic query templates into valid SQL. In addition, it |
||||
allows conditional inclusion of the commands necessary to connect to a |
||||
database, produce diagnostic output, etc. Here are some sample of QGEN |
||||
usage, and the way that command line parameters and the query templates |
||||
interact to produce valid SQL. |
||||
|
||||
Template, in $DSS_QUERY/1.sql: |
||||
:c |
||||
:o |
||||
select count(*) from foo; |
||||
:x |
||||
select count(*) from lineitem |
||||
where l_orderdate < ':1'; |
||||
|
||||
1. "qgen 1", would produce: |
||||
select count(*) from foo; |
||||
select count(*) from lineitem |
||||
where l_orderdate < '1997-01-01'; |
||||
Assuming that 1 January 1997 was a valid substitution for parameter 1. |
||||
|
||||
2. "qgen -d -c dss1 1, would produce: |
||||
database dss1; |
||||
select count(*) from foo; |
||||
select count(*) from lineitem |
||||
where l_orderdate < '1995-07-18'; |
||||
Assuming that 18 July 1995 was the default substitution for parameter 1, |
||||
and using Informix syntax. |
||||
|
||||
3. "qgen -d -c dss1 -x -o somepath 1, would produce: |
||||
database dss1; |
||||
output to "somepath/1.0" |
||||
select count(*) from foo; |
||||
set explain on; |
||||
select count(*) from lineitem |
||||
where l_orderdate < '1995-07-18'; |
||||
Assuming that 18 July 1995 was the default substitution for parameter 1, |
||||
and using Informix syntax. |
||||
|
||||
|
||||
13. Environment Variables |
||||
|
||||
Enviroment variables are used to control features of DBGEN and QGEN |
||||
which are unlikely to change from one execution to another. |
||||
|
||||
Variable Default Action |
||||
------- ------- ------ |
||||
DSS_PATH . Directory in which to build flat files |
||||
DSS_CONFIG . Directory in which to find configuration files |
||||
DSS_DIST dists.dss Name of distribution definition file |
||||
DSS_QUERY . Directory in which to find query templates |
||||
|
||||
14. Version Numbering in DBGEN and QGEN |
||||
|
||||
DBGEN and QGEN use a common version numbering algorithm. Each executable |
||||
is stamped with a version number which is displayed in the usage messages |
||||
available with the '-h' option. A version number is of the form: |
||||
|
||||
V.R.P.M |
||||
| | | | |
||||
| | | | |
||||
| | | | |
||||
| | | -- modification: alphabetic, incremented for any trivial changes |
||||
| | | to the source (e.g, porting ifdef's) |
||||
| | ---- patch level: numeric, incremented for any minor bug fix |
||||
| | (e.g, qgen parameter range) |
||||
| ------- release: numeric, incremented for each minor revision of the |
||||
| specification |
||||
|-------- version: numeric, incremented for each major revision of the |
||||
specification |
||||
|
||||
An implementation of TPC-H is valid only if it conforms to the |
||||
following version usage rules: |
||||
|
||||
-- The Version of DBGEN and QGEN must match the integer portion of the |
||||
current specification revision |
||||
|
||||
15. The current revisions are: |
||||
DBGEN: 2.4.0 |
||||
QGEN: 2.4.0 |
||||
|
||||
16. Validated Platforms |
||||
The following platforms have been validated to produce the reference |
||||
data set for TPC-H 2.4.0 |
||||
Processor Operating System (version) Compiler (version) Compiler Flags |
||||
---------------------------------------------------------------------------- |
||||
POWER5 AIX 64-bit (5.3) C for AIX Compiler, v7 -q64 (no -g) |
||||
IA-64 HPUX 64-bit () icc |
||||
Linux 32-bit () gcc |
||||
|
@ -0,0 +1,5 @@ |
||||
l|l|sum_qty |sum_base_price |sum_disc_price |sum_charge |avg_qty |avg_price |avg_disc |count_order |
||||
A|F|37734107.00|56586554400.73|53758257134.87|55909065222.83|25.52|38273.13|0.05| 1478493 |
||||
N|F|991417.00|1487504710.38|1413082168.05|1469649223.19|25.52|38284.47|0.05| 38854 |
||||
N|O|74476040.00|111701729697.74|106118230307.61|110367043872.50|25.50|38249.12|0.05| 2920374 |
||||
R|F|37719753.00|56568041380.90|53741292684.60|55889619119.83|25.51|38250.85|0.05| 1478870 |
@ -0,0 +1,21 @@ |
||||
c_custkey |c_name |revenue |c_acctbal |n_name |c_address |c_phone |c_comment |
||||
57040|Customer#000057040 |734235.25|632.87|JAPAN |Eioyzjf4pp |22-895-641-3466|sits. slyly regular requests sleep alongside of the regular inst |
||||
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 |
||||
60838|Customer#000060838 |679127.31|2454.77|BRAZIL |64EaJ5vMAHWJlBOxJklpNc2RJiWE |12-913-494-9813| need to boost against the slyly regular account |
||||
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 |
||||
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 |
||||
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 |
||||
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 |
||||
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 |
||||
54289|Customer#000054289 |585603.39|5583.02|IRAN |vXCxoCsU0Bad5JQI ,oobkZ |20-834-292-4707|ely special foxes are quickly finally ironic p |
||||
39922|Customer#000039922 |584878.11|7321.11|GERMANY |Zgy4s50l2GKN4pLDPBU8m342gIw6R |17-147-757-8036|y final requests. furiously final foxes cajole blithely special platelets. f |
||||
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 |
||||
922|Customer#000000922 |576767.53|3869.25|GERMANY |Az9RFaut7NkPnc5zSD2PwHgVwr4jRzq |17-945-916-9648|luffily fluffy deposits. packages c |
||||
147946|Customer#000147946 |576455.13|2030.13|ALGERIA |iANyZHjqhyy7Ajah0pTrYyhJ |10-886-956-3143|ithely ironic deposits haggle blithely ironic requests. quickly regu |
||||
115640|Customer#000115640 |569341.19|6436.10|ARGENTINA |Vtgfia9qI 7EpHgecU1X |11-411-543-4901|ost slyly along the patterns; pinto be |
||||
73606|Customer#000073606 |568656.86|1785.67|JAPAN |xuR0Tro5yChDfOCrjkd2ol |22-437-653-6966|he furiously regular ideas. slowly |
||||
110246|Customer#000110246 |566842.98|7763.35|VIETNAM |7KzflgX MDOq7sOkI |31-943-426-9837|egular deposits serve blithely above the fl |
||||
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. |
||||
146149|Customer#000146149 |557254.99|1791.55|ROMANIA |s87fvzFQpU |29-744-164-6487| of the slyly silent accounts. quickly final accounts across the |
||||
52528|Customer#000052528 |556397.35|551.79|ARGENTINA |NFztyTOR10UOJ |11-208-192-3205| deposits hinder. blithely pending asymptotes breach slyly regular re |
||||
23431|Customer#000023431 |554269.54|3381.86|ROMANIA |HgiV0phqhaIa9aydNoIlb |29-915-458-2654|nusual, even instructions: furiously stealthy n |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,3 @@ |
||||
l_shipmode|high_line_count |low_line_count |
||||
MAIL | 6202| 9324 |
||||
SHIP | 6200| 9262 |
@ -0,0 +1,43 @@ |
||||
c_count |custdist |
||||
0| 50005 |
||||
9| 6641 |
||||
10| 6532 |
||||
11| 6014 |
||||
8| 5937 |
||||
12| 5639 |
||||
13| 5024 |
||||
19| 4793 |
||||
7| 4687 |
||||
17| 4587 |
||||
18| 4529 |
||||
20| 4516 |
||||
15| 4505 |
||||
14| 4446 |
||||
16| 4273 |
||||
21| 4190 |
||||
22| 3623 |
||||
6| 3265 |
||||
23| 3225 |
||||
24| 2742 |
||||
25| 2086 |
||||
5| 1948 |
||||
26| 1612 |
||||
27| 1179 |
||||
4| 1007 |
||||
28| 893 |
||||
29| 593 |
||||
3| 415 |
||||
30| 376 |
||||
31| 226 |
||||
32| 148 |
||||
2| 134 |
||||
33| 75 |
||||
34| 50 |
||||
35| 37 |
||||
1| 17 |
||||
36| 14 |
||||
38| 5 |
||||
37| 5 |
||||
40| 4 |
||||
41| 2 |
||||
39| 1 |
@ -0,0 +1,2 @@ |
||||
promo_revenue |
||||
16.38 |
@ -0,0 +1,2 @@ |
||||
s_suppkey |s_name |s_address |s_phone |total_revenue |
||||
8449|Supplier#000008449 |Wp34zim9qYFbVctdW |20-469-856-8873|1772627.21 |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,2 @@ |
||||
avg_yearly |
||||
348406.02 |
@ -0,0 +1,58 @@ |
||||
c_name |c_custkey |o_orderkey |o_orderdat|o_totalprice |col6 |
||||
Customer#000128120 | 128120| 4722021|1994-04-07|544089.09|323.00 |
||||
Customer#000144617 | 144617| 3043270|1997-02-12|530604.44|317.00 |
||||
Customer#000013940 | 13940| 2232932|1997-04-13|522720.61|304.00 |
||||
Customer#000066790 | 66790| 2199712|1996-09-30|515531.82|327.00 |
||||
Customer#000046435 | 46435| 4745607|1997-07-03|508047.99|309.00 |
||||
Customer#000015272 | 15272| 3883783|1993-07-28|500241.33|302.00 |
||||
Customer#000146608 | 146608| 3342468|1994-06-12|499794.58|303.00 |
||||
Customer#000096103 | 96103| 5984582|1992-03-16|494398.79|312.00 |
||||
Customer#000024341 | 24341| 1474818|1992-11-15|491348.26|302.00 |
||||
Customer#000137446 | 137446| 5489475|1997-05-23|487763.25|311.00 |
||||
Customer#000107590 | 107590| 4267751|1994-11-04|485141.38|301.00 |
||||
Customer#000050008 | 50008| 2366755|1996-12-09|483891.26|302.00 |
||||
Customer#000015619 | 15619| 3767271|1996-08-07|480083.96|318.00 |
||||
Customer#000077260 | 77260| 1436544|1992-09-12|479499.43|307.00 |
||||
Customer#000109379 | 109379| 5746311|1996-10-10|478064.11|302.00 |
||||
Customer#000054602 | 54602| 5832321|1997-02-09|471220.08|307.00 |
||||
Customer#000105995 | 105995| 2096705|1994-07-03|469692.58|307.00 |
||||
Customer#000148885 | 148885| 2942469|1992-05-31|469630.44|313.00 |
||||
Customer#000114586 | 114586| 551136|1993-05-19|469605.59|308.00 |
||||
Customer#000105260 | 105260| 5296167|1996-09-06|469360.57|303.00 |
||||
Customer#000147197 | 147197| 1263015|1997-02-02|467149.67|320.00 |
||||
Customer#000064483 | 64483| 2745894|1996-07-04|466991.35|304.00 |
||||
Customer#000136573 | 136573| 2761378|1996-05-31|461282.73|301.00 |
||||
Customer#000016384 | 16384| 502886|1994-04-12|458378.92|312.00 |
||||
Customer#000117919 | 117919| 2869152|1996-06-20|456815.92|317.00 |
||||
Customer#000012251 | 12251| 735366|1993-11-24|455107.26|309.00 |
||||
Customer#000120098 | 120098| 1971680|1995-06-14|453451.23|308.00 |
||||
Customer#000066098 | 66098| 5007490|1992-08-07|453436.16|304.00 |
||||
Customer#000117076 | 117076| 4290656|1997-02-05|449545.85|301.00 |
||||
Customer#000129379 | 129379| 4720454|1997-06-07|448665.79|303.00 |
||||
Customer#000126865 | 126865| 4702759|1994-11-07|447606.65|320.00 |
||||
Customer#000088876 | 88876| 983201|1993-12-30|446717.46|304.00 |
||||
Customer#000036619 | 36619| 4806726|1995-01-17|446704.09|328.00 |
||||
Customer#000141823 | 141823| 2806245|1996-12-29|446269.12|310.00 |
||||
Customer#000053029 | 53029| 2662214|1993-08-13|446144.49|302.00 |
||||
Customer#000018188 | 18188| 3037414|1995-01-25|443807.22|308.00 |
||||
Customer#000066533 | 66533| 29158|1995-10-21|443576.50|305.00 |
||||
Customer#000037729 | 37729| 4134341|1995-06-29|441082.97|309.00 |
||||
Customer#000003566 | 3566| 2329187|1998-01-04|439803.36|304.00 |
||||
Customer#000045538 | 45538| 4527553|1994-05-22|436275.31|305.00 |
||||
Customer#000081581 | 81581| 4739650|1995-11-04|435405.90|305.00 |
||||
Customer#000119989 | 119989| 1544643|1997-09-20|434568.25|320.00 |
||||
Customer#000003680 | 3680| 3861123|1998-07-03|433525.97|301.00 |
||||
Customer#000113131 | 113131| 967334|1995-12-15|432957.75|301.00 |
||||
Customer#000141098 | 141098| 565574|1995-09-24|430986.69|301.00 |
||||
Customer#000093392 | 93392| 5200102|1997-01-22|425487.51|304.00 |
||||
Customer#000015631 | 15631| 1845057|1994-05-12|419879.59|302.00 |
||||
Customer#000112987 | 112987| 4439686|1996-09-17|418161.49|305.00 |
||||
Customer#000012599 | 12599| 4259524|1998-02-12|415200.61|304.00 |
||||
Customer#000105410 | 105410| 4478371|1996-03-05|412754.51|302.00 |
||||
Customer#000149842 | 149842| 5156581|1994-05-30|411329.35|302.00 |
||||
Customer#000010129 | 10129| 5849444|1994-03-21|409129.85|309.00 |
||||
Customer#000069904 | 69904| 1742403|1996-10-19|408513.00|305.00 |
||||
Customer#000017746 | 17746| 6882|1997-04-09|408446.93|303.00 |
||||
Customer#000013072 | 13072| 1481925|1998-03-15|399195.47|301.00 |
||||
Customer#000082441 | 82441| 857959|1994-02-07|382579.74|305.00 |
||||
Customer#000088703 | 88703| 2995076|1994-01-30|363812.12|302.00 |
@ -0,0 +1,2 @@ |
||||
revenue |
||||
3083843.06 |
@ -0,0 +1,101 @@ |
||||
s_acctbal |s_name |n_name |p_partkey |p_mfgr |s_address |s_phone |s_comment |
||||
9938.53|Supplier#000005359 |UNITED KINGDOM | 185358|Manufacturer#4 |QKuHYh,vZGiwu2FWEJoLDx04 |33-429-790-6131|uriously regular requests hag |
||||
9937.84|Supplier#000005969 |ROMANIA | 108438|Manufacturer#1 |ANDENSOSmk,miq23Xfb5RWt6dvUcvt6Qa |29-520-692-3537|efully express instructions. regular requests against the slyly fin |
||||
9936.22|Supplier#000005250 |UNITED KINGDOM | 249|Manufacturer#4 |B3rqp0xbSEim4Mpy2RH J |33-320-228-2957|etect about the furiously final accounts. slyly ironic pinto beans sleep inside the furiously |
||||
9923.77|Supplier#000002324 |GERMANY | 29821|Manufacturer#4 |y3OD9UywSTOk |17-779-299-1839|ackages boost blithely. blithely regular deposits c |
||||
9871.22|Supplier#000006373 |GERMANY | 43868|Manufacturer#5 |J8fcXWsTqM |17-813-485-8637|etect blithely bold asymptotes. fluffily ironic platelets wake furiously; blit |
||||
9870.78|Supplier#000001286 |GERMANY | 81285|Manufacturer#2 |YKA,E2fjiVd7eUrzp2Ef8j1QxGo2DFnosaTEH |17-516-924-4574| regular accounts. furiously unusual courts above the fi |
||||
9870.78|Supplier#000001286 |GERMANY | 181285|Manufacturer#4 |YKA,E2fjiVd7eUrzp2Ef8j1QxGo2DFnosaTEH |17-516-924-4574| regular accounts. furiously unusual courts above the fi |
||||
9852.52|Supplier#000008973 |RUSSIA | 18972|Manufacturer#2 |t5L67YdBYYH6o,Vz24jpDyQ9 |32-188-594-7038|rns wake final foxes. carefully unusual depende |
||||
9847.83|Supplier#000008097 |RUSSIA | 130557|Manufacturer#2 |xMe97bpE69NzdwLoX |32-375-640-3593| the special excuses. silent sentiments serve carefully final ac |
||||
9847.57|Supplier#000006345 |FRANCE | 86344|Manufacturer#1 |VSt3rzk3qG698u6ld8HhOByvrTcSTSvQlDQDag |16-886-766-7945|ges. slyly regular requests are. ruthless, express excuses cajole blithely across the unu |
||||
9847.57|Supplier#000006345 |FRANCE | 173827|Manufacturer#2 |VSt3rzk3qG698u6ld8HhOByvrTcSTSvQlDQDag |16-886-766-7945|ges. slyly regular requests are. ruthless, express excuses cajole blithely across the unu |
||||
9836.93|Supplier#000007342 |RUSSIA | 4841|Manufacturer#4 |JOlK7C1,7xrEZSSOw |32-399-414-5385|blithely carefully bold theodolites. fur |
||||
9817.10|Supplier#000002352 |RUSSIA | 124815|Manufacturer#2 |4LfoHUZjgjEbAKw TgdKcgOc4D4uCYw |32-551-831-1437|wake carefully alongside of the carefully final ex |
||||
9817.10|Supplier#000002352 |RUSSIA | 152351|Manufacturer#3 |4LfoHUZjgjEbAKw TgdKcgOc4D4uCYw |32-551-831-1437|wake carefully alongside of the carefully final ex |
||||
9739.86|Supplier#000003384 |FRANCE | 138357|Manufacturer#2 |o,Z3v4POifevE k9U1b 6J1ucX,I |16-494-913-5925|s after the furiously bold packages sleep fluffily idly final requests: quickly final |
||||
9721.95|Supplier#000008757 |UNITED KINGDOM | 156241|Manufacturer#3 |Atg6GnM4dT2 |33-821-407-2995|eep furiously sauternes; quickl |
||||
9681.33|Supplier#000008406 |RUSSIA | 78405|Manufacturer#1 |,qUuXcftUl |32-139-873-8571|haggle slyly regular excuses. quic |
||||
9643.55|Supplier#000005148 |ROMANIA | 107617|Manufacturer#1 |kT4ciVFslx9z4s79p Js825 |29-252-617-4850|final excuses. final ideas boost quickly furiously speci |
||||
9624.82|Supplier#000001816 |FRANCE | 34306|Manufacturer#3 |e7vab91vLJPWxxZnewmnDBpDmxYHrb |16-392-237-6726|e packages are around the special ideas. special, pending foxes us |
||||
9624.78|Supplier#000009658 |ROMANIA | 189657|Manufacturer#1 |oE9uBgEfSS4opIcepXyAYM,x |29-748-876-2014|ronic asymptotes wake bravely final |
||||
9612.94|Supplier#000003228 |ROMANIA | 120715|Manufacturer#2 |KDdpNKN3cWu7ZSrbdqp7AfSLxx,qWB |29-325-784-8187|warhorses. quickly even deposits sublate daringly ironic instructions. slyly blithe t |
||||
9612.94|Supplier#000003228 |ROMANIA | 198189|Manufacturer#4 |KDdpNKN3cWu7ZSrbdqp7AfSLxx,qWB |29-325-784-8187|warhorses. quickly even deposits sublate daringly ironic instructions. slyly blithe t |
||||
9571.83|Supplier#000004305 |ROMANIA | 179270|Manufacturer#2 |qNHZ7WmCzygwMPRDO9Ps |29-973-481-1831|kly carefully express asymptotes. furiou |
||||
9558.10|Supplier#000003532 |UNITED KINGDOM | 88515|Manufacturer#4 |EOeuiiOn21OVpTlGguufFDFsbN1p0lhpxHp |33-152-301-2164| foxes. quickly even excuses use. slyly special foxes nag bl |
||||
9492.79|Supplier#000005975 |GERMANY | 25974|Manufacturer#5 |S6mIiCTx82z7lV |17-992-579-4839|arefully pending accounts. blithely regular excuses boost carefully carefully ironic p |
||||
9461.05|Supplier#000002536 |UNITED KINGDOM | 20033|Manufacturer#1 |8mmGbyzaU 7ZS2wJumTibypncu9pNkDc4FYA |33-556-973-5522|. slyly regular deposits wake slyly. furiously regular warthogs are. |
||||
9453.01|Supplier#000000802 |ROMANIA | 175767|Manufacturer#1 |,6HYXb4uaHITmtMBj4Ak57Pd |29-342-882-6463|gular frets. permanently special multipliers believe blithely alongs |
||||
9408.65|Supplier#000007772 |UNITED KINGDOM | 117771|Manufacturer#4 |AiC5YAH,gdu0i7 |33-152-491-1126|nag against the final requests. furiously unusual packages cajole blit |
||||
9359.61|Supplier#000004856 |ROMANIA | 62349|Manufacturer#5 |HYogcF3Jb yh1 |29-334-870-9731|y ironic theodolites. blithely sile |
||||
9357.45|Supplier#000006188 |UNITED KINGDOM | 138648|Manufacturer#1 |g801,ssP8wpTk4Hm |33-583-607-1633|ously always regular packages. fluffily even accounts beneath the furiously final pack |
||||
9352.04|Supplier#000003439 |GERMANY | 170921|Manufacturer#4 |qYPDgoiBGhCYxjgC |17-128-996-4650| according to the carefully bold ideas |
||||
9312.97|Supplier#000007807 |RUSSIA | 90279|Manufacturer#5 |oGYMPCk9XHGB2PBfKRnHA |32-673-872-5854|ecial packages among the pending, even requests use regula |
||||
9312.97|Supplier#000007807 |RUSSIA | 100276|Manufacturer#5 |oGYMPCk9XHGB2PBfKRnHA |32-673-872-5854|ecial packages among the pending, even requests use regula |
||||
9280.27|Supplier#000007194 |ROMANIA | 47193|Manufacturer#3 |zhRUQkBSrFYxIAXTfInj vyGRQjeK |29-318-454-2133|o beans haggle after the furiously unusual deposits. carefully silent dolphins cajole carefully |
||||
9274.80|Supplier#000008854 |RUSSIA | 76346|Manufacturer#3 |1xhLoOUM7I3mZ1mKnerw OSqdbb4QbGa |32-524-148-5221|y. courts do wake slyly. carefully ironic platelets haggle above the slyly regular the |
||||
9249.35|Supplier#000003973 |FRANCE | 26466|Manufacturer#1 |d18GiDsL6Wm2IsGXM,RZf1jCsgZAOjNYVThTRP4 |16-722-866-1658|uests are furiously. regular tithes through the regular, final accounts cajole furiously above the q |
||||
9249.35|Supplier#000003973 |FRANCE | 33972|Manufacturer#1 |d18GiDsL6Wm2IsGXM,RZf1jCsgZAOjNYVThTRP4 |16-722-866-1658|uests are furiously. regular tithes through the regular, final accounts cajole furiously above the q |
||||
9208.70|Supplier#000007769 |ROMANIA | 40256|Manufacturer#5 |rsimdze 5o9P Ht7xS |29-964-424-9649|lites was quickly above the furiously ironic requests. slyly even foxes against the blithely bold |
||||
9201.47|Supplier#000009690 |UNITED KINGDOM | 67183|Manufacturer#5 |CB BnUTlmi5zdeEl7R7 |33-121-267-9529|e even, even foxes. blithely ironic packages cajole regular packages. slyly final ide |
||||
9192.10|Supplier#000000115 |UNITED KINGDOM | 85098|Manufacturer#3 |nJ 2t0f7Ve,wL1,6WzGBJLNBUCKlsV |33-597-248-1220|es across the carefully express accounts boost caref |
||||
9189.98|Supplier#000001226 |GERMANY | 21225|Manufacturer#4 |qsLCqSvLyZfuXIpjz |17-725-903-1381| deposits. blithely bold excuses about the slyly bold forges wake |
||||
9128.97|Supplier#000004311 |RUSSIA | 146768|Manufacturer#5 |I8IjnXd7NSJRs594RxsRR0 |32-155-440-7120|refully. blithely unusual asymptotes haggle |
||||
9104.83|Supplier#000008520 |GERMANY | 150974|Manufacturer#4 |RqRVDgD0ER J9 b41vR2,3 |17-728-804-1793|ly about the blithely ironic depths. slyly final theodolites among the fluffily bold ideas print |
||||
9101.00|Supplier#000005791 |ROMANIA | 128254|Manufacturer#5 |zub2zCV,jhHPPQqi,P2INAjE1zI n66cOEoXFG |29-549-251-5384|ts. notornis detect blithely above the carefully bold requests. blithely even package |
||||
9094.57|Supplier#000004582 |RUSSIA | 39575|Manufacturer#1 |WB0XkCSG3r,mnQ n,h9VIxjjr9ARHFvKgMDf |32-587-577-1351|jole. regular accounts sleep blithely frets. final pinto beans play furiously past the |
||||
8996.87|Supplier#000004702 |FRANCE | 102191|Manufacturer#5 |8XVcQK23akp |16-811-269-8946|ickly final packages along the express plat |
||||
8996.14|Supplier#000009814 |ROMANIA | 139813|Manufacturer#2 |af0O5pg83lPU4IDVmEylXZVqYZQzSDlYLAmR |29-995-571-8781| dependencies boost quickly across the furiously pending requests! unusual dolphins play sl |
||||
8968.42|Supplier#000010000 |ROMANIA | 119999|Manufacturer#5 |aTGLEusCiL4F PDBdv665XBJhPyCOB0i |29-578-432-2146|ly regular foxes boost slyly. quickly special waters boost carefully ironi |
||||
8936.82|Supplier#000007043 |UNITED KINGDOM | 109512|Manufacturer#1 |FVajceZInZdbJE6Z9XsRUxrUEpiwHDrOXi,1Rz |33-784-177-8208|efully regular courts. furiousl |
||||
8929.42|Supplier#000008770 |FRANCE | 173735|Manufacturer#4 |R7cG26TtXrHAP9 HckhfRi |16-242-746-9248|cajole furiously unusual requests. quickly stealthy requests are. |
||||
8920.59|Supplier#000003967 |ROMANIA | 26460|Manufacturer#1 |eHoAXe62SY9 |29-194-731-3944|aters. express, pending instructions sleep. brave, r |
||||
8920.59|Supplier#000003967 |ROMANIA | 173966|Manufacturer#2 |eHoAXe62SY9 |29-194-731-3944|aters. express, pending instructions sleep. brave, r |
||||
8913.96|Supplier#000004603 |UNITED KINGDOM | 137063|Manufacturer#2 |OUzlvMUr7n,utLxmPNeYKSf3T24OXskxB5 |33-789-255-7342| haggle slyly above the furiously regular pinto beans. even |
||||
8877.82|Supplier#000007967 |FRANCE | 167966|Manufacturer#5 |A3pi1BARM4nx6R,qrwFoRPU |16-442-147-9345|ously foxes. express, ironic requests im |
||||
8862.24|Supplier#000003323 |ROMANIA | 73322|Manufacturer#3 |W9 lYcsC9FwBqk3ItL |29-736-951-3710|ly pending ideas sleep about the furiously unu |
||||
8841.59|Supplier#000005750 |ROMANIA | 100729|Manufacturer#5 |Erx3lAgu0g62iaHF9x50uMH4EgeN9hEG |29-344-502-5481|gainst the pinto beans. fluffily unusual dependencies affix slyly even deposits. |
||||
8781.71|Supplier#000003121 |ROMANIA | 13120|Manufacturer#5 |wNqTogx238ZYCamFb,50v,bj 4IbNFW9Bvw1xP |29-707-291-5144|s wake quickly ironic ideas |
||||
8754.24|Supplier#000009407 |UNITED KINGDOM | 179406|Manufacturer#4 |CHRCbkaWcf5B |33-903-970-9604|e ironic requests. carefully even foxes above the furious |
||||
8691.06|Supplier#000004429 |UNITED KINGDOM | 126892|Manufacturer#2 |k,BQms5UhoAF1B2Asi,fLib |33-964-337-5038|efully express deposits kindle after the deposits. final |
||||
8655.99|Supplier#000006330 |RUSSIA | 193810|Manufacturer#2 |UozlaENr0ytKe2w6CeIEWFWn iO3S8Rae7Ou |32-561-198-3705|symptotes use about the express dolphins. requests use after the express platelets. final, ex |
||||
8638.36|Supplier#000002920 |RUSSIA | 75398|Manufacturer#1 |Je2a8bszf3L |32-122-621-7549|ly quickly ironic requests. even requests whithout t |
||||
8638.36|Supplier#000002920 |RUSSIA | 170402|Manufacturer#3 |Je2a8bszf3L |32-122-621-7549|ly quickly ironic requests. even requests whithout t |
||||
8607.69|Supplier#000006003 |UNITED KINGDOM | 76002|Manufacturer#2 |EH9wADcEiuenM0NR08zDwMidw,52Y2RyILEiA |33-416-807-5206|ar, pending accounts. pending depende |
||||
8569.52|Supplier#000005936 |RUSSIA | 5935|Manufacturer#5 |jXaNZ6vwnEWJ2ksLZJpjtgt0bY2a3AU |32-644-251-7916|. regular foxes nag carefully atop the regular, silent deposits. quickly regular packages |
||||
8564.12|Supplier#000000033 |GERMANY | 110032|Manufacturer#1 |gfeKpYw3400L0SDywXA6Ya1Qmq1w6YB9f3R |17-138-897-9374|n sauternes along the regular asymptotes are regularly along the |
||||
8553.82|Supplier#000003979 |ROMANIA | 143978|Manufacturer#4 |BfmVhCAnCMY3jzpjUMy4CNWs9 HzpdQR7INJU |29-124-646-4897|ic requests wake against the blithely unusual accounts. fluffily r |
||||
8517.23|Supplier#000009529 |RUSSIA | 37025|Manufacturer#5 |e44R8o7JAIS9iMcr |32-565-297-8775|ove the even courts. furiously special platelets |
||||
8517.23|Supplier#000009529 |RUSSIA | 59528|Manufacturer#2 |e44R8o7JAIS9iMcr |32-565-297-8775|ove the even courts. furiously special platelets |
||||
8503.70|Supplier#000006830 |RUSSIA | 44325|Manufacturer#4 |BC4WFCYRUZyaIgchU 4S |32-147-878-5069|pades cajole. furious packages among the carefully express excuses boost furiously across th |
||||
8457.09|Supplier#000009456 |UNITED KINGDOM | 19455|Manufacturer#1 |7SBhZs8gP1cJjT0Qf433YBk |33-858-440-4349|cing requests along the furiously unusual deposits promise among the furiously unus |
||||
8441.40|Supplier#000003817 |FRANCE | 141302|Manufacturer#2 |hU3fz3xL78 |16-339-356-5115|ely even ideas. ideas wake slyly furiously unusual instructions. pinto beans sleep ag |
||||
8432.89|Supplier#000003990 |RUSSIA | 191470|Manufacturer#1 |wehBBp1RQbfxAYDASS75MsywmsKHRVdkrvNe6m |32-839-509-9301|ep furiously. packages should have to haggle slyly across the deposits. furiously regu |
||||
8431.40|Supplier#000002675 |ROMANIA | 5174|Manufacturer#1 |HJFStOu9R5NGPOegKhgbzBdyvrG2yh8w |29-474-643-1443|ithely express pinto beans. blithely even foxes haggle. furiously regular theodol |
||||
8407.04|Supplier#000005406 |RUSSIA | 162889|Manufacturer#4 |j7 gYF5RW8DC5UrjKC |32-626-152-4621|r the blithely regular packages. slyly ironic theodoli |
||||
8386.08|Supplier#000008518 |FRANCE | 36014|Manufacturer#3 |2jqzqqAVe9crMVGP,n9nTsQXulNLTUYoJjEDcqWV|16-618-780-7481|blithely bold pains are carefully platelets. finally regular pinto beans sleep carefully special |
||||
8376.52|Supplier#000005306 |UNITED KINGDOM | 190267|Manufacturer#5 |9t8Y8 QqSIsoADPt6NLdk,TP5zyRx41oBUlgoGc9|33-632-514-7931|ly final accounts sleep special, regular requests. furiously regular |
||||
8348.74|Supplier#000008851 |FRANCE | 66344|Manufacturer#4 |nWxi7GwEbjhw1 |16-796-240-2472| boldly final deposits. regular, even instructions detect slyly. fluffily unusual pinto bea |
||||
8338.58|Supplier#000007269 |FRANCE | 17268|Manufacturer#4 |ZwhJSwABUoiB04,3 |16-267-277-4365|iously final accounts. even pinto beans cajole slyly regular |
||||
8328.46|Supplier#000001744 |ROMANIA | 69237|Manufacturer#5 |oLo3fV64q2,FKHa3p,qHnS7Yzv,ps8 |29-330-728-5873|ep carefully-- even, careful packages are slyly along t |
||||
8307.93|Supplier#000003142 |GERMANY | 18139|Manufacturer#1 |dqblvV8dCNAorGlJ |17-595-447-6026|olites wake furiously regular decoys. final requests nod |
||||
8231.61|Supplier#000009558 |RUSSIA | 192000|Manufacturer#2 |mcdgen,yT1iJDHDS5fV |32-762-137-5858| foxes according to the furi |
||||
8152.61|Supplier#000002731 |ROMANIA | 15227|Manufacturer#4 | nluXJCuY1tu |29-805-463-2030| special requests. even, regular warhorses affix among the final gr |
||||
8109.09|Supplier#000009186 |FRANCE | 99185|Manufacturer#1 |wgfosrVPexl9pEXWywaqlBMDYYf |16-668-570-1402|tions haggle slyly about the sil |
||||
8102.62|Supplier#000003347 |UNITED KINGDOM | 18344|Manufacturer#5 |m CtXS2S16i |33-454-274-8532|egrate with the slyly bold instructions. special foxes haggle silently among the |
||||
8046.07|Supplier#000008780 |FRANCE | 191222|Manufacturer#3 |AczzuE0UK9osj ,Lx0Jmh |16-473-215-6395|onic platelets cajole after the regular instructions. permanently bold excuses |
||||
8042.09|Supplier#000003245 |RUSSIA | 135705|Manufacturer#4 |Dh8Ikg39onrbOL4DyTfGw8a9oKUX3d9Y |32-836-132-8872|osits. packages cajole slyly. furiously regular deposits cajole slyly. q |
||||
8042.09|Supplier#000003245 |RUSSIA | 150729|Manufacturer#1 |Dh8Ikg39onrbOL4DyTfGw8a9oKUX3d9Y |32-836-132-8872|osits. packages cajole slyly. furiously regular deposits cajole slyly. q |
||||
7992.40|Supplier#000006108 |FRANCE | 118574|Manufacturer#1 |8tBydnTDwUqfBfFV4l3 |16-974-998-8937| ironic ideas? fluffily even instructions wake. blithel |
||||
7980.65|Supplier#000001288 |FRANCE | 13784|Manufacturer#4 |zE,7HgVPrCn |16-646-464-8247|ully bold courts. escapades nag slyly. furiously fluffy theodo |
||||
7950.37|Supplier#000008101 |GERMANY | 33094|Manufacturer#5 |kkYvL6IuvojJgTNG IKkaXQDYgx8ILohj |17-627-663-8014|arefully unusual requests x-ray above the quickly final deposits. |
||||
7937.93|Supplier#000009012 |ROMANIA | 83995|Manufacturer#2 |iUiTziH,Ek3i4lwSgunXMgrcTzwdb |29-250-925-9690|to the blithely ironic deposits nag sly |
||||
7914.45|Supplier#000001013 |RUSSIA | 125988|Manufacturer#2 |riRcntps4KEDtYScjpMIWeYF6mNnR |32-194-698-3365| busily bold packages are dolphi |
||||
7912.91|Supplier#000004211 |GERMANY | 159180|Manufacturer#5 |2wQRVovHrm3,v03IKzfTd,1PYsFXQFFOG |17-266-947-7315|ay furiously regular platelets. cou |
||||
7912.91|Supplier#000004211 |GERMANY | 184210|Manufacturer#4 |2wQRVovHrm3,v03IKzfTd,1PYsFXQFFOG |17-266-947-7315|ay furiously regular platelets. cou |
||||
7894.56|Supplier#000007981 |GERMANY | 85472|Manufacturer#4 |NSJ96vMROAbeXP |17-963-404-3760|ic platelets affix after the furiously |
||||
7887.08|Supplier#000009792 |GERMANY | 164759|Manufacturer#3 |Y28ITVeYriT3kIGdV2K8fSZ V2UqT5H1Otz |17-988-938-4296|ckly around the carefully fluffy theodolites. slyly ironic pack |
||||
7871.50|Supplier#000007206 |RUSSIA | 104695|Manufacturer#1 |3w fNCnrVmvJjE95sgWZzvW |32-432-452-7731|ironic requests. furiously final theodolites cajole. final, express packages sleep. quickly reg |
||||
7852.45|Supplier#000005864 |RUSSIA | 8363|Manufacturer#4 |WCNfBPZeSXh3h,c |32-454-883-3821|usly unusual pinto beans. brave ideas sleep carefully quickly ironi |
||||
7850.66|Supplier#000001518 |UNITED KINGDOM | 86501|Manufacturer#1 |ONda3YJiHKJOC |33-730-383-3892|ifts haggle fluffily pending pai |
||||
7843.52|Supplier#000006683 |FRANCE | 11680|Manufacturer#4 |2Z0JGkiv01Y00oCFwUGfviIbhzCdy |16-464-517-8943| express, final pinto beans x-ray slyly asymptotes. unusual, unusual |
@ -0,0 +1,187 @@ |
||||
s_name |s_address |
||||
Supplier#000000020 |iybAE,RmTymrZVYaFZva2SH,j |
||||
Supplier#000000091 |YV45D7TkfdQanOOZ7q9QxkyGUapU1oOWU6q3 |
||||
Supplier#000000205 |rF uV8d0JNEk |
||||
Supplier#000000285 |Br7e1nnt1yxrw6ImgpJ7YdhFDjuBf |
||||
Supplier#000000287 |7a9SP7qW5Yku5PvSg |
||||
Supplier#000000354 |w8fOo5W,aS |
||||
Supplier#000000378 |FfbhyCxWvcPrO8ltp9 |
||||
Supplier#000000402 |i9Sw4DoyMhzhKXCH9By,AYSgmD |
||||
Supplier#000000530 |0qwCMwobKY OcmLyfRXlagA8ukENJv, |
||||
Supplier#000000555 |TfB,a5bfl3Ah 3Z 74GqnNs6zKVGM |
||||
Supplier#000000640 |mvvtlQKsTOsJj5Ihk7,cq |
||||
Supplier#000000729 |pqck2ppy758TQpZCUAjPvlU55K3QjfL7Bi |
||||
Supplier#000000736 |l6i2nMwVuovfKnuVgaSGK2rDy65DlAFLegiL7 |
||||
Supplier#000000761 |zlSLelQUj2XrvTTFnv7WAcYZGvvMTx882d4 |
||||
Supplier#000000887 |urEaTejH5POADP2ARrf |
||||
Supplier#000000935 |ij98czM 2KzWe7dDTOxB8sq0UfCdvrX |
||||
Supplier#000000975 |,AC e,tBpNwKb5xMUzeohxlRn, hdZJo73gFQF8y |
||||
Supplier#000001263 |rQWr6nf8ZhB2TAiIDIvo5Io |
||||
Supplier#000001367 |42YSkFcAXMMcucsqeEefOE4HeCC |
||||
Supplier#000001426 |bPOCc086oFm8sLtS,fGrH |
||||
Supplier#000001446 |lch9HMNU1R7a0LIybsUodVknk6 |
||||
Supplier#000001500 |wDmF5xLxtQch9ctVu, |
||||
Supplier#000001602 |uKNWIeafaM644 |
||||
Supplier#000001626 |UhxNRzUu1dtFmp0 |
||||
Supplier#000001682 |pXTkGxrTQVyH1Rr |
||||
Supplier#000001700 |7hMlCof1Y5zLFg |
||||
Supplier#000001726 |TeRY7TtTH24sEword7yAaSkjx8 |
||||
Supplier#000001730 |Rc8e,1Pybn r6zo0VJIEiD0UD vhk |
||||
Supplier#000001746 |qWsendlOekQG1aW4uq06uQaCm51se8lirv7 hBRd |
||||
Supplier#000001806 |M934fuZSnLW |
||||
Supplier#000001855 |MWk6EAeozXb |
||||
Supplier#000001931 |FpJbMU2h6ZR2eBv8I9NIxF |
||||
Supplier#000002022 | dwebGX7Id2pc25YvY33 |
||||
Supplier#000002036 |20ytTtVObjKUUI2WCB0A |
||||
Supplier#000002096 |kuxseyLtq QPLXxm9ZUrnB6Kkh92JtK5cQzzXNU |
||||
Supplier#000002117 |MRtkgKolHJ9Wh X9J,urANHKDzvjr |
||||
Supplier#000002204 |uYmlr46C06udCqanj0KiRsoTQakZsEyssL |
||||
Supplier#000002218 |nODZw5q4dx kp0K5 |
||||
Supplier#000002243 |nSOEV3JeOU79 |
||||
Supplier#000002245 |hz2qWXWVjOyKhqPYMoEwz6zFkrTaDM |
||||
Supplier#000002282 |ES21K9dxoW1I1TzWCj7ekdlNwSWnv1Z 6mQ,BKn |
||||
Supplier#000002303 |nCoWfpB6YOymbgOht7ltfklpkHl |
||||
Supplier#000002331 |WRh2w5WFvRg7Z0S1AvSvHCL |
||||
Supplier#000002373 |RzHSxOTQmElCjxIBiVA52Z JB58rJhPRylR |
||||
Supplier#000002419 |qydBQd14I5l5mVXa4fYY |
||||
Supplier#000002571 |JZUugz04c iJFLrlGsz9O N,W 1rVHNIReyq |
||||
Supplier#000002585 |CsPoKpw2QuTY4AV1NkWuttneIa4SN |
||||
Supplier#000002629 |0Bw,q5Zp8su9XrzoCngZ3cAEXZwZ |
||||
Supplier#000002721 |HVdFAN2JHMQSpKm |
||||
Supplier#000002730 |lIFxR4fzm31C6,muzJwl84z |
||||
Supplier#000002775 |yDclaDaBD4ihH |
||||
Supplier#000002799 |lwr, 6L3gdfc79PQut,4XO6nQsTJY63cAyYO |
||||
Supplier#000002934 |m,trBENywSArwg3DhB |
||||
Supplier#000002941 |Naddba 8YTEKekZyP0 |
||||
Supplier#000003028 |jouzgX0WZjhNMWLaH4fy |
||||
Supplier#000003095 |HxON3jJhUi3zjt,r mTD |
||||
Supplier#000003143 |hdolgh608uTkHh7t6qfSqkifKaiFjnCH |
||||
Supplier#000003185 |hMa535Cbf2mj1Nw4OWOKWVrsK0VdDkJURrdjSIJe |
||||
Supplier#000003189 |DWdPxt7 RnkZv6VOByR0em |
||||
Supplier#000003201 |E87yws6I,t0qNs4QW7UzExKiJnJDZWue |
||||
Supplier#000003213 |pxrRP4irQ1VoyfQ,dTf3 |
||||
Supplier#000003275 |9xO4nyJ2QJcX6vGf |
||||
Supplier#000003288 |EDdfNt7E5Uc,xLTupoIgYL4yY7ujh, |
||||
Supplier#000003314 |jnisU8MzqO4iUB3zsPcrysMw3DDUojS4q7LD |
||||
Supplier#000003373 |iy8VM48ynpc3N2OsBwAvhYakO2us9R1bi |
||||
Supplier#000003421 |Sh3dt9W5oeofFWovnFhrg, |
||||
Supplier#000003422 |DJoCEapUeBXoV1iYiCcPFQvzsTv2ZI960 |
||||
Supplier#000003441 |zvFJIzS,oUuShHjpcX |
||||
Supplier#000003590 |sy79CMLxqb,Cbo |
||||
Supplier#000003607 |lNqFHQYjwSAkf |
||||
Supplier#000003625 |qY588W0Yk5iaUy1RXTgNrEKrMAjBYHcKs |
||||
Supplier#000003723 |jZEp0OEythCLcS OmJSrFtxJ66bMlzSp |
||||
Supplier#000003849 |KgbZEaRk,6Q3mWvwh6uptrs1KRUHg 0 |
||||
Supplier#000003894 |vvGC rameLOk |
||||
Supplier#000003941 |Pmb05mQfBMS618O7WKqZJ 9vyv |
||||
Supplier#000004059 |umEYZSq9RJ2WEzdsv9meU8rmqwzVLRgiZwC |
||||
Supplier#000004207 |tF64pwiOM4IkWjN3mS,e06WuAjLx |
||||
Supplier#000004236 |dl,HPtJmGipxYsSqn9wmqkuWjst,mCeJ8O6T |
||||
Supplier#000004278 |bBddbpBxIVp Di9 |
||||
Supplier#000004281 |1OwPHh Pgiyeus,iZS5eA23JDOipwk |
||||
Supplier#000004304 |hQCAz59k,HLlp2CKUrcBIL |
||||
Supplier#000004346 |S3076LEOwo |
||||
Supplier#000004406 |Ah0ZaLu6VwufPWUz,7kbXgYZhauEaHqGIg |
||||
Supplier#000004430 |yvSsKNSTL5HLXBET4luOsPNLxKzAMk |
||||
Supplier#000004527 |p pVXCnxgcklWF6A1o3OHY3qW6 |
||||
Supplier#000004655 |67NqBc4 t3PG3F8aO IsqWNq4kGaPowYL |
||||
Supplier#000004851 |Rj,x6IgLT7kBL99nqp |
||||
Supplier#000004871 |,phpt6AWEnUS8t4Avb50rFfdg7O9c6nU8xxv8eC5 |
||||
Supplier#000004884 |42Z1uLye9nsn6aTGBNd dI8 x |
||||
Supplier#000004975 |GPq5PMKY6Wy |
||||
Supplier#000005076 |Xl7h9ifgvIHmqxFLgWfHK4Gjav BkP |
||||
Supplier#000005195 |Woi3b2ZaicPh ZSfu1EfXhE |
||||
Supplier#000005256 |Onc3t57VAMchm,pmoVLaU8bONni9NsuaM PzMMFz |
||||
Supplier#000005257 |f9g8SEHB7obMj3QXAjXS2vfYY22 |
||||
Supplier#000005300 |gXG28YqpxU |
||||
Supplier#000005323 |tMCkdqbDoyNo8vMIkzjBqYexoRAuv,T6 qzcu |
||||
Supplier#000005386 |Ub6AAfHpWLWP |
||||
Supplier#000005426 |9Dz2OVT1q sb4BK71ljQ1XjPBYRPvO |
||||
Supplier#000005465 |63cYZenZBRZ613Q1FaoG0,smnC5zl9 |
||||
Supplier#000005484 |saFdOR qW7AFY,3asPqiiAa11Mo22pCoN0BtPrKo |
||||
Supplier#000005505 |d2sbjG43KwMPX |
||||
Supplier#000005506 |On f5ypzoWgB |
||||
Supplier#000005631 |14TVrjlzo2SJEBYCDgpMwTlvwSqC |
||||
Supplier#000005642 |ZwKxAv3V40tW E8P7Qwu,zlu,kPsL |
||||
Supplier#000005686 |f2RBKec2T1NIi7yS M |
||||
Supplier#000005730 |5rkb0PSews HvxkL8JaD41UpnSF2cg8H1 |
||||
Supplier#000005736 |2dq XTYhtYWSfp |
||||
Supplier#000005737 |dmEWcS32C3kx,d,B95 OmYn48 |
||||
Supplier#000005797 |,o,OebwRbSDmVl9gN9fpWPCiqB UogvlSR |
||||
Supplier#000005875 |lK,sYiGzB94hSyHy9xvSZFbVQNCZe2LXZuGbS |
||||
Supplier#000005974 |REhR5jE,lLusQXvf54SwYySgsSSVFhu |
||||
Supplier#000006059 |4m0cv8MwJ9yX2vlwI Z |
||||
Supplier#000006065 |UiI2Cy3W4Tu5sLk LuvXLRy6KihlGv |
||||
Supplier#000006093 |KJNUg1odUT2wtCS2s6PrH3D6fd |
||||
Supplier#000006099 |aZilwQKYDTVPoK |
||||
Supplier#000006109 |rY5gbfh3dKHnylcQUTPGCwnbe |
||||
Supplier#000006217 |RVN23SYT9jenUeaWGXUd |
||||
Supplier#000006297 |73VRDOO56GUCyvc40oYJ |
||||
Supplier#000006435 |xIgE69XszYbnO4Eon7cHHO8y |
||||
Supplier#000006463 |7 wkdj2EO49iotley2kmIM ADpLSszGV3RNWj |
||||
Supplier#000006478 |bQYPnj9lpmW3U |
||||
Supplier#000006521 |b9 2zjHzxR |
||||
Supplier#000006642 |N,CUclSqRLJcS8zQ |
||||
Supplier#000006659 |iTLsnvD8D2GzWNUv kRInwRjk5rDeEmfup1 |
||||
Supplier#000006669 |NQ4Yryj624p7K53 |
||||
Supplier#000006748 |rC,2rEn8gKDIS5Q0dJEoiF |
||||
Supplier#000006761 |n4jhxGMqB5prD1HhpLvwrWStOLlla |
||||
Supplier#000006808 |HGd2Xo 9nEcHJhZvXjXxWKIpApT |
||||
Supplier#000006858 |fnlINT885vBBhsWwTGiZ0o22thwGY16h GHJj21 |
||||
Supplier#000006946 |To6Slo0GJTqcIvD |
||||
Supplier#000006949 |mLxYUJhsGcLtKe ,GFirNu183AvT |
||||
Supplier#000007072 |2tRyX9M1a 4Rcm57s779F1ANG9jlpK |
||||
Supplier#000007098 |G3j8g0KC4OcbAu2OVoPHrXQWMCUdjq8wgCHOExu |
||||
Supplier#000007132 |xonvn0KAQIL3p8kYk HC1FSSDSUSTC |
||||
Supplier#000007135 |ls DoKV7V5ulfQy9V |
||||
Supplier#000007147 |Xzb16kC63wmLVYexUEgB0hXFvHkjT5iPpq |
||||
Supplier#000007160 |TqDGBULB3cTqIT6FKDvm9BS4e4v,zwYiQPb |
||||
Supplier#000007169 |tEc95D2moN9S84nd55O,dlnW |
||||
Supplier#000007278 |I2ae3rS7KVF8GVHtB |
||||
Supplier#000007365 |51xhROLvQMJ05DndtZWt |
||||
Supplier#000007398 |V8eE6oZ00OFNU, |
||||
Supplier#000007402 |4UVv58ery1rjmqSR5 |
||||
Supplier#000007448 |yhhpWiJi7EJ6Q5VCaQ |
||||
Supplier#000007458 |BYuucapYkptZl6fnd2QaDyZmI9gR1Ih16e |
||||
Supplier#000007477 |9m9j0wfhWzCvVHxkU,PpAxwSH0h |
||||
Supplier#000007509 |q8,V6LJRoHJjHcOuSG7aLTMg |
||||
Supplier#000007561 |rMcFg2530VC |
||||
Supplier#000007616 |R IovIqzDi3,QHnaqZk1xS4hGAgelhP4yj |
||||
Supplier#000007760 |JsPE18PvcdFTK |
||||
Supplier#000007801 |69fi,U1r6enUb |
||||
Supplier#000007865 |5cDGCS,T6N |
||||
Supplier#000007885 |u3sicchh5ZpyTUpN1cJKNcAoabIWgY |
||||
Supplier#000007926 |ErzCF80K9Uy |
||||
Supplier#000007998 |LnASFBfYRFOo9d6d,asBvVq9Lo2P |
||||
Supplier#000008090 |eonbJZvoDFYBNUinYfp6yERIg |
||||
Supplier#000008224 |TWxt9f,LVER |
||||
Supplier#000008231 |IK7eGw Yj90sTdpsP,vcqWxLB |
||||
Supplier#000008243 |2AyePMkDqmzVzjGTizXthFLo8h EiudCMxOmIIG |
||||
Supplier#000008323 |75I18sZmASwm POeheRMdj9tmpyeQ,BfCXN5BIAb |
||||
Supplier#000008366 |h778cEj14BuW9OEKlvPTWq4iwASR6EBBXN7zeS8 |
||||
Supplier#000008532 |Uc29q4,5xVdDOF87UZrxhr4xWS0ihEUXuh |
||||
Supplier#000008595 |MH0iB73GQ3z UW3O DbCbqmc |
||||
Supplier#000008610 |SgVgP90vP452sUNTgzL9zKwXHXAzV6tV |
||||
Supplier#000008683 |gLuGcugfpJSeGQARnaHNCaWnGaqsNnjyl20 |
||||
Supplier#000008705 |aE,trRNdPx,4yinTD9O3DebDIp |
||||
Supplier#000008742 |HmPlQEzKCPEcTUL14,kKq |
||||
Supplier#000008841 |I 85Lu1sekbg2xrSIzm0 |
||||
Supplier#000008872 |8D 45GgxJO2OwwYP9S4AaXJKvDwPfLM |
||||
Supplier#000008879 |rDSA,D9oPM,65NMWEFrmGKAu |
||||
Supplier#000008967 |2kwEHyMG 7FwozNImAUE6mH0hYtqYculJM |
||||
Supplier#000008972 |w2vF6 D5YZO3visPXsqVfLADTK |
||||
Supplier#000009032 |qK,trB6Sdy4Dz1BRUFNy |
||||
Supplier#000009043 |57OPvKH4qyXIZ7IzYeCaw11a5N1Ki9f1WWmVQ, |
||||
Supplier#000009278 |RqYTzgxj93CLX 0mcYfCENOefD |
||||
Supplier#000009326 |XmiC,uy36B9,fb0zhcjaagiXQutg |
||||
Supplier#000009430 |igRqmneFt |
||||
Supplier#000009549 |h3RVchUf8MzY46IzbZ0ng09 |
||||
Supplier#000009601 |51m637bO,Rw5DnHWFUvLacRx9 |
||||
Supplier#000009709 |rRnCbHYgDgl9PZYnyWKVYSUW0vKg |
||||
Supplier#000009753 |wLhVEcRmd7PkJF4FBnGK7Z |
||||
Supplier#000009799 | 4wNjXGa4OKWl |
||||
Supplier#000009811 |E3iuyq7UnZxU7oPZIe2Gu6 |
||||
Supplier#000009812 |APFRMy3lCbgFga53n5t9DxzFPQPgnjrGt32 |
||||
Supplier#000009846 |57sNwJJ3PtBDu,hMPP5QvpcOcSNRXn3PypJJrh |
||||
Supplier#000009899 |7XdpAHrzr1t,UQFZE |
||||
Supplier#000009974 |7wJ,J5DKcxSU4Kp1cQLpbcAvB5AsvKT |
@ -0,0 +1,101 @@ |
||||
s_name |numwait |
||||
Supplier#000002829 | 20 |
||||
Supplier#000005808 | 18 |
||||
Supplier#000000262 | 17 |
||||
Supplier#000000496 | 17 |
||||
Supplier#000002160 | 17 |
||||
Supplier#000002301 | 17 |
||||
Supplier#000002540 | 17 |
||||
Supplier#000003063 | 17 |
||||
Supplier#000005178 | 17 |
||||
Supplier#000008331 | 17 |
||||
Supplier#000002005 | 16 |
||||
Supplier#000002095 | 16 |
||||
Supplier#000005799 | 16 |
||||
Supplier#000005842 | 16 |
||||
Supplier#000006450 | 16 |
||||
Supplier#000006939 | 16 |
||||
Supplier#000009200 | 16 |
||||
Supplier#000009727 | 16 |
||||
Supplier#000000486 | 15 |
||||
Supplier#000000565 | 15 |
||||
Supplier#000001046 | 15 |
||||
Supplier#000001047 | 15 |
||||
Supplier#000001161 | 15 |
||||
Supplier#000001336 | 15 |
||||
Supplier#000001435 | 15 |
||||
Supplier#000003075 | 15 |
||||
Supplier#000003335 | 15 |
||||
Supplier#000005649 | 15 |
||||
Supplier#000006027 | 15 |
||||
Supplier#000006795 | 15 |
||||
Supplier#000006800 | 15 |
||||
Supplier#000006824 | 15 |
||||
Supplier#000007131 | 15 |
||||
Supplier#000007382 | 15 |
||||
Supplier#000008913 | 15 |
||||
Supplier#000009787 | 15 |
||||
Supplier#000000633 | 14 |
||||
Supplier#000001960 | 14 |
||||
Supplier#000002323 | 14 |
||||
Supplier#000002490 | 14 |
||||
Supplier#000002993 | 14 |
||||
Supplier#000003101 | 14 |
||||
Supplier#000004489 | 14 |
||||
Supplier#000005435 | 14 |
||||
Supplier#000005583 | 14 |
||||
Supplier#000005774 | 14 |
||||
Supplier#000007579 | 14 |
||||
Supplier#000008180 | 14 |
||||
Supplier#000008695 | 14 |
||||
Supplier#000009224 | 14 |
||||
Supplier#000000357 | 13 |
||||
Supplier#000000436 | 13 |
||||
Supplier#000000610 | 13 |
||||
Supplier#000000788 | 13 |
||||
Supplier#000000889 | 13 |
||||
Supplier#000001062 | 13 |
||||
Supplier#000001498 | 13 |
||||
Supplier#000002056 | 13 |
||||
Supplier#000002312 | 13 |
||||
Supplier#000002344 | 13 |
||||
Supplier#000002596 | 13 |
||||
Supplier#000002615 | 13 |
||||
Supplier#000002978 | 13 |
||||
Supplier#000003048 | 13 |
||||
Supplier#000003234 | 13 |
||||
Supplier#000003727 | 13 |
||||
Supplier#000003806 | 13 |
||||
Supplier#000004472 | 13 |
||||
Supplier#000005236 | 13 |
||||
Supplier#000005906 | 13 |
||||
Supplier#000006241 | 13 |
||||
Supplier#000006326 | 13 |
||||
Supplier#000006384 | 13 |
||||
Supplier#000006394 | 13 |
||||
Supplier#000006624 | 13 |
||||
Supplier#000006629 | 13 |
||||
Supplier#000006682 | 13 |
||||
Supplier#000006737 | 13 |
||||
Supplier#000006825 | 13 |
||||
Supplier#000007021 | 13 |
||||
Supplier#000007417 | 13 |
||||
Supplier#000007497 | 13 |
||||
Supplier#000007602 | 13 |
||||
Supplier#000008134 | 13 |
||||
Supplier#000008234 | 13 |
||||
Supplier#000009435 | 13 |
||||
Supplier#000009436 | 13 |
||||
Supplier#000009564 | 13 |
||||
Supplier#000009896 | 13 |
||||
Supplier#000000379 | 12 |
||||
Supplier#000000673 | 12 |
||||
Supplier#000000762 | 12 |
||||
Supplier#000000811 | 12 |
||||
Supplier#000000821 | 12 |
||||
Supplier#000001337 | 12 |
||||
Supplier#000001916 | 12 |
||||
Supplier#000001925 | 12 |
||||
Supplier#000002039 | 12 |
||||
Supplier#000002357 | 12 |
||||
Supplier#000002483 | 12 |
@ -0,0 +1,8 @@ |
||||
cntrycode |numcust |totacctbal |
||||
13 | 888|6737713.99 |
||||
17 | 861|6460573.72 |
||||
18 | 964|7236687.40 |
||||
23 | 892|6701457.95 |
||||
29 | 948|7158866.63 |
||||
30 | 909|6808436.13 |
||||
31 | 922|6806670.18 |
@ -0,0 +1,11 @@ |
||||
l_orderkey |revenue |o_orderdat|o_shippriority |
||||
2456423|406181.01|1995-03-05| 0 |
||||
3459808|405838.70|1995-03-04| 0 |
||||
492164|390324.06|1995-02-19| 0 |
||||
1188320|384537.94|1995-03-09| 0 |
||||
2435712|378673.06|1995-02-26| 0 |
||||
4878020|378376.80|1995-03-12| 0 |
||||
5521732|375153.92|1995-03-13| 0 |
||||
2628192|373133.31|1995-02-22| 0 |
||||
993600|371407.46|1995-03-05| 0 |
||||
2300070|367371.15|1995-03-13| 0 |
@ -0,0 +1,6 @@ |
||||
o_orderpriority|order_count |
||||
1-URGENT | 10594 |
||||
2-HIGH | 10476 |
||||
3-MEDIUM | 10410 |
||||
4-NOT SPECIFIED| 10556 |
||||
5-LOW | 10487 |
@ -0,0 +1,6 @@ |
||||
n_name |revenue |
||||
INDONESIA |55502041.17 |
||||
VIETNAM |55295087.00 |
||||
CHINA |53724494.26 |
||||
INDIA |52035512.00 |
||||
JAPAN |45410175.70 |
@ -0,0 +1,2 @@ |
||||
revenue |
||||
123141078.23 |
@ -0,0 +1,5 @@ |
||||
supp_nation |cust_nation |l_year |revenue |
||||
FRANCE |GERMANY | 1995|54639732.73 |
||||
FRANCE |GERMANY | 1996|54633083.31 |
||||
GERMANY |FRANCE | 1995|52531746.67 |
||||
GERMANY |FRANCE | 1996|52520549.02 |
@ -0,0 +1,3 @@ |
||||
o_year |mkt_share |
||||
1995|0.03 |
||||
1996|0.04 |
@ -0,0 +1,176 @@ |
||||
nation |o_year |sum_profit |
||||
ALGERIA | 1998|27136900.18 |
||||
ALGERIA | 1997|48611833.50 |
||||
ALGERIA | 1996|48285482.68 |
||||
ALGERIA | 1995|44402273.60 |
||||
ALGERIA | 1994|48694008.07 |
||||
ALGERIA | 1993|46044207.78 |
||||
ALGERIA | 1992|45636849.49 |
||||
ARGENTINA | 1998|28341663.78 |
||||
ARGENTINA | 1997|47143964.12 |
||||
ARGENTINA | 1996|45255278.60 |
||||
ARGENTINA | 1995|45631769.21 |
||||
ARGENTINA | 1994|48268856.35 |
||||
ARGENTINA | 1993|48605593.62 |
||||
ARGENTINA | 1992|46654240.75 |
||||
BRAZIL | 1998|26527736.40 |
||||
BRAZIL | 1997|45640660.77 |
||||
BRAZIL | 1996|45090647.16 |
||||
BRAZIL | 1995|44015888.51 |
||||
BRAZIL | 1994|44854218.89 |
||||
BRAZIL | 1993|45766603.74 |
||||
BRAZIL | 1992|45280216.80 |
||||
CANADA | 1998|26828985.39 |
||||
CANADA | 1997|44849954.32 |
||||
CANADA | 1996|46307936.11 |
||||
CANADA | 1995|47311993.04 |
||||
CANADA | 1994|46691491.96 |
||||
CANADA | 1993|46634791.11 |
||||
CANADA | 1992|45873849.69 |
||||
CHINA | 1998|27510180.17 |
||||
CHINA | 1997|46123865.41 |
||||
CHINA | 1996|49532807.06 |
||||
CHINA | 1995|46734651.48 |
||||
CHINA | 1994|46397896.61 |
||||
CHINA | 1993|49634673.95 |
||||
CHINA | 1992|46949457.64 |
||||
EGYPT | 1998|28401491.80 |
||||
EGYPT | 1997|47674857.68 |
||||
EGYPT | 1996|47745727.55 |
||||
EGYPT | 1995|45897160.68 |
||||
EGYPT | 1994|47194895.23 |
||||
EGYPT | 1993|49133627.65 |
||||
EGYPT | 1992|47000574.50 |
||||
ETHIOPIA | 1998|25135046.14 |
||||
ETHIOPIA | 1997|43010596.08 |
||||
ETHIOPIA | 1996|43636287.19 |
||||
ETHIOPIA | 1995|43575757.33 |
||||
ETHIOPIA | 1994|41597208.53 |
||||
ETHIOPIA | 1993|42622804.16 |
||||
ETHIOPIA | 1992|44385735.68 |
||||
FRANCE | 1998|26210392.28 |
||||
FRANCE | 1997|42392969.47 |
||||
FRANCE | 1996|43306317.97 |
||||
FRANCE | 1995|46377408.43 |
||||
FRANCE | 1994|43447352.99 |
||||
FRANCE | 1993|43729961.06 |
||||
FRANCE | 1992|44052308.43 |
||||
GERMANY | 1998|25991257.11 |
||||
GERMANY | 1997|43968355.81 |
||||
GERMANY | 1996|45882074.80 |
||||
GERMANY | 1995|43314338.31 |
||||
GERMANY | 1994|44616995.44 |
||||
GERMANY | 1993|45126645.91 |
||||
GERMANY | 1992|44361141.21 |
||||
INDIA | 1998|29626417.24 |
||||
INDIA | 1997|51386111.34 |
||||
INDIA | 1996|47571018.51 |
||||
INDIA | 1995|49344062.28 |
||||
INDIA | 1994|50106952.43 |
||||
INDIA | 1993|48112766.70 |
||||
INDIA | 1992|47914303.12 |
||||
INDONESIA | 1998|27734909.68 |
||||
INDONESIA | 1997|44593812.99 |
||||
INDONESIA | 1996|44746729.81 |
||||
INDONESIA | 1995|45593622.70 |
||||
INDONESIA | 1994|45988483.88 |
||||
INDONESIA | 1993|46147963.79 |
||||
INDONESIA | 1992|45185777.07 |
||||
IRAN | 1998|26661608.93 |
||||
IRAN | 1997|45019114.17 |
||||
IRAN | 1996|45891397.10 |
||||
IRAN | 1995|44414285.23 |
||||
IRAN | 1994|43696360.48 |
||||
IRAN | 1993|45362775.81 |
||||
IRAN | 1992|43052338.41 |
||||
IRAQ | 1998|31188498.19 |
||||
IRAQ | 1997|48585307.52 |
||||
IRAQ | 1996|50036593.84 |
||||
IRAQ | 1995|48774801.73 |
||||
IRAQ | 1994|48795847.23 |
||||
IRAQ | 1993|47435691.51 |
||||
IRAQ | 1992|47562355.66 |
||||
JAPAN | 1998|24694102.17 |
||||
JAPAN | 1997|42377052.35 |
||||
JAPAN | 1996|40267778.91 |
||||
JAPAN | 1995|40925317.47 |
||||
JAPAN | 1994|41159518.31 |
||||
JAPAN | 1993|39589074.28 |
||||
JAPAN | 1992|39113493.91 |
||||
JORDAN | 1998|23489867.79 |
||||
JORDAN | 1997|41615962.66 |
||||
JORDAN | 1996|41860855.47 |
||||
JORDAN | 1995|39931672.09 |
||||
JORDAN | 1994|40707555.46 |
||||
JORDAN | 1993|39060405.47 |
||||
JORDAN | 1992|41657604.27 |
||||
KENYA | 1998|25566337.43 |
||||
KENYA | 1997|43108847.90 |
||||
KENYA | 1996|43482953.54 |
||||
KENYA | 1995|42517988.98 |
||||
KENYA | 1994|43612479.45 |
||||
KENYA | 1993|42724038.76 |
||||
KENYA | 1992|43217106.21 |
||||
MOROCCO | 1998|24915496.88 |
||||
MOROCCO | 1997|42698382.85 |
||||
MOROCCO | 1996|42986113.50 |
||||
MOROCCO | 1995|42316089.16 |
||||
MOROCCO | 1994|43458604.60 |
||||
MOROCCO | 1993|42672288.07 |
||||
MOROCCO | 1992|42800781.64 |
||||
MOZAMBIQUE | 1998|28279876.03 |
||||
MOZAMBIQUE | 1997|51159216.23 |
||||
MOZAMBIQUE | 1996|48072525.06 |
||||
MOZAMBIQUE | 1995|48905200.60 |
||||
MOZAMBIQUE | 1994|46092076.28 |
||||
MOZAMBIQUE | 1993|48555926.27 |
||||
MOZAMBIQUE | 1992|47809075.12 |
||||
PERU | 1998|26713966.27 |
||||
PERU | 1997|48324008.60 |
||||
PERU | 1996|50310008.86 |
||||
PERU | 1995|49647080.96 |
||||
PERU | 1994|46420910.28 |
||||
PERU | 1993|51536906.25 |
||||
PERU | 1992|47711665.31 |
||||
ROMANIA | 1998|27271993.10 |
||||
ROMANIA | 1997|45063059.20 |
||||
ROMANIA | 1996|47492335.03 |
||||
ROMANIA | 1995|45710636.29 |
||||
ROMANIA | 1994|46088041.11 |
||||
ROMANIA | 1993|47515092.56 |
||||
ROMANIA | 1992|44111439.80 |
||||
RUSSIA | 1998|27935323.73 |
||||
RUSSIA | 1997|48222347.29 |
||||
RUSSIA | 1996|47553559.49 |
||||
RUSSIA | 1995|46755990.10 |
||||
RUSSIA | 1994|48000515.62 |
||||
RUSSIA | 1993|48569624.51 |
||||
RUSSIA | 1992|47672831.53 |
||||
SAUDI ARABIA | 1998|27113516.84 |
||||
SAUDI ARABIA | 1997|46690468.96 |
||||
SAUDI ARABIA | 1996|47775782.67 |
||||
SAUDI ARABIA | 1995|46657107.83 |
||||
SAUDI ARABIA | 1994|48181672.81 |
||||
SAUDI ARABIA | 1993|45692556.44 |
||||
SAUDI ARABIA | 1992|48924913.27 |
||||
UNITED KINGDOM | 1998|26366682.88 |
||||
UNITED KINGDOM | 1997|44518130.19 |
||||
UNITED KINGDOM | 1996|45539729.62 |
||||
UNITED KINGDOM | 1995|46845879.34 |
||||
UNITED KINGDOM | 1994|43081609.57 |
||||
UNITED KINGDOM | 1993|44770146.76 |
||||
UNITED KINGDOM | 1992|44123402.55 |
||||
UNITED STATES | 1998|27826593.68 |
||||
UNITED STATES | 1997|46638572.36 |
||||
UNITED STATES | 1996|46688280.55 |
||||
UNITED STATES | 1995|48951591.62 |
||||
UNITED STATES | 1994|45099092.06 |
||||
UNITED STATES | 1993|46181600.53 |
||||
UNITED STATES | 1992|46168214.09 |
||||
VIETNAM | 1998|27281931.00 |
||||
VIETNAM | 1997|48735914.18 |
||||
VIETNAM | 1996|47824595.90 |
||||
VIETNAM | 1995|48235135.80 |
||||
VIETNAM | 1994|47729256.33 |
||||
VIETNAM | 1993|45352676.87 |
||||
VIETNAM | 1992|47846355.65 |
@ -0,0 +1,256 @@ |
||||
/*
|
||||
* $Id: bcd2.c,v 1.2 2005/01/03 20:08:58 jms Exp $ |
||||
* |
||||
* Revision History |
||||
* =================== |
||||
* $Log: bcd2.c,v $ |
||||
* Revision 1.2 2005/01/03 20:08:58 jms |
||||
* change line terminations |
||||
* |
||||
* Revision 1.1.1.1 2004/11/24 23:31:45 jms |
||||
* re-establish external server |
||||
* |
||||
* Revision 1.1.1.1 2003/04/03 18:54:21 jms |
||||
* recreation after CVS crash |
||||
* |
||||
* Revision 1.1.1.1 2003/04/03 18:54:21 jms |
||||
* initial checkin |
||||
* |
||||
* |
||||
*/ |
||||
/*
|
||||
* bcd.c: conversion routines for multi-byte arithmetic |
||||
* |
||||
* defined routines: |
||||
* bin_bcd2(long binary, long *low_res, long *high_res) |
||||
* bcd2_bin(long *dest, long bcd) |
||||
* bcd2_add(long *bcd_low, long *bcd_high, long addend) |
||||
* bcd2_sub(long *bcd_low, long *bcd_high, long subend) |
||||
* bcd2_mul(long *bcd_low, long *bcd_high, long multiplier) |
||||
* bcd2_div(long *bcd_low, long *bcd_high, long divisor) |
||||
* long bcd2_mod(long *bcd_low, long *bcd_high, long modulo) |
||||
* long bcd2_cmp(long *bcd_low, long *bcd_high, long compare) |
||||
*/ |
||||
#include <stdio.h> |
||||
#include "bcd2.h" /* for function prototypes */ |
||||
|
||||
#define DIGITS_PER_LONG 7 |
||||
#define WORD_DIVISOR 10000000 |
||||
#define GET_DIGIT(num, low, high) \ |
||||
((num) >= DIGITS_PER_LONG)? \
|
||||
(high & (0xF << (4 * ((num) - DIGITS_PER_LONG)))) \
|
||||
>> (((num) - DIGITS_PER_LONG) * 4): \
|
||||
(low & (0xF << (4 * (num)))) >> ((num) * 4) |
||||
#define SET_DIGIT(value, num, low, high) \ |
||||
if ((num) >= DIGITS_PER_LONG) \
|
||||
{ \
|
||||
*high &= \
|
||||
(0xFFFFFFF ^ (0xF << (4 * ((num) - DIGITS_PER_LONG)))); \
|
||||
*high |= (value << (4 * ((num) - DIGITS_PER_LONG))); \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
*low = (*low & (0xFFFFFFF ^ (0xF << (4 * (num))))); \
|
||||
*low |= (value << (4 * (num))); \
|
||||
} |
||||
int
|
||||
bin_bcd2(long binary, long *low_res, long *high_res) |
||||
{ |
||||
char number[15], |
||||
*current; |
||||
int count;
|
||||
long *dest; |
||||
|
||||
*low_res = *high_res = 0; |
||||
sprintf(number, "%014ld", binary); |
||||
for (current = number, count=13; *current; current++, count--) |
||||
{ |
||||
dest = (count < DIGITS_PER_LONG)?low_res:high_res; |
||||
*dest = *dest << 4; |
||||
*dest |= *current - '0'; |
||||
} |
||||
return(0); |
||||
} |
||||
|
||||
int |
||||
bcd2_bin(long *dest, long bcd) |
||||
{ |
||||
int count; |
||||
long mask; |
||||
|
||||
count = DIGITS_PER_LONG - 1; |
||||
mask = 0xF000000; |
||||
*dest = 0; |
||||
while (mask) |
||||
{ |
||||
*dest *= 10; |
||||
*dest += (bcd & mask) >> (4 * count); |
||||
mask = mask >> 4; |
||||
count -= 1; |
||||
} |
||||
return(0); |
||||
} |
||||
|
||||
int |
||||
bcd2_add(long *bcd_low, long *bcd_high, long addend) |
||||
{ |
||||
long tmp_lo, tmp_hi, carry, res; |
||||
int digit; |
||||
|
||||
bin_bcd2(addend, &tmp_lo, &tmp_hi); |
||||
carry = 0; |
||||
for (digit=0; digit < 14; digit++) |
||||
{ |
||||
res = GET_DIGIT(digit, *bcd_low, *bcd_high);
|
||||
res += GET_DIGIT(digit, tmp_lo, tmp_hi); |
||||
res += carry; |
||||
carry = res / 10; |
||||
res %= 10; |
||||
SET_DIGIT(res, digit, bcd_low, bcd_high); |
||||
} |
||||
return(carry); |
||||
} |
||||
|
||||
int |
||||
bcd2_sub(long *bcd_low, long *bcd_high, long subend) |
||||
{ |
||||
long tmp_lo, tmp_hi, carry, res; |
||||
int digit; |
||||
|
||||
bin_bcd2(subend, &tmp_lo, &tmp_hi); |
||||
carry = 0; |
||||
for (digit=0; digit < 14; digit++) |
||||
{ |
||||
res = GET_DIGIT(digit, *bcd_low, *bcd_high);
|
||||
res -= GET_DIGIT(digit, tmp_lo, tmp_hi); |
||||
res -= carry; |
||||
if (res < 0)
|
||||
{ |
||||
res += 10; |
||||
carry = 1; |
||||
} |
||||
SET_DIGIT(res, digit, bcd_low, bcd_high); |
||||
} |
||||
return(carry); |
||||
} |
||||
|
||||
int |
||||
bcd2_mul(long *bcd_low, long *bcd_high, long multiplier) |
||||
{ |
||||
long tmp_lo, tmp_hi, carry, m_lo, m_hi, m1, m2; |
||||
int udigit, ldigit, res; |
||||
|
||||
tmp_lo = *bcd_low; |
||||
tmp_hi = *bcd_high; |
||||
bin_bcd2(multiplier, &m_lo, &m_hi); |
||||
*bcd_low = 0; |
||||
*bcd_high = 0; |
||||
carry = 0; |
||||
for (ldigit=0; ldigit < 14; ldigit++) |
||||
{ |
||||
m1 = GET_DIGIT(ldigit, m_lo, m_hi);
|
||||
carry = 0; |
||||
for (udigit=0; udigit < 14; udigit++) |
||||
{ |
||||
m2 = GET_DIGIT(udigit, tmp_lo, tmp_hi); |
||||
res = m1 * m2; |
||||
res += carry; |
||||
if (udigit + ldigit < 14) |
||||
{ |
||||
carry = GET_DIGIT(udigit + ldigit, *bcd_low, *bcd_high); |
||||
res += carry; |
||||
} |
||||
carry = res / 10; |
||||
res %= 10; |
||||
if (udigit + ldigit < 14) |
||||
SET_DIGIT(res, udigit + ldigit, bcd_low, bcd_high); |
||||
} |
||||
} |
||||
return(carry); |
||||
} |
||||
|
||||
int |
||||
bcd2_div(long *bcd_low, long *bcd_high, long divisor) |
||||
{ |
||||
long tmp_lo, tmp_hi, carry, d1, res, digit; |
||||
|
||||
|
||||
carry = 0; |
||||
tmp_lo = *bcd_low; |
||||
tmp_hi = *bcd_high; |
||||
*bcd_low = *bcd_high = 0; |
||||
for (digit=13; digit >= 0; digit--) |
||||
{ |
||||
d1 = GET_DIGIT(digit, tmp_lo, tmp_hi); |
||||
d1 += 10 * carry;
|
||||
res = d1 / divisor; |
||||
carry = d1 % divisor; |
||||
SET_DIGIT(res, digit, bcd_low, bcd_high); |
||||
} |
||||
return(carry); |
||||
} |
||||
|
||||
long |
||||
bcd2_mod(long *bcd_low, long *bcd_high, long modulo) |
||||
{ |
||||
long tmp_low, tmp_high; |
||||
|
||||
tmp_low = *bcd_low; |
||||
tmp_high = *bcd_high; |
||||
while (tmp_high || tmp_low > modulo) |
||||
bcd2_sub(&tmp_low, &tmp_high, modulo); |
||||
return(tmp_low); |
||||
} |
||||
|
||||
long |
||||
bcd2_cmp(long *low1, long *high1, long comp) |
||||
{ |
||||
long temp = 0; |
||||
|
||||
bcd2_bin(&temp, *high1); |
||||
if (temp > 214)
|
||||
return(1); |
||||
bcd2_bin(&temp, *low1); |
||||
return(temp - comp); |
||||
} |
||||
|
||||
#ifdef TEST_BCD |
||||
#include <values.h> |
||||
|
||||
main() |
||||
{ |
||||
long bin, low_bcd, high_bcd; |
||||
int i; |
||||
|
||||
bin = MAXINT; |
||||
printf("%ld\n", bin); |
||||
bin_bcd2(bin, &low_bcd, &high_bcd); |
||||
printf("%ld %ld\n", high_bcd, low_bcd); |
||||
bin = 0; |
||||
bcd2_bin(&bin, high_bcd); |
||||
bcd2_bin(&bin, low_bcd); |
||||
printf( "%ld\n", bin); |
||||
for (i=9; i >= 0; i--) |
||||
printf("%dth digit in %d is %d\n",
|
||||
i, bin, GET_DIGIT(i, low_bcd, high_bcd)); |
||||
bcd2_add(&low_bcd, &high_bcd, MAXINT); |
||||
bin = 0; |
||||
bcd2_bin(&bin, high_bcd); |
||||
high_bcd = bin; |
||||
bin = 0; |
||||
bcd2_bin(&bin, low_bcd); |
||||
low_bcd = bin; |
||||
printf( "%ld%07ld\n", high_bcd, low_bcd); |
||||
bin_bcd2(14, &low_bcd, &high_bcd); |
||||
bcd2_mul(&low_bcd, &high_bcd, 23L); |
||||
bin = 0; |
||||
bcd2_bin(&bin, high_bcd); |
||||
bcd2_bin(&bin, low_bcd); |
||||
printf( "%ld\n", bin); |
||||
bcd2_div(&low_bcd, &high_bcd, 10L); |
||||
bin = 0; |
||||
bcd2_bin(&bin, high_bcd); |
||||
bcd2_bin(&bin, low_bcd); |
||||
printf( "%ld\n", bin); |
||||
} |
||||
#endif /* TEST */ |
@ -0,0 +1,28 @@ |
||||
/*
|
||||
* $Id: bcd2.h,v 1.2 2005/01/03 20:08:58 jms Exp $ |
||||
* |
||||
* Revision History |
||||
* =================== |
||||
* $Log: bcd2.h,v $ |
||||
* Revision 1.2 2005/01/03 20:08:58 jms |
||||
* change line terminations |
||||
* |
||||
* Revision 1.1.1.1 2004/11/24 23:31:45 jms |
||||
* re-establish external server |
||||
* |
||||
* Revision 1.1.1.1 2003/04/03 18:54:21 jms |
||||
* recreation after CVS crash |
||||
* |
||||
* Revision 1.1.1.1 2003/04/03 18:54:21 jms |
||||
* initial checkin |
||||
* |
||||
* |
||||
*/ |
||||
int bin_bcd2(long binary, long *low_res, long *high_res); |
||||
int bcd2_bin(long *dest, long bcd); |
||||
int bcd2_add(long *bcd_low, long *bcd_high, long addend); |
||||
int bcd2_sub(long *bcd_low, long *bcd_high, long subend); |
||||
int bcd2_mul(long *bcd_low, long *bcd_high, long multiplier); |
||||
int bcd2_div(long *bcd_low, long *bcd_high, long divisor); |
||||
long bcd2_mod(long *bcd_low, long *bcd_high, long modulo); |
||||
long bcd2_cmp(long *bcd_low, long *bcd_high, long compare); |
Binary file not shown.
@ -0,0 +1,588 @@ |
||||
/*
|
||||
* $Id: bm_utils.c,v 1.4 2006/04/12 18:00:55 jms Exp $ |
||||
* |
||||
* Revision History |
||||
* =================== |
||||
* $Log: bm_utils.c,v $ |
||||
* Revision 1.4 2006/04/12 18:00:55 jms |
||||
* add missing parameter to call to gen_seed |
||||
* |
||||
* Revision 1.3 2005/10/14 23:16:54 jms |
||||
* fix for answer set compliance |
||||
* |
||||
* Revision 1.2 2005/01/03 20:08:58 jms |
||||
* change line terminations |
||||
* |
||||
* Revision 1.1.1.1 2004/11/24 23:31:46 jms |
||||
* re-establish external server |
||||
* |
||||
* Revision 1.3 2004/02/18 14:05:53 jms |
||||
* porting changes for LINUX and 64 bit RNG |
||||
* |
||||
* Revision 1.2 2004/01/22 05:49:29 jms |
||||
* AIX porting (AIX 5.1) |
||||
* |
||||
* Revision 1.1.1.1 2003/08/08 21:35:26 jms |
||||
* recreation after CVS crash |
||||
* |
||||
* Revision 1.3 2003/08/08 21:35:26 jms |
||||
* first integration of rng64 for o_custkey and l_partkey |
||||
* |
||||
* Revision 1.2 2003/08/07 17:58:34 jms |
||||
* Convery RNG to 64bit space as preparation for new large scale RNG |
||||
* |
||||
* Revision 1.1.1.1 2003/04/03 18:54:21 jms |
||||
* initial checkin |
||||
* |
||||
* |
||||
*/ |
||||
/*
|
||||
* |
||||
* Various routines that handle distributions, value selections and |
||||
* seed value management for the DSS benchmark. Current functions: |
||||
* env_config -- set config vars with optional environment override |
||||
* yes_no -- ask simple yes/no question and return boolean result |
||||
* a_rnd(min, max) -- random alphanumeric within length range |
||||
* pick_str(size, set) -- select a string from the set of size |
||||
* read_dist(file, name, distribution *) -- read named dist from file |
||||
* tbl_open(path, mode) -- std fopen with lifenoise |
||||
* julian(date) -- julian date correction |
||||
* rowcnt(tbl) -- proper scaling of given table |
||||
* e_str(set, min, max) -- build an embedded str |
||||
* agg_str() -- build a string from the named set |
||||
* dsscasecmp() -- version of strcasecmp() |
||||
* dssncasecmp() -- version of strncasecmp() |
||||
* getopt() |
||||
* set_state() -- initialize the RNG |
||||
*/ |
||||
|
||||
#include "config.h" |
||||
#include "dss.h" |
||||
#include <stdio.h> |
||||
#include <time.h> |
||||
#include <errno.h> |
||||
#include <string.h> |
||||
#ifdef HP |
||||
#include <strings.h> |
||||
#endif /* HP */ |
||||
#include <ctype.h> |
||||
#include <math.h> |
||||
#ifndef _POSIX_SOURCE |
||||
#include <malloc.h> |
||||
#endif /* POSIX_SOURCE */ |
||||
#include <fcntl.h> |
||||
#include <sys/types.h> |
||||
#include <sys/stat.h> |
||||
/* Lines added by Chuck McDevitt for WIN32 support */ |
||||
#ifdef WIN32 |
||||
#ifndef _POSIX_ |
||||
#include <io.h> |
||||
#ifndef S_ISREG |
||||
#define S_ISREG(m) ( ((m) & _S_IFMT) == _S_IFREG ) |
||||
#define S_ISFIFO(m) ( ((m) & _S_IFMT) == _S_IFIFO ) |
||||
#endif |
||||
#endif |
||||
#ifndef stat |
||||
#define stat _stat |
||||
#endif |
||||
#ifndef fdopen |
||||
#define fdopen _fdopen |
||||
#endif |
||||
#ifndef open |
||||
#define open _open |
||||
#endif |
||||
#ifndef O_RDONLY |
||||
#define O_RDONLY _O_RDONLY |
||||
#endif |
||||
#ifndef O_WRONLY |
||||
#define O_WRONLY _O_WRONLY |
||||
#endif |
||||
#ifndef O_CREAT |
||||
#define O_CREAT _O_CREAT |
||||
#endif |
||||
#endif |
||||
/* End of lines added by Chuck McDevitt for WIN32 support */ |
||||
#include "dsstypes.h" |
||||
|
||||
|
||||
static char alpha_num[65] = |
||||
"0123456789abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ,"; |
||||
|
||||
#if defined(__STDC__) || defined(__cplusplus) |
||||
#define PROTO(s) s |
||||
#else |
||||
#define PROTO(s) () |
||||
#endif |
||||
|
||||
#ifndef WIN32 |
||||
char *getenv PROTO((const char *name)); |
||||
#endif |
||||
void usage(); |
||||
long *permute_dist(distribution *d, long stream); |
||||
extern seed_t Seed[]; |
||||
|
||||
/*
|
||||
* env_config: look for a environmental variable setting and return its |
||||
* value; otherwise return the default supplied |
||||
*/ |
||||
char * |
||||
env_config(char *var, char *dflt) |
||||
{ |
||||
static char *evar; |
||||
|
||||
if ((evar = getenv(var)) != NULL) |
||||
return (evar); |
||||
else |
||||
return (dflt); |
||||
} |
||||
|
||||
/*
|
||||
* return the answer to a yes/no question as a boolean |
||||
*/ |
||||
long |
||||
yes_no(char *prompt) |
||||
{ |
||||
char reply[128]; |
||||
|
||||
#ifdef WIN32 |
||||
/* Disable warning about conditional expression is constant */
|
||||
#pragma warning(disable:4127) |
||||
#endif |
||||
|
||||
while (1) |
||||
{ |
||||
#ifdef WIN32 |
||||
#pragma warning(default:4127) |
||||
#endif |
||||
printf("%s [Y/N]: ", prompt); |
||||
fgets(reply, 128, stdin); |
||||
switch (*reply) |
||||
{ |
||||
case 'y': |
||||
case 'Y': |
||||
return (1); |
||||
case 'n': |
||||
case 'N': |
||||
return (0); |
||||
default: |
||||
printf("Please answer 'yes' or 'no'.\n"); |
||||
} |
||||
} |
||||
} |
||||
|
||||
/*
|
||||
* generate a random string with length randomly selected in [min, max] |
||||
* and using the characters in alphanum (currently includes a space |
||||
* and comma) |
||||
*/ |
||||
void |
||||
a_rnd(int min, int max, int column, char *dest) |
||||
{ |
||||
DSS_HUGE i, |
||||
len, |
||||
char_int; |
||||
|
||||
RANDOM(len, min, max, column); |
||||
for (i = 0; i < len; i++) |
||||
{ |
||||
if (i % 5 == 0) |
||||
RANDOM(char_int, 0, MAX_LONG, column); |
||||
*(dest + i) = alpha_num[char_int & 077]; |
||||
char_int >>= 6; |
||||
} |
||||
*(dest + len) = '\0'; |
||||
return; |
||||
} |
||||
|
||||
/*
|
||||
* embed a randomly selected member of distribution d in alpha-numeric |
||||
* noise of a length rendomly selected between min and max at a random |
||||
* position |
||||
*/ |
||||
void |
||||
e_str(distribution *d, int min, int max, int stream, char *dest) |
||||
{ |
||||
char strtmp[MAXAGG_LEN + 1]; |
||||
DSS_HUGE loc; |
||||
int len; |
||||
|
||||
a_rnd(min, max, stream, dest); |
||||
pick_str(d, stream, strtmp); |
||||
len = (int)strlen(strtmp); |
||||
RANDOM(loc, 0, ((int)strlen(dest) - 1 - len), stream); |
||||
strncpy(dest + loc, strtmp, len); |
||||
|
||||
return; |
||||
} |
||||
|
||||
|
||||
/*
|
||||
* return the string associate with the LSB of a uniformly selected |
||||
* long in [1, max] where max is determined by the distribution |
||||
* being queried |
||||
*/ |
||||
int |
||||
pick_str(distribution *s, int c, char *target) |
||||
{ |
||||
long i = 0; |
||||
DSS_HUGE j; |
||||
|
||||
RANDOM(j, 1, s->list[s->count - 1].weight, c); |
||||
while (s->list[i].weight < j) |
||||
i++; |
||||
strcpy(target, s->list[i].text); |
||||
return(i); |
||||
} |
||||
|
||||
/*
|
||||
* unjulian (long date) -- return(date - STARTDATE) |
||||
*/ |
||||
long |
||||
unjulian(long date) |
||||
{ |
||||
int i; |
||||
long res = 0; |
||||
|
||||
for (i = STARTDATE / 1000; i < date / 1000; i++) |
||||
res += 365 + LEAP(i); |
||||
res += date % 1000 - 1; |
||||
|
||||
return(res); |
||||
} |
||||
|
||||
long |
||||
julian(long date) |
||||
{ |
||||
long offset; |
||||
long result; |
||||
long yr; |
||||
long yend; |
||||
|
||||
offset = date - STARTDATE; |
||||
result = STARTDATE; |
||||
|
||||
#ifdef WIN32 |
||||
/* Disable warning about conditional expression is constant */
|
||||
#pragma warning(disable:4127) |
||||
#endif |
||||
|
||||
while (1) |
||||
{ |
||||
#ifdef WIN32 |
||||
#pragma warning(default:4127) |
||||
#endif |
||||
yr = result / 1000; |
||||
yend = yr * 1000 + 365 + LEAP(yr); |
||||
if (result + offset > yend) /* overflow into next year */ |
||||
{ |
||||
offset -= yend - result + 1; |
||||
result += 1000; |
||||
continue; |
||||
} |
||||
else |
||||
break; |
||||
} |
||||
return (result + offset); |
||||
} |
||||
|
||||
/*
|
||||
* load a distribution from a flat file into the target structure; |
||||
* should be rewritten to allow multiple dists in a file |
||||
*/ |
||||
void |
||||
read_dist(char *path, char *name, distribution *target) |
||||
{ |
||||
FILE *fp; |
||||
char line[256], |
||||
token[256], |
||||
*c; |
||||
long weight, |
||||
count = 0, |
||||
name_set = 0; |
||||
|
||||
if (d_path == NULL) |
||||
{ |
||||
sprintf(line, "%s%c%s",
|
||||
env_config(CONFIG_TAG, CONFIG_DFLT), PATH_SEP, path); |
||||
fp = fopen(line, "r"); |
||||
OPEN_CHECK(fp, line); |
||||
} |
||||
else |
||||
{ |
||||
fp = fopen(d_path, "r"); |
||||
OPEN_CHECK(fp, d_path); |
||||
} |
||||
while (fgets(line, sizeof(line), fp) != NULL) |
||||
{ |
||||
if ((c = strchr(line, '\n')) != NULL) |
||||
*c = '\0'; |
||||
if ((c = strchr(line, '#')) != NULL) |
||||
*c = '\0'; |
||||
if (*line == '\0') |
||||
continue; |
||||
|
||||
if (!name_set) |
||||
{ |
||||
if (dsscasecmp(strtok(line, "\n\t "), "BEGIN")) |
||||
continue; |
||||
if (dsscasecmp(strtok(NULL, "\n\t "), name)) |
||||
continue; |
||||
name_set = 1; |
||||
continue; |
||||
} |
||||
else |
||||
{ |
||||
if (!dssncasecmp(line, "END", 3)) |
||||
{ |
||||
fclose(fp); |
||||
return; |
||||
} |
||||
} |
||||
|
||||
if (sscanf(line, "%[^|]|%ld", token, &weight) != 2) |
||||
continue; |
||||
|
||||
if (!dsscasecmp(token, "count")) |
||||
{ |
||||
target->count = weight; |
||||
target->list = |
||||
(set_member *) |
||||
malloc((size_t)(weight * sizeof(set_member))); |
||||
MALLOC_CHECK(target->list); |
||||
target->max = 0; |
||||
continue; |
||||
} |
||||
target->list[count].text = |
||||
(char *) malloc((size_t)((int)strlen(token) + 1)); |
||||
MALLOC_CHECK(target->list[count].text); |
||||
strcpy(target->list[count].text, token); |
||||
target->max += weight; |
||||
target->list[count].weight = target->max; |
||||
|
||||
count += 1; |
||||
} /* while fgets() */ |
||||
|
||||
if (count != target->count) |
||||
{ |
||||
fprintf(stderr, "Read error on dist '%s'\n", name); |
||||
fclose(fp); |
||||
exit(1); |
||||
} |
||||
target->permute = (long *)NULL; |
||||
fclose(fp); |
||||
return; |
||||
} |
||||
|
||||
/*
|
||||
* standard file open with life noise |
||||
*/ |
||||
|
||||
FILE * |
||||
tbl_open(int tbl, char *mode) |
||||
{ |
||||
char prompt[256]; |
||||
char fullpath[256]; |
||||
FILE *f; |
||||
struct stat fstats; |
||||
int retcode; |
||||
|
||||
|
||||
if (*tdefs[tbl].name == PATH_SEP) |
||||
strcpy(fullpath, tdefs[tbl].name); |
||||
else |
||||
sprintf(fullpath, "%s%c%s", |
||||
env_config(PATH_TAG, PATH_DFLT), PATH_SEP, tdefs[tbl].name); |
||||
|
||||
retcode = stat(fullpath, &fstats); |
||||
if (retcode) { |
||||
if (errno != ENOENT) { |
||||
fprintf(stderr, "stat(%s) failed.\n", fullpath); |
||||
exit(-1); |
||||
} else |
||||
f = fopen(fullpath, mode); // create and open the file
|
||||
} else { |
||||
/* note this code asumes we are writing but tests if mode == r -jrg */ |
||||
if (S_ISREG(fstats.st_mode) && !force && *mode != 'r' ) { |
||||
sprintf(prompt, "Do you want to overwrite %s ?", fullpath); |
||||
if (!yes_no(prompt)) |
||||
exit(0); |
||||
f = fopen(fullpath, mode); |
||||
} else if (S_ISFIFO(fstats.st_mode)) |
||||
{ |
||||
retcode = |
||||
open(fullpath, ((*mode == 'r')?O_RDONLY:O_WRONLY)|O_CREAT, 0664); |
||||
f = fdopen(retcode, mode); |
||||
} |
||||
else |
||||
f = fopen(fullpath, mode); |
||||
} |
||||
OPEN_CHECK(f, fullpath); |
||||
|
||||
return (f); |
||||
} |
||||
|
||||
|
||||
/*
|
||||
* agg_str(set, count) build an aggregated string from count unique |
||||
* selections taken from set |
||||
*/ |
||||
void |
||||
agg_str(distribution *set, long count, long col, char *dest) |
||||
{ |
||||
distribution *d; |
||||
int i; |
||||
|
||||
d = set; |
||||
*dest = '\0'; |
||||
|
||||
permute_dist(d, col); |
||||
for (i=0; i < count; i++) |
||||
{ |
||||
strcat(dest, DIST_MEMBER(set,DIST_PERMUTE(d, i))); |
||||
strcat(dest, " "); |
||||
} |
||||
*(dest + (int)strlen(dest) - 1) = '\0'; |
||||
|
||||
return; |
||||
} |
||||
|
||||
|
||||
long |
||||
dssncasecmp(char *s1, char *s2, int n) |
||||
{ |
||||
for (; n > 0; ++s1, ++s2, --n) |
||||
if (tolower(*s1) != tolower(*s2)) |
||||
return ((tolower(*s1) < tolower(*s2)) ? -1 : 1); |
||||
else if (*s1 == '\0') |
||||
return (0); |
||||
return (0); |
||||
} |
||||
|
||||
long |
||||
dsscasecmp(char *s1, char *s2) |
||||
{ |
||||
for (; tolower(*s1) == tolower(*s2); ++s1, ++s2) |
||||
if (*s1 == '\0') |
||||
return (0); |
||||
return ((tolower(*s1) < tolower(*s2)) ? -1 : 1); |
||||
} |
||||
|
||||
#ifndef STDLIB_HAS_GETOPT |
||||
int optind = 0; |
||||
int opterr = 0; |
||||
char *optarg = NULL; |
||||
|
||||
int |
||||
getopt(int ac, char **av, char *opt) |
||||
{ |
||||
static char *nextchar = NULL; |
||||
char *cp; |
||||
char hold; |
||||
|
||||
if (optarg == NULL) |
||||
{ |
||||
optarg = (char *)malloc(BUFSIZ); |
||||
MALLOC_CHECK(optarg); |
||||
} |
||||
|
||||
if (!nextchar || *nextchar == '\0') |
||||
{ |
||||
optind++; |
||||
if (optind == ac) |
||||
return(-1); |
||||
nextchar = av[optind]; |
||||
if (*nextchar != '-') |
||||
return(-1); |
||||
nextchar +=1; |
||||
} |
||||
|
||||
if (nextchar && *nextchar == '-') /* -- termination */ |
||||
{ |
||||
optind++; |
||||
return(-1); |
||||
} |
||||
else /* found an option */ |
||||
{ |
||||
cp = strchr(opt, *nextchar); |
||||
nextchar += 1; |
||||
if (cp == NULL) /* not defined for this run */ |
||||
return('?'); |
||||
if (*(cp + 1) == ':') /* option takes an argument */ |
||||
{ |
||||
if (*nextchar) |
||||
{ |
||||
hold = *cp; |
||||
cp = optarg; |
||||
while (*nextchar) |
||||
*cp++ = *nextchar++; |
||||
*cp = '\0'; |
||||
*cp = hold; |
||||
} |
||||
else /* white space separated, use next arg */ |
||||
{ |
||||
if (++optind == ac) |
||||
return('?'); |
||||
strcpy(optarg, av[optind]); |
||||
} |
||||
nextchar = NULL; |
||||
} |
||||
return(*cp); |
||||
} |
||||
} |
||||
#endif /* STDLIB_HAS_GETOPT */ |
||||
|
||||
char ** |
||||
mk_ascdate(void) |
||||
{ |
||||
char **m; |
||||
dss_time_t t; |
||||
DSS_HUGE i; |
||||
|
||||
m = (char**) malloc((size_t)(TOTDATE * sizeof (char *))); |
||||
MALLOC_CHECK(m); |
||||
for (i = 0; i < TOTDATE; i++) |
||||
{ |
||||
mk_time(i + 1, &t); |
||||
m[i] = strdup(t.alpha); |
||||
} |
||||
|
||||
return(m); |
||||
} |
||||
|
||||
/*
|
||||
* set_state() -- initialize the RNG so that |
||||
* appropriate data sets can be generated. |
||||
* For each table that is to be generated, calculate the number of rows/child, and send that to the |
||||
* seed generation routine in speed_seed.c. Note: assumes that tables are completely independent. |
||||
* Returns the number of rows to be generated by the named step. |
||||
*/ |
||||
DSS_HUGE |
||||
set_state(int table, long sf, long procs, long step, DSS_HUGE *extra_rows) |
||||
{ |
||||
int i; |
||||
DSS_HUGE rowcount, remainder, result; |
||||
|
||||
if (sf == 0 || step == 0) |
||||
return(0); |
||||
|
||||
rowcount = tdefs[table].base; |
||||
rowcount *= sf; |
||||
*extra_rows = rowcount % procs; |
||||
rowcount /= procs; |
||||
result = rowcount; |
||||
for (i=0; i < step - 1; i++) |
||||
{ |
||||
if (table == LINE) /* special case for shared seeds */ |
||||
tdefs[table].gen_seed(1, rowcount); |
||||
else |
||||
tdefs[table].gen_seed(0, rowcount); |
||||
/* need to set seeds of child in case there's a dependency */ |
||||
/* NOTE: this assumes that the parent and child have the same base row count */ |
||||
if (tdefs[table].child != NONE)
|
||||
tdefs[tdefs[table].child].gen_seed(0,rowcount); |
||||
} |
||||
if (step > procs) /* moving to the end to generate updates */ |
||||
tdefs[table].gen_seed(0, *extra_rows); |
||||
|
||||
return(result); |
||||
} |
Binary file not shown.
@ -0,0 +1,451 @@ |
||||
/*
|
||||
* $Id: build.c,v 1.5 2009/06/28 14:01:08 jms Exp $ |
||||
*
|
||||
* Revision History =================== $Log: build.c,v $ |
||||
* Revision History =================== Revision 1.5 2009/06/28 14:01:08 jms |
||||
* Revision History =================== bug fix for DOP |
||||
* Revision History =================== Revision 1.4 |
||||
* 2005/10/28 02:56:22 jms add platform-specific printf formats to allow for |
||||
* DSS_HUGE data type |
||||
*
|
||||
* Revision 1.3 2005/10/14 23:16:54 jms fix for answer set compliance |
||||
*
|
||||
* Revision 1.2 2005/01/03 20:08:58 jms change line terminations |
||||
*
|
||||
* Revision 1.1.1.1 2004/11/24 23:31:46 jms re-establish external server |
||||
*
|
||||
* Revision 1.3 2004/04/07 20:17:29 jms bug #58 (join fails between |
||||
* order/lineitem) |
||||
*
|
||||
* Revision 1.2 2004/01/22 05:49:29 jms AIX porting (AIX 5.1) |
||||
*
|
||||
* Revision 1.1.1.1 2003/08/08 21:35:26 jms recreation after CVS crash |
||||
*
|
||||
* Revision 1.3 2003/08/08 21:35:26 jms first integration of rng64 for |
||||
* o_custkey and l_partkey |
||||
*
|
||||
* Revision 1.2 2003/08/07 17:58:34 jms Convery RNG to 64bit space as |
||||
* preparation for new large scale RNG |
||||
*
|
||||
* Revision 1.1.1.1 2003/04/03 18:54:21 jms initial checkin |
||||
*
|
||||
*
|
||||
*/ |
||||
/* stuff related to the customer table */ |
||||
#include <stdio.h> |
||||
#include <string.h> |
||||
#ifndef VMS |
||||
#include <sys/types.h> |
||||
#endif |
||||
#if defined(SUN) |
||||
#include <unistd.h> |
||||
#endif |
||||
#include <math.h> |
||||
|
||||
#include "dss.h" |
||||
#include "dsstypes.h" |
||||
#ifdef ADHOC |
||||
#include "adhoc.h" |
||||
extern adhoc_t adhocs[]; |
||||
#endif /* ADHOC */ |
||||
#include "rng64.h" |
||||
|
||||
#define LEAP_ADJ(yr, mnth) \ |
||||
((LEAP(yr) && (mnth) >= 2) ? 1 : 0) |
||||
#define JDAY_BASE 8035 /* start from 1/1/70 a la unix */ |
||||
#define JMNTH_BASE (-70 * 12) /* start from 1/1/70 a la unix */ |
||||
#define JDAY(date) ((date) - STARTDATE + JDAY_BASE + 1) |
||||
#define PART_SUPP_BRIDGE(tgt, p, s) \ |
||||
{ \
|
||||
DSS_HUGE tot_scnt = tdefs[SUPP].base * scale; \
|
||||
tgt = (p + s * (tot_scnt / SUPP_PER_PART + \
|
||||
(long) ((p - 1) / tot_scnt))) % tot_scnt + 1; \
|
||||
} |
||||
#define V_STR(avg, sd, tgt) a_rnd((int)(avg * V_STR_LOW),(int)(avg * V_STR_HGH), sd, tgt) |
||||
#define TEXT(avg, sd, tgt) dbg_text(tgt, (int)(avg * V_STR_LOW),(int)(avg * V_STR_HGH), sd) |
||||
static void gen_phone PROTO((DSS_HUGE ind, char *target, long seed)); |
||||
|
||||
DSS_HUGE |
||||
rpb_routine(DSS_HUGE p) |
||||
{ |
||||
DSS_HUGE price; |
||||
|
||||
price = 90000; |
||||
price += (p / 10) % 20001; /* limit contribution to $200 */ |
||||
price += (p % 1000) * 100; |
||||
|
||||
return (price); |
||||
} |
||||
|
||||
static void |
||||
gen_phone(DSS_HUGE ind, char *target, long seed) |
||||
{ |
||||
DSS_HUGE acode, exchg, number; |
||||
|
||||
RANDOM(acode, 100, 999, seed); |
||||
RANDOM(exchg, 100, 999, seed); |
||||
RANDOM(number, 1000, 9999, seed); |
||||
|
||||
sprintf(target, "%02d", (int) (10 + (ind % NATIONS_MAX))); |
||||
sprintf(target + 3, "%03d", (int) acode); |
||||
sprintf(target + 7, "%03d", (int) exchg); |
||||
sprintf(target + 11, "%04d", (int) number); |
||||
target[2] = target[6] = target[10] = '-'; |
||||
|
||||
return; |
||||
} |
||||
|
||||
|
||||
|
||||
long |
||||
mk_cust(DSS_HUGE n_cust, customer_t * c) |
||||
{ |
||||
DSS_HUGE i; |
||||
static int bInit = 0; |
||||
static char szFormat[100]; |
||||
|
||||
if (!bInit) |
||||
{ |
||||
sprintf(szFormat, C_NAME_FMT, 9, HUGE_FORMAT + 1); |
||||
bInit = 1; |
||||
} |
||||
c->custkey = n_cust; |
||||
sprintf(c->name, szFormat, C_NAME_TAG, n_cust); |
||||
V_STR(C_ADDR_LEN, C_ADDR_SD, c->address); |
||||
c->alen = (int)strlen(c->address); |
||||
RANDOM(i, 0, (nations.count - 1), C_NTRG_SD); |
||||
c->nation_code = i; |
||||
gen_phone(i, c->phone, (long) C_PHNE_SD); |
||||
RANDOM(c->acctbal, C_ABAL_MIN, C_ABAL_MAX, C_ABAL_SD); |
||||
pick_str(&c_mseg_set, C_MSEG_SD, c->mktsegment); |
||||
TEXT(C_CMNT_LEN, C_CMNT_SD, c->comment); |
||||
c->clen = (int)strlen(c->comment); |
||||
|
||||
return (0); |
||||
} |
||||
|
||||
|
||||
/*
|
||||
* generate the numbered order and its associated lineitems |
||||
*/ |
||||
void |
||||
mk_sparse(DSS_HUGE i, DSS_HUGE * ok, long seq) |
||||
{ |
||||
long low_bits; |
||||
|
||||
*ok = i; |
||||
low_bits = (long) (i & ((1 << SPARSE_KEEP) - 1)); |
||||
*ok = *ok >> SPARSE_KEEP; |
||||
*ok = *ok << SPARSE_BITS; |
||||
*ok += seq; |
||||
*ok = *ok << SPARSE_KEEP; |
||||
*ok += low_bits; |
||||
|
||||
|
||||
return; |
||||
} |
||||
|
||||
long |
||||
mk_order(DSS_HUGE index, order_t * o, long upd_num) |
||||
{ |
||||
DSS_HUGE lcnt; |
||||
DSS_HUGE rprice; |
||||
long ocnt; |
||||
DSS_HUGE tmp_date; |
||||
DSS_HUGE s_date; |
||||
DSS_HUGE r_date; |
||||
DSS_HUGE c_date; |
||||
DSS_HUGE clk_num; |
||||
DSS_HUGE supp_num; |
||||
static char **asc_date = NULL; |
||||
char tmp_str[2]; |
||||
char **mk_ascdate PROTO((void)); |
||||
int delta = 1; |
||||
static int bInit = 0; |
||||
static char szFormat[100]; |
||||
|
||||
if (!bInit) |
||||
{ |
||||
sprintf(szFormat, O_CLRK_FMT, 9, HUGE_FORMAT + 1); |
||||
bInit = 1; |
||||
} |
||||
if (asc_date == NULL) |
||||
asc_date = mk_ascdate(); |
||||
mk_sparse(index, &o->okey, |
||||
(upd_num == 0) ? 0 : 1 + upd_num / (10000 / UPD_PCT)); |
||||
if (scale >= 30000) |
||||
RANDOM64(o->custkey, O_CKEY_MIN, O_CKEY_MAX, O_CKEY_SD); |
||||
else |
||||
RANDOM(o->custkey, O_CKEY_MIN, O_CKEY_MAX, O_CKEY_SD); |
||||
while (o->custkey % CUST_MORTALITY == 0) |
||||
{ |
||||
o->custkey += delta; |
||||
o->custkey = MIN(o->custkey, O_CKEY_MAX); |
||||
delta *= -1; |
||||
} |
||||
|
||||
|
||||
RANDOM(tmp_date, O_ODATE_MIN, O_ODATE_MAX, O_ODATE_SD); |
||||
strcpy(o->odate, asc_date[tmp_date - STARTDATE]); |
||||
|
||||
pick_str(&o_priority_set, O_PRIO_SD, o->opriority); |
||||
RANDOM(clk_num, 1, MAX((scale * O_CLRK_SCL), O_CLRK_SCL), O_CLRK_SD); |
||||
sprintf(o->clerk, szFormat, O_CLRK_TAG, clk_num); |
||||
TEXT(O_CMNT_LEN, O_CMNT_SD, o->comment); |
||||
o->clen = (int)strlen(o->comment); |
||||
#ifdef DEBUG |
||||
if (o->clen > O_CMNT_MAX) |
||||
fprintf(stderr, "comment error: O%d\n", index); |
||||
#endif /* DEBUG */ |
||||
o->spriority = 0; |
||||
|
||||
o->totalprice = 0; |
||||
o->orderstatus = 'O'; |
||||
ocnt = 0; |
||||
|
||||
RANDOM(o->lines, O_LCNT_MIN, O_LCNT_MAX, O_LCNT_SD); |
||||
for (lcnt = 0; lcnt < o->lines; lcnt++) |
||||
{ |
||||
o->l[lcnt].okey = o->okey;; |
||||
o->l[lcnt].lcnt = lcnt + 1; |
||||
RANDOM(o->l[lcnt].quantity, L_QTY_MIN, L_QTY_MAX, L_QTY_SD); |
||||
RANDOM(o->l[lcnt].discount, L_DCNT_MIN, L_DCNT_MAX, L_DCNT_SD); |
||||
RANDOM(o->l[lcnt].tax, L_TAX_MIN, L_TAX_MAX, L_TAX_SD); |
||||
pick_str(&l_instruct_set, L_SHIP_SD, o->l[lcnt].shipinstruct); |
||||
pick_str(&l_smode_set, L_SMODE_SD, o->l[lcnt].shipmode); |
||||
TEXT(L_CMNT_LEN, L_CMNT_SD, o->l[lcnt].comment); |
||||
o->l[lcnt].clen = (int)strlen(o->l[lcnt].comment); |
||||
if (scale >= 30000) |
||||
RANDOM64(o->l[lcnt].partkey, L_PKEY_MIN, L_PKEY_MAX, L_PKEY_SD); |
||||
else |
||||
RANDOM(o->l[lcnt].partkey, L_PKEY_MIN, L_PKEY_MAX, L_PKEY_SD); |
||||
rprice = rpb_routine(o->l[lcnt].partkey); |
||||
RANDOM(supp_num, 0, 3, L_SKEY_SD); |
||||
PART_SUPP_BRIDGE(o->l[lcnt].suppkey, o->l[lcnt].partkey, supp_num); |
||||
o->l[lcnt].eprice = rprice * o->l[lcnt].quantity; |
||||
|
||||
o->totalprice += |
||||
((o->l[lcnt].eprice * |
||||
((long) 100 - o->l[lcnt].discount)) / (long) PENNIES) * |
||||
((long) 100 + o->l[lcnt].tax) |
||||
/ (long) PENNIES; |
||||
|
||||
RANDOM(s_date, L_SDTE_MIN, L_SDTE_MAX, L_SDTE_SD); |
||||
s_date += tmp_date; |
||||
RANDOM(c_date, L_CDTE_MIN, L_CDTE_MAX, L_CDTE_SD); |
||||
c_date += tmp_date; |
||||
RANDOM(r_date, L_RDTE_MIN, L_RDTE_MAX, L_RDTE_SD); |
||||
r_date += s_date; |
||||
|
||||
|
||||
strcpy(o->l[lcnt].sdate, asc_date[s_date - STARTDATE]); |
||||
strcpy(o->l[lcnt].cdate, asc_date[c_date - STARTDATE]); |
||||
strcpy(o->l[lcnt].rdate, asc_date[r_date - STARTDATE]); |
||||
|
||||
|
||||
if (julian(r_date) <= CURRENTDATE) |
||||
{ |
||||
pick_str(&l_rflag_set, L_RFLG_SD, tmp_str); |
||||
o->l[lcnt].rflag[0] = *tmp_str; |
||||
} |
||||
else |
||||
o->l[lcnt].rflag[0] = 'N'; |
||||
|
||||
if (julian(s_date) <= CURRENTDATE) |
||||
{ |
||||
ocnt++; |
||||
o->l[lcnt].lstatus[0] = 'F'; |
||||
} |
||||
else |
||||
o->l[lcnt].lstatus[0] = 'O'; |
||||
} |
||||
|
||||
if (ocnt > 0) |
||||
o->orderstatus = 'P'; |
||||
if (ocnt == o->lines) |
||||
o->orderstatus = 'F'; |
||||
|
||||
return (0); |
||||
} |
||||
|
||||
long |
||||
mk_part(DSS_HUGE index, part_t * p) |
||||
{ |
||||
DSS_HUGE temp; |
||||
long snum; |
||||
DSS_HUGE brnd; |
||||
static int bInit = 0; |
||||
static char szFormat[100]; |
||||
static char szBrandFormat[100]; |
||||
|
||||
if (!bInit) |
||||
{ |
||||
sprintf(szFormat, P_MFG_FMT, 1, HUGE_FORMAT + 1); |
||||
sprintf(szBrandFormat, P_BRND_FMT, 2, HUGE_FORMAT + 1); |
||||
bInit = 1; |
||||
} |
||||
p->partkey = index; |
||||
agg_str(&colors, (long) P_NAME_SCL, (long) P_NAME_SD, p->name); |
||||
RANDOM(temp, P_MFG_MIN, P_MFG_MAX, P_MFG_SD); |
||||
sprintf(p->mfgr, szFormat, P_MFG_TAG, temp); |
||||
RANDOM(brnd, P_BRND_MIN, P_BRND_MAX, P_BRND_SD); |
||||
sprintf(p->brand, szBrandFormat, P_BRND_TAG, (temp * 10 + brnd)); |
||||
p->tlen = pick_str(&p_types_set, P_TYPE_SD, p->type); |
||||
p->tlen = (int)strlen(p_types_set.list[p->tlen].text); |
||||
RANDOM(p->size, P_SIZE_MIN, P_SIZE_MAX, P_SIZE_SD); |
||||
pick_str(&p_cntr_set, P_CNTR_SD, p->container); |
||||
p->retailprice = rpb_routine(index); |
||||
TEXT(P_CMNT_LEN, P_CMNT_SD, p->comment); |
||||
p->clen = (int)strlen(p->comment); |
||||
|
||||
for (snum = 0; snum < SUPP_PER_PART; snum++) |
||||
{ |
||||
p->s[snum].partkey = p->partkey; |
||||
PART_SUPP_BRIDGE(p->s[snum].suppkey, index, snum); |
||||
RANDOM(p->s[snum].qty, PS_QTY_MIN, PS_QTY_MAX, PS_QTY_SD); |
||||
RANDOM(p->s[snum].scost, PS_SCST_MIN, PS_SCST_MAX, PS_SCST_SD); |
||||
TEXT(PS_CMNT_LEN, PS_CMNT_SD, p->s[snum].comment); |
||||
p->s[snum].clen = (int)strlen(p->s[snum].comment); |
||||
} |
||||
return (0); |
||||
} |
||||
|
||||
long |
||||
mk_supp(DSS_HUGE index, supplier_t * s) |
||||
{ |
||||
DSS_HUGE i, bad_press, noise, offset, type; |
||||
static int bInit = 0; |
||||
static char szFormat[100]; |
||||
|
||||
if (!bInit) |
||||
{ |
||||
sprintf(szFormat, S_NAME_FMT, 9, HUGE_FORMAT + 1); |
||||
bInit = 1; |
||||
} |
||||
s->suppkey = index; |
||||
sprintf(s->name, szFormat, S_NAME_TAG, index); |
||||
V_STR(S_ADDR_LEN, S_ADDR_SD, s->address); |
||||
s->alen = (int)strlen(s->address); |
||||
RANDOM(i, 0, nations.count - 1, S_NTRG_SD); |
||||
s->nation_code = i; |
||||
gen_phone(i, s->phone, S_PHNE_SD); |
||||
RANDOM(s->acctbal, S_ABAL_MIN, S_ABAL_MAX, S_ABAL_SD); |
||||
|
||||
TEXT(S_CMNT_LEN, S_CMNT_SD, s->comment); |
||||
s->clen = (int)strlen(s->comment); |
||||
/*
|
||||
* these calls should really move inside the if stmt below, but this |
||||
* will simplify seedless parallel load |
||||
*/ |
||||
RANDOM(bad_press, 1, 10000, BBB_CMNT_SD); |
||||
RANDOM(type, 0, 100, BBB_TYPE_SD); |
||||
RANDOM(noise, 0, (s->clen - BBB_CMNT_LEN), BBB_JNK_SD); |
||||
RANDOM(offset, 0, (s->clen - (BBB_CMNT_LEN + noise)), |
||||
BBB_OFFSET_SD); |
||||
if (bad_press <= S_CMNT_BBB) |
||||
{ |
||||
type = (type < BBB_DEADBEATS) ? 0 : 1; |
||||
memcpy(s->comment + offset, BBB_BASE, BBB_BASE_LEN); |
||||
if (type == 0) |
||||
memcpy(s->comment + BBB_BASE_LEN + offset + noise, |
||||
BBB_COMPLAIN, BBB_TYPE_LEN); |
||||
else |
||||
memcpy(s->comment + BBB_BASE_LEN + offset + noise, |
||||
BBB_COMMEND, BBB_TYPE_LEN); |
||||
} |
||||
return (0); |
||||
} |
||||
|
||||
struct |
||||
{ |
||||
char *mdes; |
||||
long days; |
||||
long dcnt; |
||||
} months[] = |
||||
|
||||
{ |
||||
{ |
||||
NULL, 0, 0 |
||||
}, |
||||
{ |
||||
"JAN", 31, 31 |
||||
}, |
||||
{ |
||||
"FEB", 28, 59 |
||||
}, |
||||
{ |
||||
"MAR", 31, 90 |
||||
}, |
||||
{ |
||||
"APR", 30, 120 |
||||
}, |
||||
{ |
||||
"MAY", 31, 151 |
||||
}, |
||||
{ |
||||
"JUN", 30, 181 |
||||
}, |
||||
{ |
||||
"JUL", 31, 212 |
||||
}, |
||||
{ |
||||
"AUG", 31, 243 |
||||
}, |
||||
{ |
||||
"SEP", 30, 273 |
||||
}, |
||||
{ |
||||
"OCT", 31, 304 |
||||
}, |
||||
{ |
||||
"NOV", 30, 334 |
||||
}, |
||||
{ |
||||
"DEC", 31, 365 |
||||
} |
||||
}; |
||||
|
||||
long |
||||
mk_time(DSS_HUGE index, dss_time_t * t) |
||||
{ |
||||
long m = 0; |
||||
long y; |
||||
long d; |
||||
|
||||
t->timekey = index + JDAY_BASE; |
||||
y = julian(index + STARTDATE - 1) / 1000; |
||||
d = julian(index + STARTDATE - 1) % 1000; |
||||
while (d > months[m].dcnt + LEAP_ADJ(y, m)) |
||||
m++; |
||||
PR_DATE(t->alpha, y, m, |
||||
d - months[m - 1].dcnt - ((LEAP(y) && m > 2) ? 1 : 0)); |
||||
t->year = 1900 + y; |
||||
t->month = m + 12 * y + JMNTH_BASE; |
||||
t->week = (d + T_START_DAY - 1) / 7 + 1; |
||||
t->day = d - months[m - 1].dcnt - LEAP_ADJ(y, m - 1); |
||||
|
||||
return (0); |
||||
} |
||||
|
||||
int |
||||
mk_nation(DSS_HUGE index, code_t * c) |
||||
{ |
||||
c->code = index - 1; |
||||
c->text = nations.list[index - 1].text; |
||||
c->join = nations.list[index - 1].weight; |
||||
TEXT(N_CMNT_LEN, N_CMNT_SD, c->comment); |
||||
c->clen = (int)strlen(c->comment); |
||||
return (0); |
||||
} |
||||
|
||||
int |
||||
mk_region(DSS_HUGE index, code_t * c) |
||||
{ |
||||
|
||||
c->code = index - 1; |
||||
c->text = regions.list[index - 1].text; |
||||
c->join = 0; /* for completeness */ |
||||
TEXT(R_CMNT_LEN, R_CMNT_SD, c->comment); |
||||
c->clen = (int)strlen(c->comment); |
||||
return (0); |
||||
} |
Binary file not shown.
@ -0,0 +1,8 @@ |
||||
Answer sets to be compared should all be named q<1..22>.out . |
||||
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. |
||||
|
||||
./pairs.sh <dir1> <dir2> |
||||
This will create or overwrite a dir called <dir1>_<dir2> and put in it 22 files of the form analysis_<1..22>.out . |
||||
|
||||
cmpq.pl |
||||
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. |
@ -0,0 +1,3 @@ |
||||
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 |
||||
./cmpq.pl $i ./Ingres_1g_qualification/q${i}.out ./Oracle_1g_qualification/${i}.log; |
||||
done |
@ -0,0 +1,159 @@ |
||||
#!/usr/bin/perl |
||||
my $Query=shift(@ARGV); |
||||
my $InputFile1=shift(@ARGV); |
||||
my $InputFile2=shift(@ARGV); |
||||
my $assume_header=1; |
||||
my $OutputLog="analysis_".$Query.".log"; |
||||
my @ColPos; |
||||
my @ColF1; |
||||
my @ColF2; |
||||
my @ColStartF1; |
||||
my @ColEndF1; |
||||
my @ColStartF2; |
||||
my @ColEndF2; |
||||
my $NumColF1; |
||||
my $NumColF2; |
||||
my $QueryColPrecisionFile="colprecision.txt"; |
||||
my @ColStart; |
||||
my @ColEnd; |
||||
my $NumMismatch=0; |
||||
open my $file1 , $InputFile1; |
||||
open my $file2 , $InputFile2; |
||||
$debug = 0; |
||||
# function to remove whitespace from the start and end of the string |
||||
|
||||
# function to get next valid line |
||||
sub NextLine($) |
||||
{ |
||||
$filehandler = shift; |
||||
my $line; |
||||
while ($line=<$filehandler>){ |
||||
chop($line); |
||||
if (length($line)>0) { |
||||
return $line; |
||||
} |
||||
} |
||||
return undef; |
||||
} |
||||
|
||||
sub rtrim($) |
||||
{ |
||||
my $string = shift; |
||||
#$string =~ s/^\s+//; |
||||
$string =~ s/\s+$//; |
||||
return $string; |
||||
} |
||||
|
||||
|
||||
# main |
||||
|
||||
open my $file1 , $InputFile1; |
||||
open my $file2 , $InputFile2; |
||||
open(LOG,">$OutputLog"); |
||||
open(QColPrecision,$QueryColPrecisionFile); |
||||
|
||||
#get column precision information |
||||
$i=1; |
||||
while (($l=<QColPrecision>) && ($i<$Query)){ |
||||
$i++; |
||||
} |
||||
if ($i != $Query) { |
||||
print "Could not find column precision for Query $Query\n"; |
||||
} |
||||
@QueryColPrecision=split(/\s/,$l); |
||||
|
||||
#print @QueryColPrecision; |
||||
$NumRowsF1=0; |
||||
$NumRowsF2=0; |
||||
if ($assume_header==1){ |
||||
$lf1=&NextLine($file1); |
||||
$lf2=&NextLine($file2); |
||||
} |
||||
while (1){ |
||||
$lf1=&NextLine($file1); |
||||
#print "File 1 $lf1\n"; |
||||
$lf2=&NextLine($file2); |
||||
#print "File 2 $lf2\n"; |
||||
if ((!defined($lf1)) && (defined($lf2))) { |
||||
print LOG "File1 ($InputFile1) exhausted before File2 ($InputFile2)\n"; |
||||
print LOG "Number of rows processed $NumRowsF1\n"; |
||||
exit; |
||||
} elsif ((defined($lf1)) && (!defined($lf2))) { |
||||
print LOG "File2 ($InputFile2) exhausted before File1 ($InputFile1)\n"; |
||||
print LOG "Number of rows processed $NumRowsF1\n"; |
||||
exit; |
||||
} elsif ((!defined($lf1)) && (!defined($lf2))) { |
||||
#done |
||||
print LOG "Found $NumMismatch unacceptable missmatches\n"; |
||||
print "Query $Query $NumMismatch unacceptable missmatches\n"; |
||||
exit; |
||||
} |
||||
$NumRowsF1++; |
||||
$NumRowsF2++; |
||||
#print "Comparing row $lf1 with $lf2"; |
||||
# The following split implements fixed column length |
||||
#print "Splitting row $NumColF1: $lf1\n"; |
||||
@ColF1=split(/\|/,$lf1); |
||||
$NumColF1=@ColF1; |
||||
#print "Splitting row $NumColF2: $lf2\n"; |
||||
@ColF2=split(/\|/,$lf2); |
||||
$NumColF2=@ColF2; |
||||
# as needed we can extend to other splits |
||||
if ($NumColF1!=$NumColF2) { |
||||
print LOG "Number of column mismatch in row $NumRowsF1\n"; |
||||
exit; |
||||
} |
||||
#print $NumColF1."|".$NumColF2."\n"; |
||||
for ($col=0;$col<$NumColF1;$col++){ |
||||
#print "@ColF1[$col]| "; |
||||
@ColF1[$col]=&rtrim(@ColF1[$col]); |
||||
#print "@ColF1[$col]|\n"; |
||||
#print "@ColF2[$col]|"; |
||||
@ColF2[$col]=&rtrim(@ColF2[$col]); |
||||
#print "@ColF2[$col]|\n"; |
||||
} |
||||
# comparison |
||||
for ($col=0;$col<$NumColF1;$col++){ |
||||
#print "Comparing @ColF1[$col] and @ColF2[$col]\n"; |
||||
$difference=0; |
||||
$mismatch=0; |
||||
#print "@QueryColPrecision[$col]\n"; |
||||
for (@QueryColPrecision[$col]) { |
||||
if (/str/) {$mismatch = @ColF1[$col] ne @ColF2[$col] ? 1 : 0} #column is string and needs to match exactly |
||||
elsif (/sum/) {@ColF1[$col]=sprintf("%.2f", @ColF1[$col]); |
||||
@ColF2[$col]=sprintf("%.2f", @ColF2[$col]); |
||||
$difference = abs(@ColF1[$col] - @ColF2[$col]); |
||||
$pdifference= sprintf("%.4f",(($difference/@ColF1[$col])*100)); |
||||
$mismatch = $difference>100 ? 1 : 0; |
||||
$pdifference= sprintf("%.4f",($difference/@ColF1[$col])*100); } #column is sum and needs to be with 100 |
||||
elsif (/avg/) {@ColF1[$col]=sprintf("%.2f", @ColF1[$col]); |
||||
@ColF2[$col]=sprintf("%.2f", @ColF2[$col]); |
||||
$difference = abs(@ColF1[$col] - @ColF2[$col]); |
||||
$pdifference= sprintf("%.4f",(($difference/@ColF1[$col])*100)); |
||||
$mismatch = $pdifference>1 ? 1 : 0} #column is avg and needs to be within 1 percent when reported to the nearest 1/100th, rounded up |
||||
elsif (/cnt/) {$mismatch=1 if (@ColF1[$col] != @ColF2[$col])} #column is cnt and needs to match exactly |
||||
elsif (/int/) {$mismatch=1 if (@ColF1[$col] != @ColF2[$col])} #column is int and needs to match exactly |
||||
elsif (/num/) {@ColF1[$col]=sprintf("%.2f", @ColF1[$col]); |
||||
@ColF2[$col]=sprintf("%.2f", @ColF2[$col]); |
||||
$mismatch=1 if (@ColF1[$col] != @ColF2[$col]); |
||||
$difference = abs(@ColF1[$col] - @ColF2[$col]); |
||||
$pdifference= sprintf("%.4f",(($difference/@ColF1[$col])*100));} #column is num and needs to match exactly when reported to the nearest 1/100th, rounded up |
||||
elsif (/rat/) {@ColF1[$col]=sprintf("%.2f", @ColF1[$col]); |
||||
@ColF2[$col]=sprintf("%.2f", @ColF2[$col]); |
||||
$difference = abs(@ColF1[$col] - @ColF2[$col]); |
||||
$pdifference= sprintf("%.4f",(($difference/@ColF1[$col])*100)); |
||||
$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 |
||||
else {print LOG "Don't know how to compare type @QueryColPrecision[$col]\n";exit;} # default |
||||
} |
||||
#print "$mismatch $difference\n"; |
||||
if ($mismatch == 1) { |
||||
$NumMismatch++; |
||||
if (@QueryColPrecision[$col]=~"str"){ |
||||
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]");} |
||||
else { |
||||
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";} |
||||
} elsif ($difference>0) { |
||||
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"; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,23 @@ |
||||
str str sum sum sum sum avg avg avg cnt |
||||
num str str int str str str str |
||||
int sum str int |
||||
str cnt |
||||
str sum |
||||
sum |
||||
str str int sum |
||||
int rat |
||||
str int sum |
||||
int str sum num str str str str |
||||
int sum |
||||
str sum sum |
||||
cnt cnt |
||||
rat |
||||
int str str str sum |
||||
str str num cnt |
||||
avg |
||||
str int int str num sum |
||||
sum |
||||
str str |
||||
str cnt |
||||
num cnt sum |
||||
|
@ -0,0 +1,25 @@ |
||||
#!/bin/bash |
||||
|
||||
pairs() |
||||
{ |
||||
x=$1 |
||||
shift 1 |
||||
for y in $*;do |
||||
echo Comparing $x to $y |
||||
for ((i=1; i<23; i++));do |
||||
./cmpq.pl $i ./${x}/q${i}.out ./${y}/q${i}.out |
||||
done |
||||
mkdir -p ${x}_${y} |
||||
mv analysis* ${x}_${y} |
||||
done |
||||
if [ $# -gt 1 ]; then |
||||
pairs $* |
||||
fi |
||||
} |
||||
|
||||
if [ $# -eq 0 ]; then |
||||
pairs oracle ingres microsoft ibm |
||||
else |
||||
pairs $* |
||||
fi |
||||
|
@ -0,0 +1,15 @@ |
||||
#!/bin/bash |
||||
TABLE=$1 |
||||
IFS="|" |
||||
|
||||
while read line |
||||
do |
||||
set $line |
||||
count=1 |
||||
while [ $# -gt 0 ] |
||||
do |
||||
echo $1 >> ${TABLE}$count |
||||
count=`expr $count + 1` |
||||
shift |
||||
done |
||||
done |
@ -0,0 +1,219 @@ |
||||
/*
|
||||
* $Id: config.h,v 1.8 2007/01/04 21:29:21 jms Exp $ |
||||
* |
||||
* Revision History |
||||
* =================== |
||||
* $Log: config.h,v $ |
||||
* Revision 1.8 2007/01/04 21:29:21 jms |
||||
* Porting changes uncovered as part of move to VS2005. No impact on data set |
||||
* |
||||
* Revision 1.7 2006/06/29 20:46:17 jms |
||||
* 2.4.0 changes from Meikel |
||||
* |
||||
* Revision 1.6 2006/05/31 22:25:21 jms |
||||
* Rework UnifInt calls in varsub to handle lack of PROTO defn in windows |
||||
* |
||||
* Revision 1.5 2006/05/25 22:35:36 jms |
||||
* qgen porting changes for 32b/64b |
||||
* |
||||
* Revision 1.4 2006/03/09 18:54:55 jms |
||||
* porting bugs |
||||
* |
||||
* Revision 1.3 2005/03/04 19:48:39 jms |
||||
* Changes from Doug Johnson to address very large scale factors |
||||
* |
||||
* Revision 1.2 2005/01/03 20:08:58 jms |
||||
* change line terminations |
||||
* |
||||
* Revision 1.1.1.1 2004/11/24 23:31:46 jms |
||||
* re-establish external server |
||||
* |
||||
* Revision 1.7 2004/04/08 17:36:47 jms |
||||
* clarify config.h/makefile linkage |
||||
* |
||||
* Revision 1.6 2004/04/08 17:35:00 jms |
||||
* SUN/SOLARIS ifdef merge between machines |
||||
* |
||||
* Revision 1.5 2004/04/08 17:27:53 jms |
||||
* solaris porting fixes |
||||
* |
||||
* Revision 1.4 2003/08/12 16:45:26 jms |
||||
* linux porting changes |
||||
* |
||||
* Revision 1.3 2003/08/08 21:35:26 jms |
||||
* first integration of rng64 for o_custkey and l_partkey |
||||
* |
||||
* Revision 1.2 2003/08/07 17:58:34 jms |
||||
* Convery RNG to 64bit space as preparation for new large scale RNG |
||||
* |
||||
* Revision 1.1.1.1 2003/04/03 18:54:21 jms |
||||
* initial checkin |
||||
* |
||||
* |
||||
*/ |
||||
/*
|
||||
* this file allows the compilation of DBGEN to be tailored to specific |
||||
* architectures and operating systems. Some options are grouped
|
||||
* together to allow easier compilation on a given vendor's hardware. |
||||
*
|
||||
* The following #defines will effect the code: |
||||
* KILL(pid) -- how to terminate a process in a parallel load |
||||
* SPAWN -- name of system call to clone an existing process |
||||
* SET_HANDLER(proc) -- name of routine to handle signals in parallel load |
||||
* WAIT(res, pid) -- how to await the termination of a child |
||||
* SEPARATOR -- character used to separate fields in flat files |
||||
* STDLIB_HAS_GETOPT -- to prevent confilcts with gloabal getopt()
|
||||
* MDY_DATE -- generate dates as MM-DD-YY |
||||
* WIN32 -- support for WindowsNT |
||||
* SUPPORT_64BITS -- compiler defines a 64 bit datatype |
||||
* DSS_HUGE -- 64 bit data type |
||||
* HUGE_FORMAT -- printf string for 64 bit data type |
||||
* EOL_HANDLING -- flat files don't need final column separator |
||||
* |
||||
* Certain defines must be provided in the makefile: |
||||
* MACHINE defines |
||||
* ========== |
||||
* ATT -- getopt() handling |
||||
* DOS -- disable all multi-user functionality/dependency |
||||
* HP -- posix source inclusion differences |
||||
* IBM -- posix source inclusion differences |
||||
* SGI -- getopt() handling |
||||
* SUN -- getopt() handling |
||||
* LINUX
|
||||
* WIN32 -- for WINDOWS |
||||
* |
||||
* DATABASE defines |
||||
* ================ |
||||
* DB2 -- use DB2 dialect in QGEN |
||||
* INFORMIX -- use Informix dialect in QGEN |
||||
* SQLSERVER -- use SQLSERVER dialect in QGEN |
||||
* SYBASE -- use Sybase dialect in QGEN |
||||
* TDAT -- use Teradata dialect in QGEN |
||||
* |
||||
* WORKLOAD defines |
||||
* ================ |
||||
* TPCH -- make will create TPCH (set in makefile) |
||||
*/ |
||||
|
||||
#ifdef DOS |
||||
#define PATH_SEP '\\' |
||||
#else |
||||
|
||||
|
||||
#ifdef ATT |
||||
#define STDLIB_HAS_GETOPT |
||||
#ifdef SQLSERVER |
||||
#define WIN32 |
||||
#else |
||||
/* the 64 bit defines are for the Metaware compiler */ |
||||
#define SUPPORT_64BITS |
||||
#define DSS_HUGE long long |
||||
#define RNG_A 6364136223846793005ull |
||||
#define RNG_C 1ull |
||||
#define HUGE_FORMAT "%LLd" |
||||
#define HUGE_DATE_FORMAT "%02LLd" |
||||
#endif /* SQLSERVER or MP/RAS */ |
||||
#endif /* ATT */ |
||||
|
||||
#ifdef HP |
||||
#define _INCLUDE_POSIX_SOURCE |
||||
#define STDLIB_HAS_GETOPT |
||||
#define SUPPORT_64BITS |
||||
#define DSS_HUGE long |
||||
#define HUGE_COUNT 2 |
||||
#define HUGE_FORMAT "%ld" |
||||
#define HUGE_DATE_FORMAT "%02lld" |
||||
#define RNG_C 1ull |
||||
#define RNG_A 6364136223846793005ull |
||||
#endif /* HP */ |
||||
|
||||
#ifdef IBM |
||||
#define STDLIB_HAS_GETOPT |
||||
#define SUPPORT_64BITS |
||||
#define DSS_HUGE long long |
||||
#define HUGE_FORMAT "%lld" |
||||
#define HUGE_DATE_FORMAT "%02lld" |
||||
#define RNG_A 6364136223846793005ull |
||||
#define RNG_C 1ull |
||||
#endif /* IBM */ |
||||
|
||||
#ifdef LINUX |
||||
#define STDLIB_HAS_GETOPT |
||||
#define SUPPORT_64BITS |
||||
#define DSS_HUGE long long int |
||||
#define HUGE_FORMAT "%lld" |
||||
#define HUGE_DATE_FORMAT "%02lld" |
||||
#define RNG_A 6364136223846793005ull |
||||
#define RNG_C 1ull |
||||
#endif /* LINUX */ |
||||
|
||||
#ifdef SUN |
||||
#define STDLIB_HAS_GETOPT |
||||
#define RNG_A 6364136223846793005ull |
||||
#define RNG_C 1ull |
||||
#define SUPPORT_64BITS |
||||
#define DSS_HUGE long long |
||||
#define HUGE_FORMAT "%lld" |
||||
#define HUGE_DATE_FORMAT "%02lld" |
||||
#endif /* SUN */ |
||||
|
||||
#ifdef SGI |
||||
#define STDLIB_HAS_GETOPT |
||||
#define SUPPORT_64BITS |
||||
#define DSS_HUGE __int64_t |
||||
#endif /* SGI */ |
||||
|
||||
#if (defined(WIN32)&&!defined(_POSIX_)) |
||||
#define pid_t int |
||||
#define SET_HANDLER(proc) signal(SIGINT, proc) |
||||
#define KILL(pid) \ |
||||
TerminateProcess(OpenProcess(PROCESS_TERMINATE,FALSE,pid),3) |
||||
#if (defined (__WATCOMC__)) |
||||
#define SPAWN() spawnv(P_NOWAIT, spawn_args[0], spawn_args) |
||||
#define WAIT(res, pid) cwait(res, pid, WAIT_CHILD) |
||||
#else |
||||
#define SPAWN() _spawnv(_P_NOWAIT, spawn_args[0], spawn_args) |
||||
#define WAIT(res, pid) _cwait(res, pid, _WAIT_CHILD) |
||||
#define getpid _getpid |
||||
#endif /* WATCOMC */ |
||||
#define SIGS_DEFINED |
||||
#define PATH_SEP '\\' |
||||
#define SUPPORT_64BITS |
||||
#define DSS_HUGE __int64 |
||||
#define RNG_A 6364136223846793005uI64 |
||||
#define RNG_C 1uI64 |
||||
#define HUGE_FORMAT "%I64d" |
||||
#define HUGE_DATE_FORMAT "%02I64d" |
||||
/* need to define process termination codes to match UNIX */ |
||||
/* these are copied from Linux/GNU and need to be verified as part of a rework of */ |
||||
/* process handling under NT (29 Apr 98) */ |
||||
#define WIFEXITED(s) ((s & 0xFF) == 0) |
||||
#define WIFSIGNALED(s) (((unsigned int)((status)-1) & 0xFFFF) < 0xFF) |
||||
#define WIFSTOPPED(s) (((s) & 0xff) == 0x7f) |
||||
#define WTERMSIG(s) ((s) & 0x7f) |
||||
#define WSTOPSIG(s) (((s) & 0xff00) >> 8) |
||||
/* requried by move to Visual Studio 2005 */ |
||||
#define strdup(x) _strdup(x) |
||||
#endif /* WIN32 */ |
||||
|
||||
#ifndef SIGS_DEFINED |
||||
#define KILL(pid) kill(SIGUSR1, pid) |
||||
#define SET_HANDLER(proc) signal(SIGUSR1, proc) |
||||
#define SPAWN fork |
||||
#define WAIT(res, pid) wait(res) |
||||
#endif /* DEFAULT */ |
||||
|
||||
#endif /* DOS */ |
||||
|
||||
#ifndef PATH_SEP |
||||
#define PATH_SEP '/' |
||||
#endif /* PATH_SEP */ |
||||
|
||||
#ifndef DSS_HUGE |
||||
#error Support for a 64-bit datatype is required in this release |
||||
#endif |
||||
|
||||
#ifndef DOUBLE_CAST |
||||
#define DOUBLE_CAST (double) |
||||
#endif /* DOUBLE_CAST */ |
||||
|
Binary file not shown.
@ -0,0 +1,168 @@ |
||||
# Microsoft Developer Studio Project File - Name="dbgen" - Package Owner=<4> |
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00 |
||||
# ** DO NOT EDIT ** |
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103 |
||||
|
||||
CFG=dbgen - Win32 Debug |
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE, |
||||
!MESSAGE use the Export Makefile command and run |
||||
!MESSAGE |
||||
!MESSAGE NMAKE /f "dbgen.mak". |
||||
!MESSAGE |
||||
!MESSAGE You can specify a configuration when running NMAKE |
||||
!MESSAGE by defining the macro CFG on the command line. For example: |
||||
!MESSAGE |
||||
!MESSAGE NMAKE /f "dbgen.mak" CFG="dbgen - Win32 Debug" |
||||
!MESSAGE |
||||
!MESSAGE Possible choices for configuration are: |
||||
!MESSAGE |
||||
!MESSAGE "dbgen - Win32 Release" (based on "Win32 (x86) Console Application") |
||||
!MESSAGE "dbgen - Win32 Debug" (based on "Win32 (x86) Console Application") |
||||
!MESSAGE |
||||
|
||||
# Begin Project |
||||
# PROP AllowPerConfigDependencies 0 |
||||
# PROP Scc_ProjName "" |
||||
# PROP Scc_LocalPath "" |
||||
CPP=cl.exe |
||||
RSC=rc.exe |
||||
|
||||
!IF "$(CFG)" == "dbgen - Win32 Release" |
||||
|
||||
# PROP BASE Use_MFC 0 |
||||
# PROP BASE Use_Debug_Libraries 0 |
||||
# PROP BASE Output_Dir "Release" |
||||
# PROP BASE Intermediate_Dir "Release" |
||||
# PROP BASE Target_Dir "" |
||||
# PROP Use_MFC 0 |
||||
# PROP Use_Debug_Libraries 0 |
||||
# PROP Output_Dir "Release" |
||||
# PROP Intermediate_Dir "Release" |
||||
# PROP Target_Dir "" |
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c |
||||
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "TPCH" /YX /FD /c |
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG" |
||||
# ADD RSC /l 0x409 /d "NDEBUG" |
||||
BSC32=bscmake.exe |
||||
# ADD BASE BSC32 /nologo |
||||
# ADD BSC32 /nologo |
||||
LINK32=link.exe |
||||
# 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 |
||||
# 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 |
||||
|
||||
!ELSEIF "$(CFG)" == "dbgen - Win32 Debug" |
||||
|
||||
# PROP BASE Use_MFC 0 |
||||
# PROP BASE Use_Debug_Libraries 1 |
||||
# PROP BASE Output_Dir "Debug" |
||||
# PROP BASE Intermediate_Dir "Debug" |
||||
# PROP BASE Target_Dir "" |
||||
# PROP Use_MFC 0 |
||||
# PROP Use_Debug_Libraries 1 |
||||
# PROP Output_Dir "Debug" |
||||
# PROP Intermediate_Dir "Debug" |
||||
# PROP Target_Dir "" |
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c |
||||
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "TPCH" /FR /YX /FD /GZ /c |
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG" |
||||
# ADD RSC /l 0x409 /d "_DEBUG" |
||||
BSC32=bscmake.exe |
||||
# ADD BASE BSC32 /nologo |
||||
# ADD BSC32 /nologo |
||||
LINK32=link.exe |
||||
# 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 |
||||
# 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 |
||||
|
||||
!ENDIF |
||||
|
||||
# Begin Target |
||||
|
||||
# Name "dbgen - Win32 Release" |
||||
# Name "dbgen - Win32 Debug" |
||||
# Begin Group "Source Files" |
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\bm_utils.c |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\build.c |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\driver.c |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\load_stub.c |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\permute.c |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\print.c |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\rnd.c |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\rng64.c |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\speed_seed.c |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\text.c |
||||
# End Source File |
||||
# End Group |
||||
# Begin Group "Header Files" |
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl" |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\config.h |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\dss.h |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\dsstypes.h |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\permute.h |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\rnd.h |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\rng64.h |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\shared.h |
||||
# End Source File |
||||
# Begin Source File |
||||
|
||||
SOURCE=.\tpcd.h |
||||
# End Source File |
||||
# End Group |
||||
# Begin Group "Resource Files" |
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" |
||||
# End Group |
||||
# End Target |
||||
# End Project |
@ -0,0 +1,836 @@ |
||||
# |
||||
# $Id: dists.dss,v 1.2 2005/01/03 20:08:58 jms Exp $ |
||||
# |
||||
# Revision History |
||||
# =================== |
||||
# $Log: dists.dss,v $ |
||||
# Revision 1.2 2005/01/03 20:08:58 jms |
||||
# change line terminations |
||||
# |
||||
# Revision 1.1.1.1 2004/11/24 23:31:46 jms |
||||
# re-establish external server |
||||
# |
||||
# Revision 1.1.1.1 2003/04/03 18:54:21 jms |
||||
# recreation after CVS crash |
||||
# |
||||
# Revision 1.1.1.1 2003/04/03 18:54:21 jms |
||||
# initial checkin |
||||
# |
||||
# |
||||
# |
||||
# |
||||
# distributions have the following format: |
||||
# |
||||
# <token> | <weight> # comment |
||||
# |
||||
# Distributions are used to bias the selection of a token |
||||
# based on its associated weight. The list of tokens and values |
||||
# between the keywords BEGIN and END define the distribution named after |
||||
# the BEGIN. A uniformly random value from [0, sum(weights)] |
||||
# will be chosen and the first token whose cumulative weight is greater than |
||||
# or equal to the result will be returned. In essence, the weights for each |
||||
# token represent its relative weight within a distribution. |
||||
# |
||||
# one special token is defined: count (number of data points in the |
||||
# distribution). It MUST be defined for each named distribution. |
||||
#----------------------------------------------------------------------- |
||||
# currently defined distributions and their use: |
||||
# NAME FIELD/NOTES |
||||
# ======== ============== |
||||
# category parts.category |
||||
# container parts.container |
||||
# instruct shipping instructions |
||||
# msegmnt market segment |
||||
# names parts.name |
||||
# nations must be ordered along with regions |
||||
# nations2 stand alone nations set for use with qgen |
||||
# o_prio order priority |
||||
# regions must be ordered along with nations |
||||
# rflag lineitems.returnflag |
||||
# types parts.type |
||||
# colors embedded string creation; CANNOT BE USED FOR pick_str(), agg_str() perturbs order |
||||
# articles comment generation |
||||
# nouns |
||||
# verbs |
||||
# adverbs |
||||
# auxillaries |
||||
# prepositions |
||||
# terminators |
||||
# grammar sentence formation |
||||
# np |
||||
# vp |
||||
### |
||||
# category |
||||
### |
||||
BEGIN category |
||||
COUNT|5 |
||||
FURNITURE|1 |
||||
STORAGE EQUIP|1 |
||||
TOOLS|1 |
||||
MACHINE TOOLS|1 |
||||
OTHER|1 |
||||
END category |
||||
### |
||||
# container |
||||
### |
||||
begin p_cntr |
||||
count|40 |
||||
SM CASE|1 |
||||
SM BOX|1 |
||||
SM BAG|1 |
||||
SM JAR|1 |
||||
SM PACK|1 |
||||
SM PKG|1 |
||||
SM CAN|1 |
||||
SM DRUM|1 |
||||
LG CASE|1 |
||||
LG BOX|1 |
||||
LG BAG|1 |
||||
LG JAR|1 |
||||
LG PACK|1 |
||||
LG PKG|1 |
||||
LG CAN|1 |
||||
LG DRUM|1 |
||||
MED CASE|1 |
||||
MED BOX|1 |
||||
MED BAG|1 |
||||
MED JAR|1 |
||||
MED PACK|1 |
||||
MED PKG|1 |
||||
MED CAN|1 |
||||
MED DRUM|1 |
||||
JUMBO CASE|1 |
||||
JUMBO BOX|1 |
||||
JUMBO BAG|1 |
||||
JUMBO JAR|1 |
||||
JUMBO PACK|1 |
||||
JUMBO PKG|1 |
||||
JUMBO CAN|1 |
||||
JUMBO DRUM|1 |
||||
WRAP CASE|1 |
||||
WRAP BOX|1 |
||||
WRAP BAG|1 |
||||
WRAP JAR|1 |
||||
WRAP PACK|1 |
||||
WRAP PKG|1 |
||||
WRAP CAN|1 |
||||
WRAP DRUM|1 |
||||
end p_cntr |
||||
### |
||||
# instruct |
||||
### |
||||
begin instruct |
||||
count|4 |
||||
DELIVER IN PERSON|1 |
||||
COLLECT COD|1 |
||||
TAKE BACK RETURN|1 |
||||
NONE|1 |
||||
end instruct |
||||
### |
||||
# msegmnt |
||||
### |
||||
begin msegmnt |
||||
count|5 |
||||
AUTOMOBILE|1 |
||||
BUILDING|1 |
||||
FURNITURE|1 |
||||
HOUSEHOLD|1 |
||||
MACHINERY|1 |
||||
end msegmnt |
||||
### |
||||
# names |
||||
### |
||||
begin p_names |
||||
COUNT|4 |
||||
CLEANER|1 |
||||
SOAP|1 |
||||
DETERGENT|1 |
||||
EXTRA|1 |
||||
end p_names |
||||
### |
||||
# nations |
||||
# NOTE: this is a special case; the weights here are adjustments to |
||||
# map correctly into the regions table, and are *NOT* cummulative |
||||
# values to mimic a distribution |
||||
### |
||||
begin nations |
||||
count|25 |
||||
ALGERIA|0 |
||||
ARGENTINA|1 |
||||
BRAZIL|0 |
||||
CANADA|0 |
||||
EGYPT|3 |
||||
ETHIOPIA|-4 |
||||
FRANCE|3 |
||||
GERMANY|0 |
||||
INDIA|-1 |
||||
INDONESIA|0 |
||||
IRAN|2 |
||||
IRAQ|0 |
||||
JAPAN|-2 |
||||
JORDAN|2 |
||||
KENYA|-4 |
||||
MOROCCO|0 |
||||
MOZAMBIQUE|0 |
||||
PERU|1 |
||||
CHINA|1 |
||||
ROMANIA|1 |
||||
SAUDI ARABIA|1 |
||||
VIETNAM|-2 |
||||
RUSSIA|1 |
||||
UNITED KINGDOM|0 |
||||
UNITED STATES|-2 |
||||
end nations |
||||
### |
||||
# nations2 |
||||
### |
||||
begin nations2 |
||||
count|25 |
||||
ALGERIA|1 |
||||
ARGENTINA|1 |
||||
BRAZIL|1 |
||||
CANADA|1 |
||||
EGYPT|1 |
||||
ETHIOPIA|1 |
||||
FRANCE|1 |
||||
GERMANY|1 |
||||
INDIA|1 |
||||
INDONESIA|1 |
||||
IRAN|1 |
||||
IRAQ|1 |
||||
JAPAN|1 |
||||
JORDAN|1 |
||||
KENYA|1 |
||||
MOROCCO|1 |
||||
MOZAMBIQUE|1 |
||||
PERU|1 |
||||
CHINA|1 |
||||
ROMANIA|1 |
||||
SAUDI ARABIA|1 |
||||
VIETNAM|1 |
||||
RUSSIA|1 |
||||
UNITED KINGDOM|1 |
||||
UNITED STATES|1 |
||||
end nations2 |
||||
### |
||||
# regions |
||||
### |
||||
begin regions |
||||
count|5 |
||||
AFRICA|1 |
||||
AMERICA|1 |
||||
ASIA|1 |
||||
EUROPE|1 |
||||
MIDDLE EAST|1 |
||||
end regions |
||||
### |
||||
# o_prio |
||||
### |
||||
begin o_oprio |
||||
count|5 |
||||
1-URGENT|1 |
||||
2-HIGH|1 |
||||
3-MEDIUM|1 |
||||
4-NOT SPECIFIED|1 |
||||
5-LOW|1 |
||||
end o_oprio |
||||
### |
||||
# rflag |
||||
### |
||||
begin rflag |
||||
count|2 |
||||
R|1 |
||||
A|1 |
||||
end rflag |
||||
### |
||||
# smode |
||||
### |
||||
begin smode |
||||
count|7 |
||||
REG AIR|1 |
||||
AIR|1 |
||||
RAIL|1 |
||||
TRUCK|1 |
||||
MAIL|1 |
||||
FOB|1 |
||||
SHIP|1 |
||||
end smode |
||||
### |
||||
# types |
||||
### |
||||
begin p_types |
||||
COUNT|150 |
||||
STANDARD ANODIZED TIN|1 |
||||
STANDARD ANODIZED NICKEL|1 |
||||
STANDARD ANODIZED BRASS|1 |
||||
STANDARD ANODIZED STEEL|1 |
||||
STANDARD ANODIZED COPPER|1 |
||||
STANDARD BURNISHED TIN|1 |
||||
STANDARD BURNISHED NICKEL|1 |
||||
STANDARD BURNISHED BRASS|1 |
||||
STANDARD BURNISHED STEEL|1 |
||||
STANDARD BURNISHED COPPER|1 |
||||
STANDARD PLATED TIN|1 |
||||
STANDARD PLATED NICKEL|1 |
||||
STANDARD PLATED BRASS|1 |
||||
STANDARD PLATED STEEL|1 |
||||
STANDARD PLATED COPPER|1 |
||||
STANDARD POLISHED TIN|1 |
||||
STANDARD POLISHED NICKEL|1 |
||||
STANDARD POLISHED BRASS|1 |
||||
STANDARD POLISHED STEEL|1 |
||||
STANDARD POLISHED COPPER|1 |
||||
STANDARD BRUSHED TIN|1 |
||||
STANDARD BRUSHED NICKEL|1 |
||||
STANDARD BRUSHED BRASS|1 |
||||
STANDARD BRUSHED STEEL|1 |
||||
STANDARD BRUSHED COPPER|1 |
||||
SMALL ANODIZED TIN|1 |
||||
SMALL ANODIZED NICKEL|1 |
||||
SMALL ANODIZED BRASS|1 |
||||
SMALL ANODIZED STEEL|1 |
||||
SMALL ANODIZED COPPER|1 |
||||
SMALL BURNISHED TIN|1 |
||||
SMALL BURNISHED NICKEL|1 |
||||
SMALL BURNISHED BRASS|1 |
||||
SMALL BURNISHED STEEL|1 |
||||
SMALL BURNISHED COPPER|1 |
||||
SMALL PLATED TIN|1 |
||||
SMALL PLATED NICKEL|1 |
||||
SMALL PLATED BRASS|1 |
||||
SMALL PLATED STEEL|1 |
||||
SMALL PLATED COPPER|1 |
||||
SMALL POLISHED TIN|1 |
||||
SMALL POLISHED NICKEL|1 |
||||
SMALL POLISHED BRASS|1 |
||||
SMALL POLISHED STEEL|1 |
||||
SMALL POLISHED COPPER|1 |
||||
SMALL BRUSHED TIN|1 |
||||
SMALL BRUSHED NICKEL|1 |
||||
SMALL BRUSHED BRASS|1 |
||||
SMALL BRUSHED STEEL|1 |
||||
SMALL BRUSHED COPPER|1 |
||||
MEDIUM ANODIZED TIN|1 |
||||
MEDIUM ANODIZED NICKEL|1 |
||||
MEDIUM ANODIZED BRASS|1 |
||||
MEDIUM ANODIZED STEEL|1 |
||||
MEDIUM ANODIZED COPPER|1 |
||||
MEDIUM BURNISHED TIN|1 |
||||
MEDIUM BURNISHED NICKEL|1 |
||||
MEDIUM BURNISHED BRASS|1 |
||||
MEDIUM BURNISHED STEEL|1 |
||||
MEDIUM BURNISHED COPPER|1 |
||||
MEDIUM PLATED TIN|1 |
||||
MEDIUM PLATED NICKEL|1 |
||||
MEDIUM PLATED BRASS|1 |
||||
MEDIUM PLATED STEEL|1 |
||||
MEDIUM PLATED COPPER|1 |
||||
MEDIUM POLISHED TIN|1 |
||||
MEDIUM POLISHED NICKEL|1 |
||||
MEDIUM POLISHED BRASS|1 |
||||
MEDIUM POLISHED STEEL|1 |
||||
MEDIUM POLISHED COPPER|1 |
||||
MEDIUM BRUSHED TIN|1 |
||||
MEDIUM BRUSHED NICKEL|1 |
||||
MEDIUM BRUSHED BRASS|1 |
||||
MEDIUM BRUSHED STEEL|1 |
||||
MEDIUM BRUSHED COPPER|1 |
||||
LARGE ANODIZED TIN|1 |
||||
LARGE ANODIZED NICKEL|1 |
||||
LARGE ANODIZED BRASS|1 |
||||
LARGE ANODIZED STEEL|1 |
||||
LARGE ANODIZED COPPER|1 |
||||
LARGE BURNISHED TIN|1 |
||||
LARGE BURNISHED NICKEL|1 |
||||
LARGE BURNISHED BRASS|1 |
||||
LARGE BURNISHED STEEL|1 |
||||
LARGE BURNISHED COPPER|1 |
||||
LARGE PLATED TIN|1 |
||||
LARGE PLATED NICKEL|1 |
||||
LARGE PLATED BRASS|1 |
||||
LARGE PLATED STEEL|1 |
||||
LARGE PLATED COPPER|1 |
||||
LARGE POLISHED TIN|1 |
||||
LARGE POLISHED NICKEL|1 |
||||
LARGE POLISHED BRASS|1 |
||||
LARGE POLISHED STEEL|1 |
||||
LARGE POLISHED COPPER|1 |
||||
LARGE BRUSHED TIN|1 |
||||
LARGE BRUSHED NICKEL|1 |
||||
LARGE BRUSHED BRASS|1 |
||||
LARGE BRUSHED STEEL|1 |
||||
LARGE BRUSHED COPPER|1 |
||||
ECONOMY ANODIZED TIN|1 |
||||
ECONOMY ANODIZED NICKEL|1 |
||||
ECONOMY ANODIZED BRASS|1 |
||||
ECONOMY ANODIZED STEEL|1 |
||||
ECONOMY ANODIZED COPPER|1 |
||||
ECONOMY BURNISHED TIN|1 |
||||
ECONOMY BURNISHED NICKEL|1 |
||||
ECONOMY BURNISHED BRASS|1 |
||||
ECONOMY BURNISHED STEEL|1 |
||||
ECONOMY BURNISHED COPPER|1 |
||||
ECONOMY PLATED TIN|1 |
||||
ECONOMY PLATED NICKEL|1 |
||||
ECONOMY PLATED BRASS|1 |
||||
ECONOMY PLATED STEEL|1 |
||||
ECONOMY PLATED COPPER|1 |
||||
ECONOMY POLISHED TIN|1 |
||||
ECONOMY POLISHED NICKEL|1 |
||||
ECONOMY POLISHED BRASS|1 |
||||
ECONOMY POLISHED STEEL|1 |
||||
ECONOMY POLISHED COPPER|1 |
||||
ECONOMY BRUSHED TIN|1 |
||||
ECONOMY BRUSHED NICKEL|1 |
||||
ECONOMY BRUSHED BRASS|1 |
||||
ECONOMY BRUSHED STEEL|1 |
||||
ECONOMY BRUSHED COPPER|1 |
||||
PROMO ANODIZED TIN|1 |
||||
PROMO ANODIZED NICKEL|1 |
||||
PROMO ANODIZED BRASS|1 |
||||
PROMO ANODIZED STEEL|1 |
||||
PROMO ANODIZED COPPER|1 |
||||
PROMO BURNISHED TIN|1 |
||||
PROMO BURNISHED NICKEL|1 |
||||
PROMO BURNISHED BRASS|1 |
||||
PROMO BURNISHED STEEL|1 |
||||
PROMO BURNISHED COPPER|1 |
||||
PROMO PLATED TIN|1 |
||||
PROMO PLATED NICKEL|1 |
||||
PROMO PLATED BRASS|1 |
||||
PROMO PLATED STEEL|1 |
||||
PROMO PLATED COPPER|1 |
||||
PROMO POLISHED TIN|1 |
||||
PROMO POLISHED NICKEL|1 |
||||
PROMO POLISHED BRASS|1 |
||||
PROMO POLISHED STEEL|1 |
||||
PROMO POLISHED COPPER|1 |
||||
PROMO BRUSHED TIN|1 |
||||
PROMO BRUSHED NICKEL|1 |
||||
PROMO BRUSHED BRASS|1 |
||||
PROMO BRUSHED STEEL|1 |
||||
PROMO BRUSHED COPPER|1 |
||||
end p_types |
||||
### |
||||
# colors |
||||
# NOTE: This distribution CANNOT be used by pick_str(), since agg_str() perturbs its order |
||||
### |
||||
begin colors |
||||
COUNT|92 |
||||
almond|1 |
||||
antique|1 |
||||
aquamarine|1 |
||||
azure|1 |
||||
beige|1 |
||||
bisque|1 |
||||
black|1 |
||||
blanched|1 |
||||
blue|1 |
||||
blush|1 |
||||
brown|1 |
||||
burlywood|1 |
||||
burnished|1 |
||||
chartreuse|1 |
||||
chiffon|1 |
||||
chocolate|1 |
||||
coral|1 |
||||
cornflower|1 |
||||
cornsilk|1 |
||||
cream|1 |
||||
cyan|1 |
||||
dark|1 |
||||
deep|1 |
||||
dim|1 |
||||
dodger|1 |
||||
drab|1 |
||||
firebrick|1 |
||||
floral|1 |
||||
forest|1 |
||||
frosted|1 |
||||
gainsboro|1 |
||||
ghost|1 |
||||
goldenrod|1 |
||||
green|1 |
||||
grey|1 |
||||
honeydew|1 |
||||
hot|1 |
||||
indian|1 |
||||
ivory|1 |
||||
khaki|1 |
||||
lace|1 |
||||
lavender|1 |
||||
lawn|1 |
||||
lemon|1 |
||||
light|1 |
||||
lime|1 |
||||
linen|1 |
||||
magenta|1 |
||||
maroon|1 |
||||
medium|1 |
||||
metallic|1 |
||||
midnight|1 |
||||
mint|1 |
||||
misty|1 |
||||
moccasin|1 |
||||
navajo|1 |
||||
navy|1 |
||||
olive|1 |
||||
orange|1 |
||||
orchid|1 |
||||
pale|1 |
||||
papaya|1 |
||||
peach|1 |
||||
peru|1 |
||||
pink|1 |
||||
plum|1 |
||||
powder|1 |
||||
puff|1 |
||||
purple|1 |
||||
red|1 |
||||
rose|1 |
||||
rosy|1 |
||||
royal|1 |
||||
saddle|1 |
||||
salmon|1 |
||||
sandy|1 |
||||
seashell|1 |
||||
sienna|1 |
||||
sky|1 |
||||
slate|1 |
||||
smoke|1 |
||||
snow|1 |
||||
spring|1 |
||||
steel|1 |
||||
tan|1 |
||||
thistle|1 |
||||
tomato|1 |
||||
turquoise|1 |
||||
violet|1 |
||||
wheat|1 |
||||
white|1 |
||||
yellow|1 |
||||
end colors |
||||
################ |
||||
################ |
||||
## psuedo text distributions |
||||
################ |
||||
################ |
||||
### |
||||
# nouns |
||||
### |
||||
BEGIN nouns |
||||
COUNT|45 |
||||
packages|40 |
||||
requests|40 |
||||
accounts|40 |
||||
deposits|40 |
||||
foxes|20 |
||||
ideas|20 |
||||
theodolites|20 |
||||
pinto beans|20 |
||||
instructions|20 |
||||
dependencies|10 |
||||
excuses|10 |
||||
platelets|10 |
||||
asymptotes|10 |
||||
courts|5 |
||||
dolphins|5 |
||||
multipliers|1 |
||||
sauternes|1 |
||||
warthogs|1 |
||||
frets|1 |
||||
dinos|1 |
||||
attainments|1 |
||||
somas|1 |
||||
Tiresias|1 |
||||
patterns|1 |
||||
forges|1 |
||||
braids|1 |
||||
frays|1 |
||||
warhorses|1 |
||||
dugouts|1 |
||||
notornis|1 |
||||
epitaphs|1 |
||||
pearls|1 |
||||
tithes|1 |
||||
waters|1 |
||||
orbits|1 |
||||
gifts|1 |
||||
sheaves|1 |
||||
depths|1 |
||||
sentiments|1 |
||||
decoys|1 |
||||
realms|1 |
||||
pains|1 |
||||
grouches|1 |
||||
escapades|1 |
||||
hockey players|1 |
||||
END nouns |
||||
### |
||||
# verbs |
||||
### |
||||
BEGIN verbs |
||||
COUNT|40 |
||||
sleep|20 |
||||
wake|20 |
||||
are|20 |
||||
cajole|20 |
||||
haggle|20 |
||||
nag|10 |
||||
use|10 |
||||
boost|10 |
||||
affix|5 |
||||
detect|5 |
||||
integrate|5 |
||||
maintain|1 |
||||
nod|1 |
||||
was|1 |
||||
lose|1 |
||||
sublate|1 |
||||
solve|1 |
||||
thrash|1 |
||||
promise|1 |
||||
engage|1 |
||||
hinder|1 |
||||
print|1 |
||||
x-ray|1 |
||||
breach|1 |
||||
eat|1 |
||||
grow|1 |
||||
impress|1 |
||||
mold|1 |
||||
poach|1 |
||||
serve|1 |
||||
run|1 |
||||
dazzle|1 |
||||
snooze|1 |
||||
doze|1 |
||||
unwind|1 |
||||
kindle|1 |
||||
play|1 |
||||
hang|1 |
||||
believe|1 |
||||
doubt|1 |
||||
END verbs |
||||
### |
||||
# adverbs |
||||
## |
||||
BEGIN adverbs |
||||
COUNT|28 |
||||
sometimes|1 |
||||
always|1 |
||||
never|1 |
||||
furiously|50 |
||||
slyly|50 |
||||
carefully|50 |
||||
blithely|40 |
||||
quickly|30 |
||||
fluffily|20 |
||||
slowly|1 |
||||
quietly|1 |
||||
ruthlessly|1 |
||||
thinly|1 |
||||
closely|1 |
||||
doggedly|1 |
||||
daringly|1 |
||||
bravely|1 |
||||
stealthily|1 |
||||
permanently|1 |
||||
enticingly|1 |
||||
idly|1 |
||||
busily|1 |
||||
regularly|1 |
||||
finally|1 |
||||
ironically|1 |
||||
evenly|1 |
||||
boldly|1 |
||||
silently|1 |
||||
END adverbs |
||||
### |
||||
# articles |
||||
## |
||||
BEGIN articles |
||||
COUNT|3 |
||||
the|50 |
||||
a|20 |
||||
an|5 |
||||
END articles |
||||
### |
||||
# prepositions |
||||
## |
||||
BEGIN prepositions |
||||
COUNT|47 |
||||
about|50 |
||||
above|50 |
||||
according to|50 |
||||
across|50 |
||||
after|50 |
||||
against|40 |
||||
along|40 |
||||
alongside of|30 |
||||
among|30 |
||||
around|20 |
||||
at|10 |
||||
atop|1 |
||||
before|1 |
||||
behind|1 |
||||
beneath|1 |
||||
beside|1 |
||||
besides|1 |
||||
between|1 |
||||
beyond|1 |
||||
by|1 |
||||
despite|1 |
||||
during|1 |
||||
except|1 |
||||
for|1 |
||||
from|1 |
||||
in place of|1 |
||||
inside|1 |
||||
instead of|1 |
||||
into|1 |
||||
near|1 |
||||
of|1 |
||||
on|1 |
||||
outside|1 |
||||
over|1 |
||||
past|1 |
||||
since|1 |
||||
through|1 |
||||
throughout|1 |
||||
to|1 |
||||
toward|1 |
||||
under|1 |
||||
until|1 |
||||
up|1 |
||||
upon|1 |
||||
whithout|1 |
||||
with|1 |
||||
within|1 |
||||
END prepositions |
||||
### |
||||
# auxillaries |
||||
## |
||||
BEGIN auxillaries |
||||
COUNT|18 |
||||
do|1 |
||||
may|1 |
||||
might|1 |
||||
shall|1 |
||||
will|1 |
||||
would|1 |
||||
can|1 |
||||
could|1 |
||||
should|1 |
||||
ought to|1 |
||||
must|1 |
||||
will have to|1 |
||||
shall have to|1 |
||||
could have to|1 |
||||
should have to|1 |
||||
must have to|1 |
||||
need to|1 |
||||
try to|1 |
||||
END auxiallaries |
||||
### |
||||
# terminators |
||||
## |
||||
BEGIN terminators |
||||
COUNT|6 |
||||
.|50 |
||||
;|1 |
||||
:|1 |
||||
?|1 |
||||
!|1 |
||||
--|1 |
||||
END terminators |
||||
### |
||||
# adjectives |
||||
## |
||||
BEGIN adjectives |
||||
COUNT|29 |
||||
special|20 |
||||
pending|20 |
||||
unusual|20 |
||||
express|20 |
||||
furious|1 |
||||
sly|1 |
||||
careful|1 |
||||
blithe|1 |
||||
quick|1 |
||||
fluffy|1 |
||||
slow|1 |
||||
quiet|1 |
||||
ruthless|1 |
||||
thin|1 |
||||
close|1 |
||||
dogged|1 |
||||
daring|1 |
||||
brave|1 |
||||
stealthy|1 |
||||
permanent|1 |
||||
enticing|1 |
||||
idle|1 |
||||
busy|1 |
||||
regular|50 |
||||
final|40 |
||||
ironic|40 |
||||
even|30 |
||||
bold|20 |
||||
silent|10 |
||||
END adjectives |
||||
### |
||||
# grammar |
||||
# first level grammar. N=noun phrase, V=verb phrase, |
||||
# P=prepositional phrase, T=setence termination |
||||
## |
||||
BEGIN grammar |
||||
COUNT|5 |
||||
N V T|3 |
||||
N V P T|3 |
||||
N V N T|3 |
||||
N P V N T|1 |
||||
N P V P T|1 |
||||
END grammar |
||||
### |
||||
# NP |
||||
# second level grammar. Noun phrases. N=noun, A=article, |
||||
# J=adjective, D=adverb |
||||
## |
||||
BEGIN np |
||||
COUNT|4 |
||||
N|10 |
||||
J N|20 |
||||
J, J N|10 |
||||
D J N|50 |
||||
END np |
||||
### |
||||
# VP |
||||
# second level grammar. Verb phrases. V=verb, X=auxiallary, |
||||
# D=adverb |
||||
## |
||||
BEGIN vp |
||||
COUNT|4 |
||||
V|30 |
||||
X V|1 |
||||
V D|40 |
||||
X V D|1 |
||||
END vp |
||||
### |
||||
# Q13 |
||||
# Substitution parameters for Q13 |
||||
## |
||||
BEGIN Q13a |
||||
COUNT|4 |
||||
special|20 |
||||
pending|20 |
||||
unusual|20 |
||||
express|20 |
||||
END Q13a |
||||
BEGIN Q13b |
||||
COUNT|4 |
||||
packages|40 |
||||
requests|40 |
||||
accounts|40 |
||||
deposits|40 |
||||
END Q13b |
@ -0,0 +1,800 @@ |
||||
/*
|
||||
* $Id: driver.c,v 1.7 2008/09/24 22:35:21 jms Exp $ |
||||
* |
||||
* Revision History |
||||
* =================== |
||||
* $Log: driver.c,v $ |
||||
* Revision 1.7 2008/09/24 22:35:21 jms |
||||
* remove build number header |
||||
* |
||||
* Revision 1.6 2008/09/24 22:30:29 jms |
||||
* remove build number from default header |
||||
* |
||||
* Revision 1.5 2008/03/21 17:38:39 jms |
||||
* changes for 2.6.3 |
||||
* |
||||
* Revision 1.4 2006/04/26 23:01:10 jms |
||||
* address update generation problems |
||||
* |
||||
* Revision 1.3 2005/10/28 02:54:35 jms |
||||
* add release.h changes |
||||
* |
||||
* Revision 1.2 2005/01/03 20:08:58 jms |
||||
* change line terminations |
||||
* |
||||
* Revision 1.1.1.1 2004/11/24 23:31:46 jms |
||||
* re-establish external server |
||||
* |
||||
* Revision 1.5 2004/04/07 20:17:29 jms |
||||
* bug #58 (join fails between order/lineitem) |
||||
* |
||||
* Revision 1.4 2004/02/18 16:26:49 jms |
||||
* 32/64 bit changes for overflow handling needed additional changes when ported back to windows |
||||
* |
||||
* Revision 1.3 2004/01/22 05:49:29 jms |
||||
* AIX porting (AIX 5.1) |
||||
* |
||||
* Revision 1.2 2004/01/22 03:54:12 jms |
||||
* 64 bit support changes for customer address |
||||
* |
||||
* Revision 1.1.1.1 2003/08/08 21:50:33 jms |
||||
* recreation after CVS crash |
||||
* |
||||
* Revision 1.3 2003/08/08 21:35:26 jms |
||||
* first integration of rng64 for o_custkey and l_partkey |
||||
* |
||||
* Revision 1.2 2003/08/07 17:58:34 jms |
||||
* Convery RNG to 64bit space as preparation for new large scale RNG |
||||
* |
||||
* Revision 1.1.1.1 2003/04/03 18:54:21 jms |
||||
* initial checkin |
||||
* |
||||
* |
||||
*/ |
||||
/* main driver for dss banchmark */ |
||||
|
||||
#define DECLARER /* EXTERN references get defined here */ |
||||
#define NO_FUNC (int (*) ()) NULL /* to clean up tdefs */ |
||||
#define NO_LFUNC (long (*) ()) NULL /* to clean up tdefs */ |
||||
|
||||
#include "config.h" |
||||
#include "release.h" |
||||
#include <stdlib.h> |
||||
#if (defined(_POSIX_)||!defined(WIN32)) /* Change for Windows NT */ |
||||
#include <unistd.h> |
||||
#include <sys/wait.h> |
||||
#endif /* WIN32 */ |
||||
#include <stdio.h> /* */ |
||||
#include <limits.h> |
||||
#include <math.h> |
||||
#include <ctype.h> |
||||
#include <signal.h> |
||||
#include <string.h> |
||||
#include <errno.h> |
||||
#ifdef HP |
||||
#include <strings.h> |
||||
#endif |
||||
#if (defined(WIN32)&&!defined(_POSIX_)) |
||||
#include <process.h> |
||||
#pragma warning(disable:4201) |
||||
#pragma warning(disable:4214) |
||||
#pragma warning(disable:4514) |
||||
#define WIN32_LEAN_AND_MEAN |
||||
#define NOATOM |
||||
#define NOGDICAPMASKS |
||||
#define NOMETAFILE |
||||
#define NOMINMAX |
||||
#define NOMSG |
||||
#define NOOPENFILE |
||||
#define NORASTEROPS |
||||
#define NOSCROLL |
||||
#define NOSOUND |
||||
#define NOSYSMETRICS |
||||
#define NOTEXTMETRIC |
||||
#define NOWH |
||||
#define NOCOMM |
||||
#define NOKANJI |
||||
#define NOMCX |
||||
#include <windows.h> |
||||
#pragma warning(default:4201) |
||||
#pragma warning(default:4214) |
||||
#endif |
||||
|
||||
#include "dss.h" |
||||
#include "dsstypes.h" |
||||
|
||||
/*
|
||||
* Function prototypes |
||||
*/ |
||||
void usage (void); |
||||
void kill_load (void); |
||||
int pload (int tbl); |
||||
void gen_tbl (int tnum, DSS_HUGE start, DSS_HUGE count, long upd_num); |
||||
int pr_drange (int tbl, DSS_HUGE min, DSS_HUGE cnt, long num); |
||||
int set_files (int t, int pload); |
||||
int partial (int, int); |
||||
|
||||
|
||||
extern int optind, opterr; |
||||
extern char *optarg; |
||||
DSS_HUGE rowcnt = 0, minrow = 0; |
||||
long upd_num = 0; |
||||
double flt_scale; |
||||
#if (defined(WIN32)&&!defined(_POSIX_)) |
||||
char *spawn_args[25]; |
||||
#endif |
||||
#ifdef RNG_TEST |
||||
extern seed_t Seed[]; |
||||
#endif |
||||
static int bTableSet = 0; |
||||
|
||||
|
||||
/*
|
||||
* general table descriptions. See dss.h for details on structure |
||||
* NOTE: tables with no scaling info are scaled according to |
||||
* another table |
||||
* |
||||
* |
||||
* the following is based on the tdef structure defined in dss.h as: |
||||
* typedef struct |
||||
* { |
||||
* char *name; -- name of the table;
|
||||
* flat file output in <name>.tbl |
||||
* long base; -- base scale rowcount of table;
|
||||
* 0 if derived |
||||
* int (*loader) (); -- function to present output |
||||
* long (*gen_seed) (); -- functions to seed the RNG |
||||
* int child; -- non-zero if there is an associated detail table |
||||
* unsigned long vtotal; -- "checksum" total
|
||||
* } tdef; |
||||
* |
||||
*/ |
||||
|
||||
/*
|
||||
* flat file print functions; used with -F(lat) option |
||||
*/ |
||||
int pr_cust (customer_t * c, int mode); |
||||
int pr_line (order_t * o, int mode); |
||||
int pr_order (order_t * o, int mode); |
||||
int pr_part (part_t * p, int mode); |
||||
int pr_psupp (part_t * p, int mode); |
||||
int pr_supp (supplier_t * s, int mode); |
||||
int pr_order_line (order_t * o, int mode); |
||||
int pr_part_psupp (part_t * p, int mode); |
||||
int pr_nation (code_t * c, int mode); |
||||
int pr_region (code_t * c, int mode); |
||||
|
||||
/*
|
||||
* seed generation functions; used with '-O s' option |
||||
*/ |
||||
long sd_cust (int child, DSS_HUGE skip_count); |
||||
long sd_line (int child, DSS_HUGE skip_count); |
||||
long sd_order (int child, DSS_HUGE skip_count); |
||||
long sd_part (int child, DSS_HUGE skip_count); |
||||
long sd_psupp (int child, DSS_HUGE skip_count); |
||||
long sd_supp (int child, DSS_HUGE skip_count); |
||||
long sd_order_line (int child, DSS_HUGE skip_count); |
||||
long sd_part_psupp (int child, DSS_HUGE skip_count); |
||||
|
||||
tdef tdefs[] = |
||||
{ |
||||
{"part.tbl", "part table", 200000, |
||||
pr_part, sd_part, PSUPP, 0}, |
||||
{"partsupp.tbl", "partsupplier table", 200000, |
||||
pr_psupp, sd_psupp, NONE, 0}, |
||||
{"supplier.tbl", "suppliers table", 10000, |
||||
pr_supp, sd_supp, NONE, 0}, |
||||
{"customer.tbl", "customers table", 150000, |
||||
pr_cust, sd_cust, NONE, 0}, |
||||
{"orders.tbl", "order table", 150000, |
||||
pr_order, sd_order, LINE, 0}, |
||||
{"lineitem.tbl", "lineitem table", 150000, |
||||
pr_line, sd_line, NONE, 0}, |
||||
{"orders.tbl", "orders/lineitem tables", 150000, |
||||
pr_order_line, sd_order, LINE, 0}, |
||||
{"part.tbl", "part/partsupplier tables", 200000, |
||||
pr_part_psupp, sd_part, PSUPP, 0}, |
||||
{"nation.tbl", "nation table", NATIONS_MAX, |
||||
pr_nation, NO_LFUNC, NONE, 0}, |
||||
{"region.tbl", "region table", NATIONS_MAX, |
||||
pr_region, NO_LFUNC, NONE, 0}, |
||||
}; |
||||
|
||||
/*
|
||||
* re-set default output file names
|
||||
*/ |
||||
int |
||||
set_files (int i, int pload) |
||||
{ |
||||
char line[80], *new_name; |
||||
|
||||
if (table & (1 << i)) |
||||
child_table: |
||||
{ |
||||
if (pload != -1) |
||||
sprintf (line, "%s.%d", tdefs[i].name, pload); |
||||
else |
||||
{ |
||||
printf ("Enter new destination for %s data: ", |
||||
tdefs[i].name); |
||||
if (fgets (line, sizeof (line), stdin) == NULL) |
||||
return (-1);; |
||||
if ((new_name = strchr (line, '\n')) != NULL) |
||||
*new_name = '\0'; |
||||
if ((int)strlen (line) == 0) |
||||
return (0); |
||||
} |
||||
new_name = (char *) malloc ((int)strlen (line) + 1); |
||||
MALLOC_CHECK (new_name); |
||||
strcpy (new_name, line); |
||||
tdefs[i].name = new_name; |
||||
if (tdefs[i].child != NONE) |
||||
{ |
||||
i = tdefs[i].child; |
||||
tdefs[i].child = NONE; |
||||
goto child_table; |
||||
} |
||||
} |
||||
|
||||
return (0); |
||||
} |
||||
|
||||
|
||||
|
||||
/*
|
||||
* read the distributions needed in the benchamrk |
||||
*/ |
||||
void |
||||
load_dists (void) |
||||
{ |
||||
read_dist (env_config (DIST_TAG, DIST_DFLT), "p_cntr", &p_cntr_set); |
||||
read_dist (env_config (DIST_TAG, DIST_DFLT), "colors", &colors); |
||||
read_dist (env_config (DIST_TAG, DIST_DFLT), "p_types", &p_types_set); |
||||
read_dist (env_config (DIST_TAG, DIST_DFLT), "nations", &nations); |
||||
read_dist (env_config (DIST_TAG, DIST_DFLT), "regions", ®ions); |
||||
read_dist (env_config (DIST_TAG, DIST_DFLT), "o_oprio", |
||||
&o_priority_set); |
||||
read_dist (env_config (DIST_TAG, DIST_DFLT), "instruct", |
||||
&l_instruct_set); |
||||
read_dist (env_config (DIST_TAG, DIST_DFLT), "smode", &l_smode_set); |
||||
read_dist (env_config (DIST_TAG, DIST_DFLT), "category", |
||||
&l_category_set); |
||||
read_dist (env_config (DIST_TAG, DIST_DFLT), "rflag", &l_rflag_set); |
||||
read_dist (env_config (DIST_TAG, DIST_DFLT), "msegmnt", &c_mseg_set); |
||||
|
||||
/* load the distributions that contain text generation */ |
||||
read_dist (env_config (DIST_TAG, DIST_DFLT), "nouns", &nouns); |
||||
read_dist (env_config (DIST_TAG, DIST_DFLT), "verbs", &verbs); |
||||
read_dist (env_config (DIST_TAG, DIST_DFLT), "adjectives", &adjectives); |
||||
read_dist (env_config (DIST_TAG, DIST_DFLT), "adverbs", &adverbs); |
||||
read_dist (env_config (DIST_TAG, DIST_DFLT), "auxillaries", &auxillaries); |
||||
read_dist (env_config (DIST_TAG, DIST_DFLT), "terminators", &terminators); |
||||
read_dist (env_config (DIST_TAG, DIST_DFLT), "articles", &articles); |
||||
read_dist (env_config (DIST_TAG, DIST_DFLT), "prepositions", &prepositions); |
||||
read_dist (env_config (DIST_TAG, DIST_DFLT), "grammar", &grammar); |
||||
read_dist (env_config (DIST_TAG, DIST_DFLT), "np", &np); |
||||
read_dist (env_config (DIST_TAG, DIST_DFLT), "vp", &vp); |
||||
|
||||
} |
||||
|
||||
/*
|
||||
* generate a particular table |
||||
*/ |
||||
void |
||||
gen_tbl (int tnum, DSS_HUGE start, DSS_HUGE count, long upd_num) |
||||
{ |
||||
static order_t o; |
||||
supplier_t supp; |
||||
customer_t cust; |
||||
part_t part; |
||||
code_t code; |
||||
static int completed = 0; |
||||
DSS_HUGE i; |
||||
|
||||
DSS_HUGE rows_per_segment=0; |
||||
DSS_HUGE rows_this_segment=-1; |
||||
DSS_HUGE residual_rows=0; |
||||
|
||||
if (insert_segments) |
||||
{ |
||||
rows_per_segment = count / insert_segments; |
||||
residual_rows = count - (rows_per_segment * insert_segments); |
||||
} |
||||
|
||||
for (i = start; count; count--, i++) |
||||
{ |
||||
LIFENOISE (1000, i); |
||||
row_start(tnum); |
||||
|
||||
switch (tnum) |
||||
{ |
||||
case LINE: |
||||
case ORDER: |
||||
case ORDER_LINE:
|
||||
mk_order (i, &o, upd_num % 10000); |
||||
|
||||
if (insert_segments && (upd_num > 0)) |
||||
if((upd_num / 10000) < residual_rows) |
||||
{ |
||||
if((++rows_this_segment) > rows_per_segment)
|
||||
{
|
||||
rows_this_segment=0; |
||||
upd_num += 10000;
|
||||
} |
||||
} |
||||
else |
||||
{ |
||||
if((++rows_this_segment) >= rows_per_segment)
|
||||
{ |
||||
rows_this_segment=0; |
||||
upd_num += 10000; |
||||
} |
||||
} |
||||
|
||||
if (set_seeds == 0) |
||||
tdefs[tnum].loader(&o, upd_num); |
||||
break; |
||||
case SUPP: |
||||
mk_supp (i, &supp); |
||||
if (set_seeds == 0) |
||||
tdefs[tnum].loader(&supp, upd_num); |
||||
break; |
||||
case CUST: |
||||
mk_cust (i, &cust); |
||||
if (set_seeds == 0) |
||||
tdefs[tnum].loader(&cust, upd_num); |
||||
break; |
||||
case PSUPP: |
||||
case PART: |
||||
case PART_PSUPP:
|
||||
mk_part (i, &part); |
||||
if (set_seeds == 0) |
||||
tdefs[tnum].loader(&part, upd_num); |
||||
break; |
||||
case NATION: |
||||
mk_nation (i, &code); |
||||
if (set_seeds == 0) |
||||
tdefs[tnum].loader(&code, 0); |
||||
break; |
||||
case REGION: |
||||
mk_region (i, &code); |
||||
if (set_seeds == 0) |
||||
tdefs[tnum].loader(&code, 0); |
||||
break; |
||||
} |
||||
row_stop(tnum); |
||||
if (set_seeds && (i % tdefs[tnum].base) < 2) |
||||
{ |
||||
printf("\nSeeds for %s at rowcount %ld\n", tdefs[tnum].comment, i); |
||||
dump_seeds(tnum); |
||||
} |
||||
} |
||||
completed |= 1 << tnum; |
||||
} |
||||
|
||||
|
||||
|
||||
void |
||||
usage (void) |
||||
{ |
||||
fprintf (stderr, "%s\n%s\n\t%s\n%s %s\n\n", |
||||
"USAGE:", |
||||
"dbgen [-{vf}][-T {pcsoPSOL}]", |
||||
"[-s <scale>][-C <procs>][-S <step>]", |
||||
"dbgen [-v] [-O m] [-s <scale>]", |
||||
"[-U <updates>]"); |
||||
fprintf (stderr, "Basic Options\n===========================\n"); |
||||
fprintf (stderr, "-C <n> -- separate data set into <n> chunks (requires -S, default: 1)\n"); |
||||
fprintf (stderr, "-f -- force. Overwrite existing files\n"); |
||||
fprintf (stderr, "-h -- display this message\n"); |
||||
fprintf (stderr, "-q -- enable QUIET mode\n"); |
||||
fprintf (stderr, "-s <n> -- set Scale Factor (SF) to <n> (default: 1) \n"); |
||||
fprintf (stderr, "-S <n> -- build the <n>th step of the data/update set (used with -C or -U)\n"); |
||||
fprintf (stderr, "-U <n> -- generate <n> update sets\n"); |
||||
fprintf (stderr, "-v -- enable VERBOSE mode\n"); |
||||
fprintf (stderr, "\nAdvanced Options\n===========================\n"); |
||||
fprintf (stderr, "-b <s> -- load distributions for <s> (default: dists.dss)\n"); |
||||
fprintf (stderr, "-d <n> -- split deletes between <n> files (requires -U)\n"); |
||||
fprintf (stderr, "-i <n> -- split inserts between <n> files (requires -U)\n"); |
||||
fprintf (stderr, "-T c -- generate cutomers ONLY\n"); |
||||
fprintf (stderr, "-T l -- generate nation/region ONLY\n"); |
||||
fprintf (stderr, "-T L -- generate lineitem ONLY\n"); |
||||
fprintf (stderr, "-T n -- generate nation ONLY\n"); |
||||
fprintf (stderr, "-T o -- generate orders/lineitem ONLY\n"); |
||||
fprintf (stderr, "-T O -- generate orders ONLY\n"); |
||||
fprintf (stderr, "-T p -- generate parts/partsupp ONLY\n"); |
||||
fprintf (stderr, "-T P -- generate parts ONLY\n"); |
||||
fprintf (stderr, "-T r -- generate region ONLY\n"); |
||||
fprintf (stderr, "-T s -- generate suppliers ONLY\n"); |
||||
fprintf (stderr, "-T S -- generate partsupp ONLY\n"); |
||||
fprintf (stderr, |
||||
"\nTo generate the SF=1 (1GB), validation database population, use:\n"); |
||||
fprintf (stderr, "\tdbgen -vf -s 1\n"); |
||||
fprintf (stderr, "\nTo generate updates for a SF=1 (1GB), use:\n"); |
||||
fprintf (stderr, "\tdbgen -v -U 1 -s 1\n"); |
||||
} |
||||
|
||||
/*
|
||||
* int partial(int tbl, int s) -- generate the s-th part of the named tables data |
||||
*/ |
||||
int |
||||
partial (int tbl, int s) |
||||
{ |
||||
DSS_HUGE rowcnt; |
||||
DSS_HUGE extra; |
||||
|
||||
if (verbose > 0) |
||||
{ |
||||
fprintf (stderr, "\tStarting to load stage %d of %d for %s...", |
||||
s, children, tdefs[tbl].comment); |
||||
} |
||||
|
||||
set_files (tbl, s); |
||||
|
||||
rowcnt = set_state(tbl, scale, children, s, &extra); |
||||
|
||||
if (s == children) |
||||
gen_tbl (tbl, rowcnt * (s - 1) + 1, rowcnt + extra, upd_num); |
||||
else |
||||
gen_tbl (tbl, rowcnt * (s - 1) + 1, rowcnt, upd_num); |
||||
|
||||
if (verbose > 0) |
||||
fprintf (stderr, "done.\n"); |
||||
|
||||
return (0); |
||||
} |
||||
|
||||
void |
||||
process_options (int count, char **vector) |
||||
{ |
||||
int option; |
||||
FILE *pF; |
||||
|
||||
while ((option = getopt (count, vector, |
||||
"b:C:d:fi:hO:P:qs:S:T:U:v")) != -1) |
||||
switch (option) |
||||
{ |
||||
case 'b': /* load distributions from named file */ |
||||
d_path = (char *)malloc((int)strlen(optarg) + 1); |
||||
MALLOC_CHECK(d_path); |
||||
strcpy(d_path, optarg); |
||||
if ((pF = fopen(d_path, "r")) == NULL) |
||||
{ |
||||
fprintf(stderr, "ERROR: Invalid argument to -b"); |
||||
exit(-1); |
||||
} |
||||
else |
||||
fclose(pF); |
||||
|
||||
break; |
||||
case 'C': |
||||
children = atoi (optarg); |
||||
break; |
||||
case 'd': |
||||
delete_segments = atoi (optarg); |
||||
break; |
||||
case 'f': /* blind overwrites; Force */ |
||||
force = 1; |
||||
break; |
||||
case 'i': |
||||
insert_segments = atoi (optarg); |
||||
break; |
||||
case 'q': /* all prompts disabled */ |
||||
verbose = -1; |
||||
break; |
||||
case 's': /* scale by Percentage of base rowcount */ |
||||
case 'P': /* for backward compatibility */ |
||||
flt_scale = atof (optarg); |
||||
if (flt_scale < MIN_SCALE) |
||||
{ |
||||
int i; |
||||
int int_scale; |
||||
|
||||
scale = 1; |
||||
int_scale = (int)(1000 * flt_scale); |
||||
for (i = PART; i < REGION; i++) |
||||
{ |
||||
tdefs[i].base = (DSS_HUGE)(int_scale * tdefs[i].base)/1000; |
||||
if (tdefs[i].base < 1) |
||||
tdefs[i].base = 1; |
||||
} |
||||
} |
||||
else |
||||
scale = (long) flt_scale; |
||||
if (scale > MAX_SCALE) |
||||
{ |
||||
fprintf (stderr, "%s %5.0f %s\n\t%s\n\n", |
||||
"NOTE: Data generation for scale factors >", |
||||
MAX_SCALE, |
||||
"GB is still in development,", |
||||
"and is not yet supported.\n"); |
||||
fprintf (stderr, |
||||
"Your resulting data set MAY NOT BE COMPLIANT!\n"); |
||||
} |
||||
break; |
||||
case 'S': /* generate a particular STEP */ |
||||
step = atoi (optarg); |
||||
break; |
||||
case 'U': /* generate flat files for update stream */ |
||||
updates = atoi (optarg); |
||||
break; |
||||
case 'v': /* life noises enabled */ |
||||
verbose = 1; |
||||
break; |
||||
case 'T': /* generate a specifc table */ |
||||
switch (*optarg) |
||||
{ |
||||
case 'c': /* generate customer ONLY */ |
||||
table = 1 << CUST; |
||||
bTableSet = 1; |
||||
break; |
||||
case 'L': /* generate lineitems ONLY */ |
||||
table = 1 << LINE; |
||||
bTableSet = 1; |
||||
break; |
||||
case 'l': /* generate code table ONLY */ |
||||
table = 1 << NATION; |
||||
table |= 1 << REGION; |
||||
bTableSet = 1; |
||||
break; |
||||
case 'n': /* generate nation table ONLY */ |
||||
table = 1 << NATION; |
||||
bTableSet = 1; |
||||
break; |
||||
case 'O': /* generate orders ONLY */ |
||||
table = 1 << ORDER; |
||||
bTableSet = 1; |
||||
break; |
||||
case 'o': /* generate orders/lineitems ONLY */ |
||||
table = 1 << ORDER_LINE; |
||||
bTableSet = 1; |
||||
break; |
||||
case 'P': /* generate part ONLY */ |
||||
table = 1 << PART; |
||||
bTableSet = 1; |
||||
break; |
||||
case 'p': /* generate part/partsupp ONLY */ |
||||
table = 1 << PART_PSUPP; |
||||
bTableSet = 1; |
||||
break; |
||||
case 'r': /* generate region table ONLY */ |
||||
table = 1 << REGION; |
||||
bTableSet = 1; |
||||
break; |
||||
case 'S': /* generate partsupp ONLY */ |
||||
table = 1 << PSUPP; |
||||
bTableSet = 1; |
||||
break; |
||||
case 's': /* generate suppliers ONLY */ |
||||
table = 1 << SUPP; |
||||
bTableSet = 1; |
||||
break; |
||||
default: |
||||
fprintf (stderr, "Unknown table name %s\n", |
||||
optarg); |
||||
usage (); |
||||
exit (1); |
||||
} |
||||
break; |
||||
case 'O': /* optional actions */ |
||||
switch (tolower (*optarg)) |
||||
{ |
||||
case 's': /* calibrate the RNG usage */ |
||||
set_seeds = 1; |
||||
break; |
||||
default: |
||||
fprintf (stderr, "Unknown option name %s\n", |
||||
optarg); |
||||
usage (); |
||||
exit (1); |
||||
} |
||||
break; |
||||
default: |
||||
printf ("ERROR: option '%c' unknown.\n", |
||||
*(vector[optind] + 1)); |
||||
case 'h': /* something unexpected */ |
||||
fprintf (stderr, |
||||
"%s Population Generator (Version %d.%d.%d build %d)\n", |
||||
NAME, VERSION, RELEASE, PATCH, BUILD); |
||||
fprintf (stderr, "Copyright %s %s\n", TPC, C_DATES); |
||||
usage (); |
||||
exit (1); |
||||
} |
||||
|
||||
return; |
||||
} |
||||
|
||||
void validate_options(void) |
||||
{ |
||||
// DBGenOptions, 3.1
|
||||
if (children != 1) |
||||
{ |
||||
if (updates != 0) |
||||
{ |
||||
fprintf(stderr, "ERROR: -C is not valid when generating updates\n"); |
||||
exit(-1); |
||||
} |
||||
if (step == -1) |
||||
{ |
||||
fprintf(stderr, "ERROR: -S must be specified when generating data in multiple chunks\n"); |
||||
exit(-1); |
||||
} |
||||
} |
||||
|
||||
// DBGenOptions, 3.3
|
||||
if (updates == 0) |
||||
{ |
||||
if ((insert_segments != 0) || (delete_segments != 0)) |
||||
{ |
||||
fprintf(stderr, "ERROR: -d/-i are only valid when generating updates\n"); |
||||
exit(-1); |
||||
} |
||||
} |
||||
|
||||
// DBGenOptions, 3.9
|
||||
if (step != -1) |
||||
{ |
||||
if ((children == 1) && (updates == 0)) |
||||
{ |
||||
fprintf(stderr, "ERROR: -S is only valid when generating data in multiple chunks or generating updates\n"); |
||||
exit(-1); |
||||
} |
||||
} |
||||
|
||||
// DBGenOptions, 3.10
|
||||
if (bTableSet && (updates != 0)) |
||||
{ |
||||
fprintf(stderr, "ERROR: -T not valid when generating updates\n"); |
||||
exit(-1); |
||||
} |
||||
|
||||
return; |
||||
} |
||||
|
||||
|
||||
/*
|
||||
* MAIN |
||||
* |
||||
* assumes the existance of getopt() to clean up the command
|
||||
* line handling |
||||
*/ |
||||
int |
||||
main (int ac, char **av) |
||||
{ |
||||
DSS_HUGE i; |
||||
|
||||
table = (1 << CUST) | |
||||
(1 << SUPP) | |
||||
(1 << NATION) | |
||||
(1 << REGION) | |
||||
(1 << PART_PSUPP) | |
||||
(1 << ORDER_LINE); |
||||
force = 0; |
||||
insert_segments=0; |
||||
delete_segments=0; |
||||
insert_orders_segment=0; |
||||
insert_lineitem_segment=0; |
||||
delete_segment=0; |
||||
verbose = 0; |
||||
set_seeds = 0; |
||||
scale = 1; |
||||
flt_scale = 1.0; |
||||
updates = 0; |
||||
step = -1; |
||||
tdefs[ORDER].base *= |
||||
ORDERS_PER_CUST; /* have to do this after init */ |
||||
tdefs[LINE].base *= |
||||
ORDERS_PER_CUST; /* have to do this after init */ |
||||
tdefs[ORDER_LINE].base *= |
||||
ORDERS_PER_CUST; /* have to do this after init */ |
||||
children = 1; |
||||
d_path = NULL; |
||||
|
||||
#ifdef NO_SUPPORT |
||||
signal (SIGINT, exit); |
||||
#endif /* NO_SUPPORT */ |
||||
process_options (ac, av); |
||||
validate_options(); |
||||
#if (defined(WIN32)&&!defined(_POSIX_)) |
||||
for (i = 0; i < ac; i++) |
||||
{ |
||||
spawn_args[i] = malloc (((int)strlen (av[i]) + 1) * sizeof (char)); |
||||
MALLOC_CHECK (spawn_args[i]); |
||||
strcpy (spawn_args[i], av[i]); |
||||
} |
||||
spawn_args[ac] = NULL; |
||||
#endif |
||||
|
||||
if (verbose >= 0) |
||||
{ |
||||
fprintf (stderr, |
||||
"%s Population Generator (Version %d.%d.%d)\n", |
||||
NAME, VERSION, RELEASE, PATCH); |
||||
fprintf (stderr, "Copyright %s %s\n", TPC, C_DATES); |
||||
} |
||||
|
||||
load_dists (); |
||||
#ifdef RNG_TEST |
||||
for (i=0; i <= MAX_STREAM; i++) |
||||
Seed[i].nCalls = 0; |
||||
#endif |
||||
/* have to do this after init */ |
||||
tdefs[NATION].base = nations.count; |
||||
tdefs[REGION].base = regions.count; |
||||
|
||||
/*
|
||||
* updates are never parallelized
|
||||
*/ |
||||
if (updates) |
||||
{ |
||||
/*
|
||||
* set RNG to start generating rows beyond SF=scale |
||||
*/ |
||||
set_state (ORDER, scale, 100, 101, &i);
|
||||
rowcnt = (int)(tdefs[ORDER_LINE].base / 10000 * scale * UPD_PCT); |
||||
if (step > 0) |
||||
{ |
||||
/*
|
||||
* adjust RNG for any prior update generation |
||||
*/ |
||||
for (i=1; i < step; i++) |
||||
{ |
||||
sd_order(0, rowcnt); |
||||
sd_line(0, rowcnt); |
||||
} |
||||
upd_num = step - 1; |
||||
} |
||||
else |
||||
upd_num = 0; |
||||
|
||||
while (upd_num < updates) |
||||
{ |
||||
if (verbose > 0) |
||||
fprintf (stderr, |
||||
"Generating update pair #%d for %s", |
||||
upd_num + 1, tdefs[ORDER_LINE].comment); |
||||
insert_orders_segment=0; |
||||
insert_lineitem_segment=0; |
||||
delete_segment=0; |
||||
minrow = upd_num * rowcnt + 1; |
||||
gen_tbl (ORDER_LINE, minrow, rowcnt, upd_num + 1); |
||||
if (verbose > 0) |
||||
fprintf (stderr, "done.\n"); |
||||
pr_drange (ORDER_LINE, minrow, rowcnt, upd_num + 1); |
||||
upd_num++; |
||||
} |
||||
|
||||
exit (0); |
||||
} |
||||
|
||||
/**
|
||||
** actual data generation section starts here |
||||
**/ |
||||
|
||||
/*
|
||||
* traverse the tables, invoking the appropriate data generation routine for any to be built |
||||
*/ |
||||
for (i = PART; i <= REGION; i++) |
||||
if (table & (1 << i)) |
||||
{ |
||||
if (children > 1 && i < NATION) |
||||
{ |
||||
partial ((int)i, step); |
||||
} |
||||
else |
||||
{ |
||||
minrow = 1; |
||||
if (i < NATION) |
||||
rowcnt = tdefs[i].base * scale; |
||||
else |
||||
rowcnt = tdefs[i].base; |
||||
if (verbose > 0) |
||||
fprintf (stderr, "Generating data for %s", tdefs[i].comment); |
||||
gen_tbl ((int)i, minrow, rowcnt, upd_num); |
||||
if (verbose > 0) |
||||
fprintf (stderr, "done.\n"); |
||||
} |
||||
} |
||||
|
||||
return (0); |
||||
} |
Binary file not shown.
@ -0,0 +1,70 @@ |
||||
-- Sccsid: @(#)dss.ddl 2.1.8.1 |
||||
CREATE TABLE NATION ( N_NATIONKEY INTEGER NOT NULL, |
||||
N_NAME CHAR(25) NOT NULL, |
||||
N_REGIONKEY INTEGER NOT NULL, |
||||
N_COMMENT VARCHAR(152)); |
||||
|
||||
CREATE TABLE REGION ( R_REGIONKEY INTEGER NOT NULL, |
||||
R_NAME CHAR(25) NOT NULL, |
||||
R_COMMENT VARCHAR(152)); |
||||
|
||||
CREATE TABLE PART ( P_PARTKEY INTEGER NOT NULL, |
||||
P_NAME VARCHAR(55) NOT NULL, |
||||
P_MFGR CHAR(25) NOT NULL, |
||||
P_BRAND CHAR(10) NOT NULL, |
||||
P_TYPE VARCHAR(25) NOT NULL, |
||||
P_SIZE INTEGER NOT NULL, |
||||
P_CONTAINER CHAR(10) NOT NULL, |
||||
P_RETAILPRICE DECIMAL(15,2) NOT NULL, |
||||
P_COMMENT VARCHAR(23) NOT NULL ); |
||||
|
||||
CREATE TABLE SUPPLIER ( S_SUPPKEY INTEGER NOT NULL, |
||||
S_NAME CHAR(25) NOT NULL, |
||||
S_ADDRESS VARCHAR(40) NOT NULL, |
||||
S_NATIONKEY INTEGER NOT NULL, |
||||
S_PHONE CHAR(15) NOT NULL, |
||||
S_ACCTBAL DECIMAL(15,2) NOT NULL, |
||||
S_COMMENT VARCHAR(101) NOT NULL); |
||||
|
||||
CREATE TABLE PARTSUPP ( PS_PARTKEY INTEGER NOT NULL, |
||||
PS_SUPPKEY INTEGER NOT NULL, |
||||
PS_AVAILQTY INTEGER NOT NULL, |
||||
PS_SUPPLYCOST DECIMAL(15,2) NOT NULL, |
||||
PS_COMMENT VARCHAR(199) NOT NULL ); |
||||
|
||||
CREATE TABLE CUSTOMER ( C_CUSTKEY INTEGER NOT NULL, |
||||
C_NAME VARCHAR(25) NOT NULL, |
||||
C_ADDRESS VARCHAR(40) NOT NULL, |
||||
C_NATIONKEY INTEGER NOT NULL, |
||||
C_PHONE CHAR(15) NOT NULL, |
||||
C_ACCTBAL DECIMAL(15,2) NOT NULL, |
||||
C_MKTSEGMENT CHAR(10) NOT NULL, |
||||
C_COMMENT VARCHAR(117) NOT NULL); |
||||
|
||||
CREATE TABLE ORDERS ( O_ORDERKEY INTEGER NOT NULL, |
||||
O_CUSTKEY INTEGER NOT NULL, |
||||
O_ORDERSTATUS CHAR(1) NOT NULL, |
||||
O_TOTALPRICE DECIMAL(15,2) NOT NULL, |
||||
O_ORDERDATE DATE NOT NULL, |
||||
O_ORDERPRIORITY CHAR(15) NOT NULL, |
||||
O_CLERK CHAR(15) NOT NULL, |
||||
O_SHIPPRIORITY INTEGER NOT NULL, |
||||
O_COMMENT VARCHAR(79) NOT NULL); |
||||
|
||||
CREATE TABLE LINEITEM ( L_ORDERKEY INTEGER NOT NULL, |
||||
L_PARTKEY INTEGER NOT NULL, |
||||
L_SUPPKEY INTEGER NOT NULL, |
||||
L_LINENUMBER INTEGER NOT NULL, |
||||
L_QUANTITY DECIMAL(15,2) NOT NULL, |
||||
L_EXTENDEDPRICE DECIMAL(15,2) NOT NULL, |
||||
L_DISCOUNT DECIMAL(15,2) NOT NULL, |
||||
L_TAX DECIMAL(15,2) NOT NULL, |
||||
L_RETURNFLAG CHAR(1) NOT NULL, |
||||
L_LINESTATUS CHAR(1) NOT NULL, |
||||
L_SHIPDATE DATE NOT NULL, |
||||
L_COMMITDATE DATE NOT NULL, |
||||
L_RECEIPTDATE DATE NOT NULL, |
||||
L_SHIPINSTRUCT CHAR(25) NOT NULL, |
||||
L_SHIPMODE CHAR(10) NOT NULL, |
||||
L_COMMENT VARCHAR(44) NOT NULL); |
||||
|
@ -0,0 +1,549 @@ |
||||
/*
|
||||
* $Id: dss.h,v 1.10 2008/03/21 18:07:13 jms Exp $ |
||||
* |
||||
* Revision History |
||||
* =================== |
||||
* $Log: dss.h,v $ |
||||
* Revision 1.10 2008/03/21 18:07:13 jms |
||||
* update copyright date |
||||
* |
||||
* Revision 1.9 2006/07/31 17:23:09 jms |
||||
* fix to parallelism problem |
||||
* |
||||
* Revision 1.8 2006/03/09 18:55:29 jms |
||||
* remove vestigial cvs merge marker |
||||
* |
||||
* Revision 1.7 2005/10/28 03:05:05 jms |
||||
* up maximum scale to 100TB |
||||
* |
||||
* Revision 1.6 2005/10/28 02:55:26 jms |
||||
* add release.h changes |
||||
* |
||||
* Revision 1.5 2005/10/27 18:13:03 jms |
||||
* a_rnd() prototype correction |
||||
* |
||||
* Revision 1.4 2005/10/25 17:58:59 jms |
||||
* update version stamp |
||||
* |
||||
* Revision 1.3 2005/03/04 19:48:39 jms |
||||
* Changes from Doug Johnson to address very large scale factors |
||||
* |
||||
* Revision 1.2 2005/01/03 20:08:58 jms |
||||
* change line terminations |
||||
* |
||||
* Revision 1.1.1.1 2004/11/24 23:31:46 jms |
||||
* re-establish external server |
||||
* |
||||
* Revision 1.5 2004/04/08 17:34:15 jms |
||||
* cleanup SOLARIS/SUN ifdefs; now all use SUN |
||||
* |
||||
* Revision 1.4 2004/04/07 20:17:29 jms |
||||
* bug #58 (join fails between order/lineitem) |
||||
* |
||||
* Revision 1.3 2004/03/16 14:37:53 jms |
||||
* update version and copyright date; correct comment typo |
||||
* |
||||
* Revision 1.2 2004/02/18 14:07:20 jms |
||||
* change to version 2.1.0 |
||||
* |
||||
* Revision 1.1.1.1 2003/08/08 21:50:33 jms |
||||
* recreation after CVS crash |
||||
* |
||||
* Revision 1.3 2003/08/08 21:35:26 jms |
||||
* first integration of rng64 for o_custkey and l_partkey |
||||
* |
||||
* Revision 1.2 2003/08/07 17:58:34 jms |
||||
* Convery RNG to 64bit space as preparation for new large scale RNG |
||||
* |
||||
* Revision 1.1.1.1 2003/04/03 18:54:21 jms |
||||
* initial checkin |
||||
* |
||||
* |
||||
*/ |
||||
/*
|
||||
* general definitions and control information for the DSS code
|
||||
* generator; if it controls the data set, it's here |
||||
*/ |
||||
#ifndef DSS_H |
||||
#define DSS_H |
||||
#ifdef TPCH |
||||
#define NAME "TPC-H" |
||||
#endif |
||||
#ifdef TPCR |
||||
#define NAME "TPC-R" |
||||
#endif |
||||
#ifndef NAME |
||||
#error Benchmark version must be defined in config.h |
||||
#endif |
||||
#define TPC "Transaction Processing Performance Council" |
||||
#define C_DATES "1994 - 2010" |
||||
|
||||
#include "config.h" |
||||
#include "shared.h" |
||||
|
||||
#include <stdio.h> |
||||
#include <stdlib.h> |
||||
|
||||
#define NONE -1 |
||||
#define PART 0 |
||||
#define PSUPP 1 |
||||
#define SUPP 2 |
||||
#define CUST 3 |
||||
#define ORDER 4 |
||||
#define LINE 5 |
||||
#define ORDER_LINE 6 |
||||
#define PART_PSUPP 7 |
||||
#define NATION 8 |
||||
#define REGION 9 |
||||
#define UPDATE 10 |
||||
#define MAX_TABLE 11 |
||||
#define ONE_STREAM 1 |
||||
#define ADD_AT_END 2 |
||||
|
||||
#ifdef MAX |
||||
#undef MAX |
||||
#endif |
||||
#ifdef MIN |
||||
#undef MIN |
||||
#endif |
||||
#define MAX(a,b) ((a > b )?a:b) |
||||
#define MIN(A,B) ( (A) < (B) ? (A) : (B)) |
||||
|
||||
#define INTERNAL_ERROR(p) {fprintf(stderr,"%s", p);abort();} |
||||
#define LN_CNT 4 |
||||
static char lnoise[4] = {'|', '/', '-', '\\' }; |
||||
#define LIFENOISE(n, var) \ |
||||
if (verbose > 0) fprintf(stderr, "%c\b", lnoise[(var%LN_CNT)]) |
||||
|
||||
#define MALLOC_CHECK(var) \ |
||||
if ((var) == NULL) \
|
||||
{ \
|
||||
fprintf(stderr, "Malloc failed at %s:%d\n", \
|
||||
__FILE__, __LINE__); \
|
||||
exit(1);\
|
||||
} |
||||
#define OPEN_CHECK(var, path) \ |
||||
if ((var) == NULL) \
|
||||
{ \
|
||||
fprintf(stderr, "Open failed for %s at %s:%d\n", \
|
||||
path, __FILE__, __LINE__); \
|
||||
exit(1);\
|
||||
} |
||||
#ifndef MAX_CHILDREN |
||||
#define MAX_CHILDREN 1000 |
||||
#endif |
||||
|
||||
/*
|
||||
* macros that control sparse keys |
||||
* |
||||
* refer to Porting.Notes for a complete explanation |
||||
*/ |
||||
#ifndef BITS_PER_LONG |
||||
#define BITS_PER_LONG 32 |
||||
#define MAX_LONG 0x7FFFFFFF |
||||
#endif /* BITS_PER_LONG */ |
||||
#define SPARSE_BITS 2 |
||||
#define SPARSE_KEEP 3 |
||||
#define MK_SPARSE(key, seq) \ |
||||
(((((key>>3)<<2)|(seq & 0x0003))<<3)|(key & 0x0007)) |
||||
|
||||
#define RANDOM(tgt, lower, upper, stream) dss_random(&tgt, lower, upper, stream) |
||||
#define RANDOM64(tgt, lower, upper, stream) dss_random64(&tgt, lower, upper, stream) |
||||
|
||||
|
||||
|
||||
typedef struct |
||||
{ |
||||
long weight; |
||||
char *text; |
||||
} set_member; |
||||
|
||||
typedef struct |
||||
{ |
||||
int count; |
||||
int max; |
||||
set_member *list; |
||||
long *permute; |
||||
} distribution; |
||||
/*
|
||||
* some handy access functions
|
||||
*/ |
||||
#define DIST_SIZE(d) d->count |
||||
#define DIST_MEMBER(d, i) ((set_member *)((d)->list + i))->text |
||||
#define DIST_PERMUTE(d, i) (d->permute[i]) |
||||
|
||||
typedef struct |
||||
{ |
||||
char *name; |
||||
char *comment; |
||||
DSS_HUGE base; |
||||
int (*loader) (); |
||||
long (*gen_seed)(); |
||||
int child; |
||||
DSS_HUGE vtotal; |
||||
} tdef; |
||||
|
||||
typedef struct SEED_T { |
||||
long table; |
||||
DSS_HUGE value; |
||||
DSS_HUGE usage; |
||||
DSS_HUGE boundary; |
||||
#ifdef RNG_TEST |
||||
DSS_HUGE nCalls; |
||||
#endif |
||||
} seed_t; |
||||
|
||||
|
||||
#if defined(__STDC__) |
||||
#define PROTO(s) s |
||||
#else |
||||
#define PROTO(s) () |
||||
#endif |
||||
|
||||
/* bm_utils.c */ |
||||
char *env_config PROTO((char *var, char *dflt)); |
||||
long yes_no PROTO((char *prompt)); |
||||
void a_rnd PROTO((int min, int max, int column, char *dest)); |
||||
int tx_rnd PROTO((long min, long max, long column, char *tgt)); |
||||
long julian PROTO((long date)); |
||||
long unjulian PROTO((long date)); |
||||
FILE *tbl_open PROTO((int tbl, char *mode)); |
||||
long dssncasecmp PROTO((char *s1, char *s2, int n)); |
||||
long dsscasecmp PROTO((char *s1, char *s2)); |
||||
int pick_str PROTO((distribution * s, int c, char *target)); |
||||
void agg_str PROTO((distribution *set, long count, long col, char *dest)); |
||||
void read_dist PROTO((char *path, char *name, distribution * target)); |
||||
void embed_str PROTO((distribution *d, int min, int max, int stream, char *dest)); |
||||
#ifndef STDLIB_HAS_GETOPT |
||||
int getopt PROTO((int arg_cnt, char **arg_vect, char *oprions)); |
||||
#endif /* STDLIB_HAS_GETOPT */ |
||||
DSS_HUGE set_state PROTO((int t, long scale, long procs, long step, DSS_HUGE *e)); |
||||
|
||||
/* rnd.c */ |
||||
DSS_HUGE NextRand PROTO((DSS_HUGE nSeed)); |
||||
DSS_HUGE UnifInt PROTO((DSS_HUGE nLow, DSS_HUGE nHigh, long nStream)); |
||||
void dss_random(DSS_HUGE *tgt, DSS_HUGE min, DSS_HUGE max, long seed); |
||||
void row_start(int t); |
||||
void row_stop(int t); |
||||
void dump_seeds(int t); |
||||
|
||||
/* text.c */ |
||||
#define MAX_GRAMMAR_LEN 12 /* max length of grammar component */ |
||||
#define MAX_SENT_LEN 256 /* max length of populated sentence */ |
||||
#define RNG_PER_SENT 27 /* max number of RNG calls per sentence */ |
||||
|
||||
void dbg_text PROTO((char * t, int min, int max, int s)); |
||||
|
||||
#ifdef DECLARER |
||||
#define EXTERN |
||||
#else |
||||
#define EXTERN extern |
||||
#endif /* DECLARER */ |
||||
|
||||
|
||||
EXTERN distribution nations; |
||||
EXTERN distribution nations2; |
||||
EXTERN distribution regions; |
||||
EXTERN distribution o_priority_set; |
||||
EXTERN distribution l_instruct_set; |
||||
EXTERN distribution l_smode_set; |
||||
EXTERN distribution l_category_set; |
||||
EXTERN distribution l_rflag_set; |
||||
EXTERN distribution c_mseg_set; |
||||
EXTERN distribution colors; |
||||
EXTERN distribution p_types_set; |
||||
EXTERN distribution p_cntr_set; |
||||
|
||||
/* distributions that control text generation */ |
||||
EXTERN distribution articles; |
||||
EXTERN distribution nouns; |
||||
EXTERN distribution adjectives; |
||||
EXTERN distribution adverbs; |
||||
EXTERN distribution prepositions; |
||||
EXTERN distribution verbs; |
||||
EXTERN distribution terminators; |
||||
EXTERN distribution auxillaries; |
||||
EXTERN distribution np; |
||||
EXTERN distribution vp; |
||||
EXTERN distribution grammar; |
||||
|
||||
|
||||
EXTERN long scale; |
||||
EXTERN int refresh; |
||||
EXTERN int resume; |
||||
EXTERN long verbose; |
||||
EXTERN long force; |
||||
EXTERN long updates; |
||||
EXTERN long table; |
||||
EXTERN long children; |
||||
EXTERN int step; |
||||
EXTERN int set_seeds; |
||||
EXTERN char *d_path; |
||||
|
||||
/* added for segmented updates */ |
||||
EXTERN int insert_segments; |
||||
EXTERN int delete_segments; |
||||
EXTERN int insert_orders_segment; |
||||
EXTERN int insert_lineitem_segment; |
||||
EXTERN int delete_segment; |
||||
|
||||
|
||||
#ifndef DECLARER |
||||
extern tdef tdefs[]; |
||||
|
||||
#endif /* DECLARER */ |
||||
|
||||
|
||||
/*****************************************************************
|
||||
** table level defines use the following naming convention: t_ccc_xxx |
||||
** with: t, a table identifier |
||||
** ccc, a column identifier |
||||
** xxx, a limit type |
||||
**************************************************************** |
||||
*/ |
||||
|
||||
/*
|
||||
* defines which control the parts table |
||||
*/ |
||||
#define P_SIZE 126 |
||||
#define P_NAME_SCL 5 |
||||
#define P_MFG_TAG "Manufacturer#" |
||||
#define P_MFG_FMT "%%s%%0%d%s" |
||||
#define P_MFG_MIN 1 |
||||
#define P_MFG_MAX 5 |
||||
#define P_BRND_TAG "Brand#" |
||||
#define P_BRND_FMT "%%s%%0%d%s" |
||||
#define P_BRND_MIN 1 |
||||
#define P_BRND_MAX 5 |
||||
#define P_SIZE_MIN 1 |
||||
#define P_SIZE_MAX 50 |
||||
#define P_MCST_MIN 100 |
||||
#define P_MCST_MAX 99900 |
||||
#define P_MCST_SCL 100.0 |
||||
#define P_RCST_MIN 90000 |
||||
#define P_RCST_MAX 200000 |
||||
#define P_RCST_SCL 100.0 |
||||
/*
|
||||
* defines which control the suppliers table |
||||
*/ |
||||
#define S_SIZE 145 |
||||
#define S_NAME_TAG "Supplier#" |
||||
#define S_NAME_FMT "%%s%%0%d%s" |
||||
#define S_ABAL_MIN -99999 |
||||
#define S_ABAL_MAX 999999 |
||||
#define S_CMNT_MAX 101 |
||||
#define S_CMNT_BBB 10 /* number of BBB comments/SF */ |
||||
#define BBB_DEADBEATS 50 /* % that are complaints */ |
||||
#define BBB_BASE "Customer " |
||||
#define BBB_COMPLAIN "Complaints" |
||||
#define BBB_COMMEND "Recommends" |
||||
#define BBB_CMNT_LEN 19 |
||||
#define BBB_BASE_LEN 9 |
||||
#define BBB_TYPE_LEN 10 |
||||
|
||||
/*
|
||||
* defines which control the partsupp table |
||||
*/ |
||||
#define PS_SIZE 145 |
||||
#define PS_SKEY_MIN 0 |
||||
#define PS_SKEY_MAX ((tdefs[SUPP].base - 1) * scale) |
||||
#define PS_SCST_MIN 100 |
||||
#define PS_SCST_MAX 100000 |
||||
#define PS_QTY_MIN 1 |
||||
#define PS_QTY_MAX 9999 |
||||
/*
|
||||
* defines which control the customers table |
||||
*/ |
||||
#define C_SIZE 165 |
||||
#define C_NAME_TAG "Customer#" |
||||
#define C_NAME_FMT "%%s%%0%d%s" |
||||
#define C_MSEG_MAX 5 |
||||
#define C_ABAL_MIN -99999 |
||||
#define C_ABAL_MAX 999999 |
||||
/*
|
||||
* defines which control the order table |
||||
*/ |
||||
#define O_SIZE 109 |
||||
#define O_CKEY_MIN 1 |
||||
#define O_CKEY_MAX (tdefs[CUST].base * scale) |
||||
#define O_ODATE_MIN STARTDATE |
||||
#define O_ODATE_MAX (STARTDATE + TOTDATE - \ |
||||
(L_SDTE_MAX + L_RDTE_MAX) - 1) |
||||
#define O_CLRK_TAG "Clerk#" |
||||
#define O_CLRK_FMT "%%s%%0%d%s" |
||||
#define O_CLRK_SCL 1000 |
||||
#define O_LCNT_MIN 1 |
||||
#define O_LCNT_MAX 7 |
||||
|
||||
/*
|
||||
* defines which control the lineitem table |
||||
*/ |
||||
#define L_SIZE 144L |
||||
#define L_QTY_MIN 1 |
||||
#define L_QTY_MAX 50 |
||||
#define L_TAX_MIN 0 |
||||
#define L_TAX_MAX 8 |
||||
#define L_DCNT_MIN 0 |
||||
#define L_DCNT_MAX 10 |
||||
#define L_PKEY_MIN 1 |
||||
#define L_PKEY_MAX (tdefs[PART].base * scale) |
||||
#define L_SDTE_MIN 1 |
||||
#define L_SDTE_MAX 121 |
||||
#define L_CDTE_MIN 30 |
||||
#define L_CDTE_MAX 90 |
||||
#define L_RDTE_MIN 1 |
||||
#define L_RDTE_MAX 30 |
||||
/*
|
||||
* defines which control the time table |
||||
*/ |
||||
#define T_SIZE 30 |
||||
#define T_START_DAY 3 /* wednesday ? */ |
||||
#define LEAP(y) ((!(y % 4) && (y % 100))?1:0) |
||||
|
||||
/*******************************************************************
|
||||
******************************************************************* |
||||
*** |
||||
*** general or inter table defines |
||||
*** |
||||
******************************************************************* |
||||
*******************************************************************/ |
||||
#define SUPP_PER_PART 4 |
||||
#define ORDERS_PER_CUST 10 /* sync this with CUST_MORTALITY */ |
||||
#define CUST_MORTALITY 3 /* portion with have no orders */ |
||||
#define NATIONS_MAX 90 /* limited by country codes in phone numbers */ |
||||
#define PHONE_FMT "%02d-%03d-%03d-%04d" |
||||
#define STARTDATE 92001 |
||||
#define CURRENTDATE 95168 |
||||
#define ENDDATE 98365 |
||||
#define TOTDATE 2557 |
||||
#define UPD_PCT 10 |
||||
#define MAX_STREAM 47 |
||||
#define V_STR_LOW 0.4 |
||||
#define PENNIES 100 /* for scaled int money arithmetic */ |
||||
#define Q11_FRACTION (double)0.0001 |
||||
/*
|
||||
* max and min SF in GB; Larger SF will require changes to the build routines |
||||
*/ |
||||
#define MIN_SCALE 1.0 |
||||
#define MAX_SCALE 100000.0 |
||||
/*
|
||||
* beyond this point we need to allow for BCD calculations |
||||
*/ |
||||
#define MAX_32B_SCALE 1000.0 |
||||
#define LONG2HUGE(src, dst) *dst = (DSS_HUGE)src |
||||
#define HUGE2LONG(src, dst) *dst = (long)src |
||||
#define HUGE_SET(src, dst) *dst = *src |
||||
#define HUGE_MUL(op1, op2) *op1 *= op2 |
||||
#define HUGE_DIV(op1, op2) *op1 /= op2 |
||||
#define HUGE_ADD(op1, op2, dst) *dst = *op1 + op2 |
||||
#define HUGE_SUB(op1, op2, dst) *dst = *op1 - op2 |
||||
#define HUGE_MOD(op1, op2) *op1 % op2 |
||||
#define HUGE_CMP(op1, op2) (*op1 == *op2)?0:(*op1 < *op2)-1:1 |
||||
|
||||
|
||||
/******** environmental variables and defaults ***************/ |
||||
#define DIST_TAG "DSS_DIST" /* environment var to override ... */ |
||||
#define DIST_DFLT "dists.dss" /* default file to hold distributions */ |
||||
#define PATH_TAG "DSS_PATH" /* environment var to override ... */ |
||||
#define PATH_DFLT "." /* default directory to hold tables */ |
||||
#define CONFIG_TAG "DSS_CONFIG" /* environment var to override ... */ |
||||
#define CONFIG_DFLT "." /* default directory to config files */ |
||||
#define ADHOC_TAG "DSS_ADHOC" /* environment var to override ... */ |
||||
#define ADHOC_DFLT "adhoc.dss" /* default file name for adhoc vars */ |
||||
|
||||
/******* output macros ********/ |
||||
#ifndef SEPARATOR |
||||
#define SEPARATOR '|' /* field spearator for generated flat files */ |
||||
#endif |
||||
/* Data type flags for a single print routine */ |
||||
#define DT_STR 0 |
||||
#ifndef MVS |
||||
#define DT_VSTR DT_STR |
||||
#else |
||||
#define DT_VSTR 1 |
||||
#endif /* MVS */ |
||||
#define DT_INT 2 |
||||
#define DT_HUGE 3 |
||||
#define DT_KEY 4 |
||||
#define DT_MONEY 5 |
||||
#define DT_CHR 6 |
||||
|
||||
int dbg_print(int dt, FILE *tgt, void *data, int len, int eol); |
||||
#define PR_STR(f, str, len) dbg_print(DT_STR, f, (void *)str, len, 1) |
||||
#define PR_VSTR(f, str, len) dbg_print(DT_VSTR, f, (void *)str, len, 1) |
||||
#define PR_VSTR_LAST(f, str, len) dbg_print(DT_VSTR, f, (void *)str, len, 0) |
||||
#define PR_INT(f, str) dbg_print(DT_INT, f, (void *)str, 0, 1) |
||||
#define PR_HUGE(f, str) dbg_print(DT_HUGE, f, (void *)str, 0, 1) |
||||
#define PR_HUGE_LAST(f, str) dbg_print(DT_HUGE, f, (void *)str, 0, 0) |
||||
#define PR_KEY(f, str) dbg_print(DT_KEY, f, (void *)str, 0, -1) |
||||
#define PR_MONEY(f, str) dbg_print(DT_MONEY, f, (void *)str, 0, 1) |
||||
#define PR_CHR(f, str) dbg_print(DT_CHR, f, (void *)str, 0, 1) |
||||
#define PR_STRT(fp) /* any line prep for a record goes here */ |
||||
#define PR_END(fp) fprintf(fp, "\n") /* finish the record here */ |
||||
#ifdef MDY_DATE |
||||
#define PR_DATE(tgt, yr, mn, dy) \ |
||||
sprintf(tgt, "%02d-%02d-19%02d", mn, dy, yr) |
||||
#else |
||||
#define PR_DATE(tgt, yr, mn, dy) \ |
||||
sprintf(tgt, "19%02d-%02d-%02d", yr, mn, dy) |
||||
#endif /* DATE_FORMAT */ |
||||
|
||||
/*
|
||||
* verification macros |
||||
*/ |
||||
#define VRF_STR(t, d) {char *xx = d; while (*xx) tdefs[t].vtotal += *xx++;} |
||||
#define VRF_INT(t,d) tdefs[t].vtotal += d |
||||
#define VRF_HUGE(t,d) tdefs[t].vtotal = *((long *)&d) + *((long *)(&d + 1)) |
||||
/* assume float is a 64 bit quantity */ |
||||
#define VRF_MONEY(t,d) tdefs[t].vtotal = *((long *)&d) + *((long *)(&d + 1)) |
||||
#define VRF_CHR(t,d) tdefs[t].vtotal += d |
||||
#define VRF_STRT(t) |
||||
#define VRF_END(t) |
||||
|
||||
/*********** distribuitons currently defined *************/ |
||||
#define UNIFORM 0 |
||||
|
||||
/*
|
||||
* seed indexes; used to separate the generation of individual columns |
||||
*/ |
||||
#define P_MFG_SD 0 |
||||
#define P_BRND_SD 1 |
||||
#define P_TYPE_SD 2 |
||||
#define P_SIZE_SD 3 |
||||
#define P_CNTR_SD 4 |
||||
#define P_RCST_SD 5 |
||||
#define PS_QTY_SD 7 |
||||
#define PS_SCST_SD 8 |
||||
#define O_SUPP_SD 10 |
||||
#define O_CLRK_SD 11 |
||||
#define O_ODATE_SD 13 |
||||
#define L_QTY_SD 14 |
||||
#define L_DCNT_SD 15 |
||||
#define L_TAX_SD 16 |
||||
#define L_SHIP_SD 17 |
||||
#define L_SMODE_SD 18 |
||||
#define L_PKEY_SD 19 |
||||
#define L_SKEY_SD 20 |
||||
#define L_SDTE_SD 21 |
||||
#define L_CDTE_SD 22 |
||||
#define L_RDTE_SD 23 |
||||
#define L_RFLG_SD 24 |
||||
#define C_NTRG_SD 27 |
||||
#define C_PHNE_SD 28 |
||||
#define C_ABAL_SD 29 |
||||
#define C_MSEG_SD 30 |
||||
#define S_NTRG_SD 33 |
||||
#define S_PHNE_SD 34 |
||||
#define S_ABAL_SD 35 |
||||
#define P_NAME_SD 37 |
||||
#define O_PRIO_SD 38 |
||||
#define HVAR_SD 39 |
||||
#define O_CKEY_SD 40 |
||||
#define N_CMNT_SD 41 |
||||
#define R_CMNT_SD 42 |
||||
#define O_LCNT_SD 43 |
||||
#define BBB_JNK_SD 44 |
||||
#define BBB_TYPE_SD 45 |
||||
#define BBB_CMNT_SD 46 |
||||
#define BBB_OFFSET_SD 47 |
||||
#endif /* DSS_H */ |
@ -0,0 +1,100 @@ |
||||
-- Sccsid: @(#)dss.ri 2.1.8.1 |
||||
-- TPCD Benchmark Version 8.0 |
||||
|
||||
CONNECT TO TPCD; |
||||
|
||||
--ALTER TABLE TPCD.REGION DROP PRIMARY KEY; |
||||
--ALTER TABLE TPCD.NATION DROP PRIMARY KEY; |
||||
--ALTER TABLE TPCD.PART DROP PRIMARY KEY; |
||||
--ALTER TABLE TPCD.SUPPLIER DROP PRIMARY KEY; |
||||
--ALTER TABLE TPCD.PARTSUPP DROP PRIMARY KEY; |
||||
--ALTER TABLE TPCD.ORDERS DROP PRIMARY KEY; |
||||
--ALTER TABLE TPCD.LINEITEM DROP PRIMARY KEY; |
||||
--ALTER TABLE TPCD.CUSTOMER DROP PRIMARY KEY; |
||||
|
||||
|
||||
-- For table REGION |
||||
ALTER TABLE TPCD.REGION |
||||
ADD PRIMARY KEY (R_REGIONKEY); |
||||
|
||||
-- For table NATION |
||||
ALTER TABLE TPCD.NATION |
||||
ADD PRIMARY KEY (N_NATIONKEY); |
||||
|
||||
ALTER TABLE TPCD.NATION |
||||
ADD FOREIGN KEY NATION_FK1 (N_REGIONKEY) references TPCD.REGION; |
||||
|
||||
COMMIT WORK; |
||||
|
||||
-- For table PART |
||||
ALTER TABLE TPCD.PART |
||||
ADD PRIMARY KEY (P_PARTKEY); |
||||
|
||||
COMMIT WORK; |
||||
|
||||
-- For table SUPPLIER |
||||
ALTER TABLE TPCD.SUPPLIER |
||||
ADD PRIMARY KEY (S_SUPPKEY); |
||||
|
||||
ALTER TABLE TPCD.SUPPLIER |
||||
ADD FOREIGN KEY SUPPLIER_FK1 (S_NATIONKEY) references TPCD.NATION; |
||||
|
||||
COMMIT WORK; |
||||
|
||||
-- For table PARTSUPP |
||||
ALTER TABLE TPCD.PARTSUPP |
||||
ADD PRIMARY KEY (PS_PARTKEY,PS_SUPPKEY); |
||||
|
||||
COMMIT WORK; |
||||
|
||||
-- For table CUSTOMER |
||||
ALTER TABLE TPCD.CUSTOMER |
||||
ADD PRIMARY KEY (C_CUSTKEY); |
||||
|
||||
ALTER TABLE TPCD.CUSTOMER |
||||
ADD FOREIGN KEY CUSTOMER_FK1 (C_NATIONKEY) references TPCD.NATION; |
||||
|
||||
COMMIT WORK; |
||||
|
||||
-- For table LINEITEM |
||||
ALTER TABLE TPCD.LINEITEM |
||||
ADD PRIMARY KEY (L_ORDERKEY,L_LINENUMBER); |
||||
|
||||
COMMIT WORK; |
||||
|
||||
-- For table ORDERS |
||||
ALTER TABLE TPCD.ORDERS |
||||
ADD PRIMARY KEY (O_ORDERKEY); |
||||
|
||||
COMMIT WORK; |
||||
|
||||
-- For table PARTSUPP |
||||
ALTER TABLE TPCD.PARTSUPP |
||||
ADD FOREIGN KEY PARTSUPP_FK1 (PS_SUPPKEY) references TPCD.SUPPLIER; |
||||
|
||||
COMMIT WORK; |
||||
|
||||
ALTER TABLE TPCD.PARTSUPP |
||||
ADD FOREIGN KEY PARTSUPP_FK2 (PS_PARTKEY) references TPCD.PART; |
||||
|
||||
COMMIT WORK; |
||||
|
||||
-- For table ORDERS |
||||
ALTER TABLE TPCD.ORDERS |
||||
ADD FOREIGN KEY ORDERS_FK1 (O_CUSTKEY) references TPCD.CUSTOMER; |
||||
|
||||
COMMIT WORK; |
||||
|
||||
-- For table LINEITEM |
||||
ALTER TABLE TPCD.LINEITEM |
||||
ADD FOREIGN KEY LINEITEM_FK1 (L_ORDERKEY) references TPCD.ORDERS; |
||||
|
||||
COMMIT WORK; |
||||
|
||||
ALTER TABLE TPCD.LINEITEM |
||||
ADD FOREIGN KEY LINEITEM_FK2 (L_PARTKEY,L_SUPPKEY) references |
||||
TPCD.PARTSUPP; |
||||
|
||||
COMMIT WORK; |
||||
|
||||
|
@ -0,0 +1,183 @@ |
||||
/*
|
||||
* $Id: dsstypes.h,v 1.3 2005/10/28 02:57:04 jms Exp $ |
||||
* |
||||
* Revision History |
||||
* =================== |
||||
* $Log: dsstypes.h,v $ |
||||
* Revision 1.3 2005/10/28 02:57:04 jms |
||||
* allow for larger names in customer table |
||||
* |
||||
* Revision 1.2 2005/01/03 20:08:58 jms |
||||
* change line terminations |
||||
* |
||||
* Revision 1.1.1.1 2004/11/24 23:31:46 jms |
||||
* re-establish external server |
||||
* |
||||
* Revision 1.3 2004/04/07 20:17:29 jms |
||||
* bug #58 (join fails between order/lineitem) |
||||
* |
||||
* Revision 1.2 2004/01/22 05:49:29 jms |
||||
* AIX porting (AIX 5.1) |
||||
* |
||||
* Revision 1.1.1.1 2003/08/07 17:58:34 jms |
||||
* recreation after CVS crash |
||||
* |
||||
* Revision 1.2 2003/08/07 17:58:34 jms |
||||
* Convery RNG to 64bit space as preparation for new large scale RNG |
||||
* |
||||
* Revision 1.1.1.1 2003/04/03 18:54:21 jms |
||||
* initial checkin |
||||
* |
||||
* |
||||
*/ |
||||
/*
|
||||
* general definitions and control information for the DSS data types |
||||
* and function prototypes |
||||
*/ |
||||
|
||||
/*
|
||||
* typedefs |
||||
*/ |
||||
typedef struct |
||||
{ |
||||
DSS_HUGE custkey; |
||||
char name[C_NAME_LEN + 3]; |
||||
char address[C_ADDR_MAX + 1]; |
||||
int alen; |
||||
DSS_HUGE nation_code; |
||||
char phone[PHONE_LEN + 1]; |
||||
DSS_HUGE acctbal; |
||||
char mktsegment[MAXAGG_LEN + 1]; |
||||
char comment[C_CMNT_MAX + 1]; |
||||
int clen; |
||||
} customer_t; |
||||
/* customers.c */ |
||||
long mk_cust PROTO((DSS_HUGE n_cust, customer_t * c)); |
||||
int pr_cust PROTO((customer_t * c, int mode)); |
||||
int ld_cust PROTO((customer_t * c, int mode)); |
||||
|
||||
typedef struct |
||||
{ |
||||
DSS_HUGE okey;
|
||||
DSS_HUGE partkey; |
||||
DSS_HUGE suppkey; |
||||
DSS_HUGE lcnt; |
||||
DSS_HUGE quantity; |
||||
DSS_HUGE eprice; |
||||
DSS_HUGE discount; |
||||
DSS_HUGE tax; |
||||
char rflag[1]; |
||||
char lstatus[1]; |
||||
char cdate[DATE_LEN]; |
||||
char sdate[DATE_LEN]; |
||||
char rdate[DATE_LEN]; |
||||
char shipinstruct[MAXAGG_LEN + 1]; |
||||
char shipmode[MAXAGG_LEN + 1]; |
||||
char comment[L_CMNT_MAX + 1]; |
||||
int clen; |
||||
} line_t; |
||||
|
||||
typedef struct |
||||
{ |
||||
DSS_HUGE okey; |
||||
DSS_HUGE custkey; |
||||
char orderstatus; |
||||
DSS_HUGE totalprice; |
||||
char odate[DATE_LEN]; |
||||
char opriority[MAXAGG_LEN + 1]; |
||||
char clerk[O_CLRK_LEN + 1]; |
||||
long spriority; |
||||
DSS_HUGE lines; |
||||
char comment[O_CMNT_MAX + 1]; |
||||
int clen; |
||||
line_t l[O_LCNT_MAX]; |
||||
} order_t; |
||||
|
||||
/* order.c */ |
||||
long mk_order PROTO((DSS_HUGE index, order_t * o, long upd_num)); |
||||
int pr_order PROTO((order_t * o, int mode)); |
||||
int ld_order PROTO((order_t * o, int mode)); |
||||
void mk_sparse PROTO((DSS_HUGE index, DSS_HUGE *ok, long seq)); |
||||
|
||||
typedef struct |
||||
{ |
||||
DSS_HUGE partkey; |
||||
DSS_HUGE suppkey; |
||||
DSS_HUGE qty; |
||||
DSS_HUGE scost; |
||||
char comment[PS_CMNT_MAX + 1]; |
||||
int clen; |
||||
} partsupp_t; |
||||
|
||||
typedef struct |
||||
{ |
||||
DSS_HUGE partkey; |
||||
char name[P_NAME_LEN + 1]; |
||||
int nlen; |
||||
char mfgr[P_MFG_LEN + 1]; |
||||
char brand[P_BRND_LEN + 1]; |
||||
char type[P_TYPE_LEN + 1]; |
||||
int tlen; |
||||
DSS_HUGE size; |
||||
char container[P_CNTR_LEN + 1]; |
||||
DSS_HUGE retailprice; |
||||
char comment[P_CMNT_MAX + 1]; |
||||
int clen; |
||||
partsupp_t s[SUPP_PER_PART]; |
||||
} part_t; |
||||
|
||||
/* parts.c */ |
||||
long mk_part PROTO((DSS_HUGE index, part_t * p)); |
||||
int pr_part PROTO((part_t * part, int mode)); |
||||
int ld_part PROTO((part_t * part, int mode)); |
||||
|
||||
typedef struct |
||||
{ |
||||
DSS_HUGE suppkey; |
||||
char name[S_NAME_LEN + 1]; |
||||
char address[S_ADDR_MAX + 1]; |
||||
int alen; |
||||
DSS_HUGE nation_code; |
||||
char phone[PHONE_LEN + 1]; |
||||
DSS_HUGE acctbal; |
||||
char comment[S_CMNT_MAX + 1]; |
||||
int clen; |
||||
} supplier_t; |
||||
/* supplier.c */ |
||||
long mk_supp PROTO((DSS_HUGE index, supplier_t * s)); |
||||
int pr_supp PROTO((supplier_t * supp, int mode)); |
||||
int ld_supp PROTO((supplier_t * supp, int mode)); |
||||
|
||||
typedef struct |
||||
{ |
||||
DSS_HUGE timekey; |
||||
char alpha[DATE_LEN]; |
||||
long year; |
||||
long month; |
||||
long week; |
||||
long day; |
||||
} dss_time_t;
|
||||
|
||||
/* time.c */ |
||||
long mk_time PROTO((DSS_HUGE h, dss_time_t * t)); |
||||
|
||||
/*
|
||||
* this assumes that N_CMNT_LEN >= R_CMNT_LEN
|
||||
*/ |
||||
typedef struct |
||||
{ |
||||
DSS_HUGE code; |
||||
char *text; |
||||
long join; |
||||
char comment[N_CMNT_MAX + 1]; |
||||
int clen; |
||||
} code_t; |
||||
|
||||
/* code table */ |
||||
int mk_nation PROTO((DSS_HUGE i, code_t * c)); |
||||
int pr_nation PROTO((code_t * c, int mode)); |
||||
int ld_nation PROTO((code_t * c, int mode)); |
||||
int mk_region PROTO((DSS_HUGE i, code_t * c)); |
||||
int pr_region PROTO((code_t * c, int mode)); |
||||
int ld_region PROTO((code_t * c, int mode)); |
||||
|
@ -0,0 +1,281 @@ |
||||
/*
|
||||
* $Id: load_stub.c,v 1.2 2005/01/03 20:08:58 jms Exp $ |
||||
* |
||||
* Revision History |
||||
* =================== |
||||
* $Log: load_stub.c,v $ |
||||
* Revision 1.2 2005/01/03 20:08:58 jms |
||||
* change line terminations |
||||
* |
||||
* Revision 1.1.1.1 2004/11/24 23:31:46 jms |
||||
* re-establish external server |
||||
* |
||||
* Revision 1.1.1.1 2003/04/03 18:54:21 jms |
||||
* recreation after CVS crash |
||||
* |
||||
* Revision 1.1.1.1 2003/04/03 18:54:21 jms |
||||
* initial checkin |
||||
* |
||||
* |
||||
*/ |
||||
/*****************************************************************
|
||||
* Title: load_stub.c |
||||
* Description: |
||||
* stub routines for: |
||||
* inline load of dss benchmark |
||||
* header creation for dss benchmark |
||||
* |
||||
***************************************************************** |
||||
*/ |
||||
|
||||
#include <stdio.h> |
||||
#include "config.h" |
||||
#include "dss.h" |
||||
#include "dsstypes.h" |
||||
|
||||
int
|
||||
close_direct(void) |
||||
{ |
||||
/* any post load cleanup goes here */ |
||||
return(0); |
||||
} |
||||
|
||||
int
|
||||
prep_direct(void) |
||||
{ |
||||
/* any preload prep goes here */ |
||||
return(0); |
||||
} |
||||
|
||||
int
|
||||
hd_cust (FILE *f) |
||||
{ |
||||
static int count = 0; |
||||
|
||||
if (! count++) |
||||
printf("No header has been defined for the customer table\n"); |
||||
|
||||
return(0); |
||||
} |
||||
|
||||
int
|
||||
ld_cust (customer_t *cp, int mode) |
||||
{ |
||||
static int count = 0; |
||||
|
||||
if (! count++) |
||||
printf("%s %s\n", |
||||
"No load routine has been defined", |
||||
"for the customer table"); |
||||
|
||||
return(0); |
||||
} |
||||
|
||||
int
|
||||
hd_part (FILE *f) |
||||
{ |
||||
static int count = 0; |
||||
|
||||
if (! count++) |
||||
printf("No header has been defined for the part table\n"); |
||||
|
||||
return(0); |
||||
} |
||||
|
||||
int
|
||||
ld_part (part_t *pp, int mode) |
||||
{ |
||||
static int count = 0; |
||||
|
||||
if (! count++) |
||||
printf("No load routine has been defined for the part table\n"); |
||||
|
||||
return(0); |
||||
} |
||||
|
||||
int
|
||||
ld_psupp (part_t *pp, int mode) |
||||
{ |
||||
static int count = 0; |
||||
|
||||
if (! count++) |
||||
printf("%s %s\n", |
||||
"No load routine has been defined for the", |
||||
"psupp table\n"); |
||||
|
||||
return(0); |
||||
|
||||
} |
||||
|
||||
|
||||
int
|
||||
hd_supp (FILE *f) |
||||
{ |
||||
static int count = 0; |
||||
|
||||
if (! count++) |
||||
printf("No header has been defined for the supplier table\n"); |
||||
|
||||
return(0); |
||||
} |
||||
|
||||
int
|
||||
ld_supp (supplier_t *sp, int mode) |
||||
{ |
||||
static int count = 0; |
||||
|
||||
if (! count++) |
||||
printf("%s %s\n", |
||||
"No load routine has been defined", |
||||
"for the supplier table\n"); |
||||
|
||||
return(0); |
||||
} |
||||
|
||||
|
||||
int
|
||||
hd_order (FILE *f) |
||||
{ |
||||
static int count = 0; |
||||
|
||||
if (! count++) |
||||
printf("No header has been defined for the order table\n"); |
||||
|
||||
return(0); |
||||
} |
||||
|
||||
int
|
||||
ld_order (order_t *p, int mode) |
||||
{ |
||||
static int count = 0; |
||||
|
||||
if (! count++) |
||||
printf("%s %s\n", |
||||
"No load routine has been defined", |
||||
"for the order table"); |
||||
|
||||
return(0); |
||||
} |
||||
|
||||
int ld_line (order_t *p, int mode) |
||||
{ |
||||
static int count = 0; |
||||
|
||||
if (! count++) |
||||
printf("%s %s\n", |
||||
"No load routine has been defined", |
||||
"for the line table"); |
||||
|
||||
return(0); |
||||
} |
||||
|
||||
|
||||
|
||||
int
|
||||
hd_psupp (FILE *f) |
||||
{ |
||||
static int count = 0; |
||||
|
||||
if (! count++) |
||||
printf("%s %s\n", |
||||
"No header has been defined for the", |
||||
"part supplier table"); |
||||
|
||||
return(0); |
||||
} |
||||
|
||||
|
||||
int
|
||||
hd_line (FILE *f) |
||||
{ |
||||
static int count = 0; |
||||
|
||||
if (! count++) |
||||
printf("No header has been defined for the lineitem table\n"); |
||||
|
||||
return(0); |
||||
} |
||||
|
||||
int
|
||||
hd_nation (FILE *f) |
||||
{ |
||||
static int count = 0; |
||||
|
||||
if (! count++) |
||||
printf("No header has been defined for the nation table\n"); |
||||
|
||||
return(0); |
||||
} |
||||
|
||||
int
|
||||
ld_nation (code_t *cp, int mode) |
||||
{ |
||||
static int count = 0; |
||||
|
||||
if (! count++) |
||||
printf("%s %s\n", |
||||
"No load routine has been defined", |
||||
"for the nation table"); |
||||
|
||||
return(0); |
||||
} |
||||
|
||||
int
|
||||
hd_region (FILE *f) |
||||
{ |
||||
static int count = 0; |
||||
|
||||
if (! count++) |
||||
printf("No header has been defined for the region table\n"); |
||||
|
||||
return(0); |
||||
} |
||||
|
||||
int
|
||||
ld_region (code_t *cp, int mode) |
||||
{ |
||||
static int count = 0; |
||||
|
||||
if (! count++) |
||||
printf("%s %s\n", |
||||
"No load routine has been defined", |
||||
"for the region table"); |
||||
|
||||
return(0); |
||||
} |
||||
|
||||
int
|
||||
ld_order_line (order_t *p, int mode) |
||||
{ |
||||
ld_order(p, mode); |
||||
ld_line (p, mode); |
||||
|
||||
return(0); |
||||
} |
||||
|
||||
int
|
||||
hd_order_line (FILE *f) |
||||
{ |
||||
hd_order(f); |
||||
hd_line (f); |
||||
|
||||
return(0); |
||||
} |
||||
|
||||
int
|
||||
ld_part_psupp (part_t *p, int mode) |
||||
{ |
||||
ld_part(p, mode); |
||||
ld_psupp (p, mode); |
||||
|
||||
return(0); |
||||
} |
||||
|
||||
int
|
||||
hd_part_psupp (FILE *f) |
||||
{ |
||||
hd_part(f); |
||||
hd_psupp(f); |
||||
|
||||
return(0); |
||||
} |
Binary file not shown.
@ -0,0 +1,199 @@ |
||||
#
|
||||
# $Id: makefile.suite,v 1.25 2009/10/22 19:10:21 jms Exp $
|
||||
#
|
||||
# Revision History
|
||||
# ===================
|
||||
# $Log: makefile.suite,v $
|
||||
# Revision 1.25 2009/10/22 19:10:21 jms
|
||||
# update revision to 2.9.0, disable bug55 fix
|
||||
#
|
||||
# Revision 1.24 2009/10/22 19:06:10 jms
|
||||
# update revision to 2.9.0, disable bug55 fix
|
||||
#
|
||||
# Revision 1.23 2009/06/28 14:01:08 jms
|
||||
# bug fix for DOP
|
||||
#
|
||||
# Revision 1.22 2008/09/15 16:37:46 jms
|
||||
# release 2.8.0 makefile.suite
|
||||
#
|
||||
# Revision 1.21 2008/03/21 18:26:54 jms
|
||||
# recursive zip for reference data, chmod for update_release
|
||||
#
|
||||
# Revision 1.20 2008/03/21 17:38:39 jms
|
||||
# changes for 2.6.3
|
||||
#
|
||||
# Revision 1.19 2007/03/08 20:36:03 jms
|
||||
# update release number to 2.6.1
|
||||
#
|
||||
# Revision 1.18 2007/02/06 18:15:56 jms
|
||||
# remove update release from general target
|
||||
#
|
||||
# Revision 1.17 2007/01/25 19:35:50 jms
|
||||
# add sln file used by VS2005
|
||||
#
|
||||
# Revision 1.16 2007/01/05 20:05:41 jms
|
||||
# update release number
|
||||
#
|
||||
# Revision 1.15 2006/09/07 17:25:57 jms
|
||||
# correct dss.ddl
|
||||
#
|
||||
# Revision 1.14 2006/08/01 17:21:22 jms
|
||||
# fix bad merge
|
||||
#
|
||||
# Revision 1.13 2006/08/01 16:55:44 jms
|
||||
# move to 2.4.1
|
||||
#
|
||||
# Revision 1.12 2006/06/29 20:46:17 jms
|
||||
# 2.4.0 changes from Meikel
|
||||
#
|
||||
# Revision 1.10 2006/05/25 22:30:44 jms
|
||||
# qgen porting for 32b/64b
|
||||
#
|
||||
# Revision 1.9 2006/04/26 23:17:09 jms
|
||||
# checking release.h prior to release build
|
||||
#
|
||||
# Revision 1.8 2006/04/26 23:03:00 jms
|
||||
# release 2.3.4-1
|
||||
#
|
||||
# Revision 1.7 2006/04/12 18:13:58 jms
|
||||
# release 2.3.3
|
||||
#
|
||||
# Revision 1.6 2006/03/09 18:59:19 jms
|
||||
# move to version 2.3.2
|
||||
#
|
||||
# Revision 1.5 2006/01/28 23:54:32 jms
|
||||
# add reference data to release
|
||||
#
|
||||
# Revision 1.4 2005/10/28 03:00:32 jms
|
||||
# fix release target
|
||||
#
|
||||
# Revision 1.3 2005/10/28 02:54:14 jms
|
||||
# increment build count with each release creation
|
||||
#
|
||||
# Revision 1.2 2005/01/03 20:08:58 jms
|
||||
# change line terminations
|
||||
#
|
||||
# Revision 1.1.1.1 2004/11/24 23:31:47 jms
|
||||
# re-establish external server
|
||||
#
|
||||
# Revision 1.5 2004/03/26 20:39:23 jms
|
||||
# add tpch tag to release files
|
||||
#
|
||||
# Revision 1.4 2004/03/16 14:45:57 jms
|
||||
# correct release target in makefile
|
||||
#
|
||||
# Revision 1.3 2004/03/02 20:49:01 jms
|
||||
# simplify distributions, add Windows IDE files
|
||||
# releases should use make release from now on
|
||||
#
|
||||
# Revision 1.2 2004/02/18 14:05:53 jms
|
||||
# porting changes for LINUX and 64 bit RNG
|
||||
#
|
||||
# Revision 1.1.1.1 2003/04/03 18:54:21 jms
|
||||
# recreation after CVS crash
|
||||
#
|
||||
# Revision 1.1.1.1 2003/04/03 18:54:21 jms
|
||||
# initial checkin
|
||||
#
|
||||
#
|
||||
#
|
||||
################
|
||||
## CHANGE NAME OF ANSI COMPILER HERE
|
||||
################
|
||||
CC = gcc
|
||||
# Current values for DATABASE are: INFORMIX, DB2, TDAT (Teradata)
|
||||
# SQLSERVER, SYBASE, ORACLE, VECTORWISE
|
||||
# PIVOTAL
|
||||
# Current values for MACHINE are: ATT, DOS, HP, IBM, ICL, MVS,
|
||||
# SGI, SUN, U2200, VMS, LINUX, WIN32
|
||||
# Current values for WORKLOAD are: TPCH
|
||||
DATABASE= DB2
|
||||
MACHINE = LINUX
|
||||
WORKLOAD = TPCH
|
||||
#
|
||||
CFLAGS = -g -DDBNAME=\"dss\" -D$(MACHINE) -D$(DATABASE) -D$(WORKLOAD) -DRNG_TEST -D_FILE_OFFSET_BITS=64
|
||||
LDFLAGS = -O
|
||||
# The OBJ,EXE and LIB macros will need to be changed for compilation under
|
||||
# Windows NT
|
||||
OBJ = .o
|
||||
EXE =
|
||||
LIBS = -lm
|
||||
#
|
||||
# NO CHANGES SHOULD BE NECESSARY BELOW THIS LINE
|
||||
###############
|
||||
VERSION=2
|
||||
RELEASE=13
|
||||
PATCH=0
|
||||
BUILD=`grep BUILD release.h | cut -f3 -d' '`
|
||||
NEW_BUILD=`expr ${BUILD} + 1`
|
||||
TREE_ROOT=/tmp/tree
|
||||
#
|
||||
PROG1 = dbgen$(EXE)
|
||||
PROG2 = qgen$(EXE)
|
||||
PROGS = $(PROG1) $(PROG2)
|
||||
#
|
||||
HDR1 = dss.h rnd.h config.h dsstypes.h shared.h bcd2.h rng64.h release.h
|
||||
HDR2 = tpcd.h permute.h
|
||||
HDR = $(HDR1) $(HDR2)
|
||||
#
|
||||
SRC1 = build.c driver.c bm_utils.c rnd.c print.c load_stub.c bcd2.c \
|
||||
speed_seed.c text.c permute.c rng64.c
|
||||
SRC2 = qgen.c varsub.c
|
||||
SRC = $(SRC1) $(SRC2)
|
||||
#
|
||||
OBJ1 = build$(OBJ) driver$(OBJ) bm_utils$(OBJ) rnd$(OBJ) print$(OBJ) \
|
||||
load_stub$(OBJ) bcd2$(OBJ) speed_seed$(OBJ) text$(OBJ) permute$(OBJ) \
|
||||
rng64$(OBJ)
|
||||
OBJ2 = build$(OBJ) bm_utils$(OBJ) qgen$(OBJ) rnd$(OBJ) varsub$(OBJ) \
|
||||
text$(OBJ) bcd2$(OBJ) permute$(OBJ) speed_seed$(OBJ) rng64$(OBJ)
|
||||
OBJS = $(OBJ1) $(OBJ2)
|
||||
#
|
||||
SETS = dists.dss
|
||||
DOC=README HISTORY PORTING.NOTES BUGS
|
||||
DDL = dss.ddl dss.ri
|
||||
WINDOWS_IDE = tpch.dsw dbgen.dsp tpch.sln tpch.vcproj qgen.vcproj
|
||||
OTHER=makefile.suite $(SETS) $(DDL) $(WINDOWS_IDE)
|
||||
# case is *important* in TEST_RES
|
||||
TEST_RES = O.res L.res c.res s.res P.res S.res n.res r.res
|
||||
#
|
||||
DBGENSRC=$(SRC1) $(HDR1) $(OTHER) $(DOC) $(SRC2) $(HDR2) $(SRC3)
|
||||
FQD=queries/1.sql queries/2.sql queries/3.sql queries/4.sql queries/5.sql queries/6.sql queries/7.sql \
|
||||
queries/8.sql queries/9.sql queries/10.sql queries/11.sql queries/12.sql queries/13.sql \
|
||||
queries/14.sql queries/15.sql queries/16.sql queries/17.sql queries/18.sql queries/19.sql queries/20.sql \
|
||||
queries/21.sql queries/22.sql
|
||||
VARIANTS= variants/8a.sql variants/12a.sql variants/13a.sql variants/14a.sql variants/15a.sql
|
||||
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 \
|
||||
answers/q9.out answers/q10.out answers/q11.out answers/q12.out answers/q13.out answers/q14.out answers/q15.out \
|
||||
answers/q16.out answers/q17.out answers/q18.out answers/q19.out answers/q20.out answers/q21.out answers/q22.out
|
||||
QSRC = $(FQD) $(VARIANTS) $(ANS)
|
||||
TREE_DOC=tree.readme tree.changes appendix.readme appendix.version answers.readme queries.readme variants.readme
|
||||
REFERENCE=reference/[tcR]*
|
||||
REFERENCE_DATA=referenceData/[13]*
|
||||
SCRIPTS= check55.sh column_split.sh dop.sh gen_tasks.sh last_row.sh load_balance.sh new55.sh check_dirs.sh
|
||||
ALLSRC=$(DBGENSRC) $(REFERENCE) $(QSRC) $(SCRIPTS)
|
||||
JUNK =
|
||||
#
|
||||
all: $(PROGS) |
||||
$(PROG1): $(OBJ1) $(SETS) |
||||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ1) $(LIBS)
|
||||
$(PROG2): permute.h $(OBJ2) |
||||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ2) $(LIBS)
|
||||
clean: |
||||
rm -f $(PROGS) $(OBJS) $(JUNK)
|
||||
lint: |
||||
lint $(CFLAGS) -u -x -wO -Ma -p $(SRC1)
|
||||
lint $(CFLAGS) -u -x -wO -Ma -p $(SRC2)
|
||||
|
||||
tar: $(ALLSRC) |
||||
tar cvhf - $(ALLSRC) --exclude .svn\*/\* |gzip - > tpch_${VERSION}_${RELEASE}_${PATCH}.tar.gz
|
||||
tar cvhf - $(REFERENCE_DATA) --exclude .svn\*/\* |gzip - > reference_${VERSION}_${RELEASE}_${PATCH}.tar.gz
|
||||
zip: $(ALLSRC) |
||||
zip -r tpch_${VERSION}_${RELEASE}_${PATCH}.zip $(ALLSRC) -x *.svn*
|
||||
zip -r reference_${VERSION}_${RELEASE}_${PATCH}.zip $(REFERENCE_DATA) -x *.svn*
|
||||
release: |
||||
make -f makefile.suite tar
|
||||
make -f makefile.suite zip
|
||||
( cd tests; sh test_list.sh `date '+%Y%m%d'` )
|
||||
rnd$(OBJ): rnd.h |
||||
$(OBJ1): $(HDR1) |
||||
$(OBJ2): dss.h tpcd.h config.h rng64.h release.h |
@ -0,0 +1,186 @@ |
||||
/*
|
||||
* $Id: permute.c,v 1.3 2007/01/04 21:29:21 jms Exp $ |
||||
* |
||||
* Revision History |
||||
* =================== |
||||
* $Log: permute.c,v $ |
||||
* Revision 1.3 2007/01/04 21:29:21 jms |
||||
* Porting changes uncovered as part of move to VS2005. No impact on data set |
||||
* |
||||
* Revision 1.2 2005/01/03 20:08:59 jms |
||||
* change line terminations |
||||
* |
||||
* Revision 1.1.1.1 2004/11/24 23:31:47 jms |
||||
* re-establish external server |
||||
* |
||||
* Revision 1.1.1.1 2003/08/07 17:58:34 jms |
||||
* recreation after CVS crash |
||||
* |
||||
* Revision 1.2 2003/08/07 17:58:34 jms |
||||
* Convery RNG to 64bit space as preparation for new large scale RNG |
||||
* |
||||
* Revision 1.1.1.1 2003/04/03 18:54:21 jms |
||||
* initial checkin |
||||
* |
||||
* |
||||
*/ |
||||
/*
|
||||
* permute.c -- a permutation generator for the query
|
||||
* sequences in TPC-H and TPC-R |
||||
*/ |
||||
|
||||
#ifdef TEST |
||||
#define DECLARER |
||||
#endif |
||||
#include "config.h" |
||||
#include "dss.h" |
||||
#ifdef TEST |
||||
#include <stdlib.h> |
||||
#if (defined(_POSIX_)||!defined(WIN32)) /* Change for Windows NT */ |
||||
#include <unistd.h> |
||||
#include <sys/wait.h> |
||||
#endif /* WIN32 */ |
||||
#include <stdio.h> /* */ |
||||
#include <limits.h> |
||||
#include <math.h> |
||||
#include <ctype.h> |
||||
#include <signal.h> |
||||
#include <string.h> |
||||
#include <errno.h> |
||||
#ifdef HP |
||||
#include <strings.h> |
||||
#endif |
||||
#if (defined(WIN32)&&!defined(_POSIX_)) |
||||
#include <process.h> |
||||
#pragma warning(disable:4201) |
||||
#pragma warning(disable:4214) |
||||
#pragma warning(disable:4514) |
||||
#define WIN32_LEAN_AND_MEAN |
||||
#define NOATOM |
||||
#define NOGDICAPMASKS |
||||
#define NOMETAFILE |
||||
#define NOMINMAX |
||||
#define NOMSG |
||||
#define NOOPENFILE |
||||
#define NORASTEROPS |
||||
#define NOSCROLL |
||||
#define NOSOUND |
||||
#define NOSYSMETRICS |
||||
#define NOTEXTMETRIC |
||||
#define NOWH |
||||
#define NOCOMM |
||||
#define NOKANJI |
||||
#define NOMCX |
||||
#include <windows.h> |
||||
#pragma warning(default:4201) |
||||
#pragma warning(default:4214) |
||||
#endif |
||||
#endif |
||||
|
||||
DSS_HUGE NextRand(DSS_HUGE seed); |
||||
void permute(long *set, int cnt, long stream); |
||||
void permute_dist(distribution *d, long stream); |
||||
long seed; |
||||
char *eol[2] = {" ", "},"}; |
||||
extern seed_t Seed[]; |
||||
#ifdef TEST |
||||
tdef tdefs = { NULL }; |
||||
#endif |
||||
|
||||
|
||||
#define MAX_QUERY 22 |
||||
#define ITERATIONS 1000 |
||||
#define UNSET 0 |
||||
|
||||
void permute(long *a, int c, long s) |
||||
{ |
||||
int i; |
||||
static DSS_HUGE source; |
||||
static long *set, temp; |
||||
|
||||
if (a != (long *)NULL) |
||||
{ |
||||
for (i=0; i < c; i++) |
||||
{ |
||||
RANDOM(source, (long)i, (long)(c - 1), s); |
||||
temp = *(a + source); |
||||
*(a + source) = *(a + i) ; |
||||
*(a + i) = temp; |
||||
} |
||||
} |
||||
|
||||
return; |
||||
} |
||||
|
||||
void permute_dist(distribution *d, long stream) |
||||
{ |
||||
static distribution *dist = NULL; |
||||
int i; |
||||
|
||||
if (d != NULL) |
||||
{ |
||||
if (d->permute == (long *)NULL) |
||||
{ |
||||
d->permute = (long *)malloc(sizeof(long) * DIST_SIZE(d)); |
||||
MALLOC_CHECK(d->permute); |
||||
} |
||||
for (i=0; i < DIST_SIZE(d); i++)
|
||||
*(d->permute + i) = i; |
||||
permute(d->permute, DIST_SIZE(d), stream); |
||||
} |
||||
else |
||||
INTERNAL_ERROR("Bad call to permute_dist");
|
||||
|
||||
return; |
||||
} |
||||
|
||||
|
||||
#ifdef TEST |
||||
|
||||
main(int ac, char *av[]) |
||||
{ |
||||
long *sequence,
|
||||
i, |
||||
j, |
||||
streams = UNSET, |
||||
*a; |
||||
char sep; |
||||
int index = 0; |
||||
|
||||
set_seeds = 0; |
||||
sequence = (long *)malloc(MAX_QUERY * sizeof(long)); |
||||
a = sequence; |
||||
for (i=0; i < MAX_QUERY; i++) |
||||
*(sequence + i) = i; |
||||
if (ac < 3)
|
||||
goto usage; |
||||
Seed[0].value = (long)atoi(av[1]); |
||||
streams = atoi(av[2]); |
||||
if (Seed[0].value == UNSET || streams == UNSET)
|
||||
goto usage; |
||||
|
||||
index = 0; |
||||
printf("long permutation[%d][%d] = {\n", streams, MAX_QUERY); |
||||
for (j=0; j < streams; j++) |
||||
{ |
||||
sep = '{'; |
||||
printf("%s\n", eol[index]); |
||||
for (i=0; i < MAX_QUERY; i++) |
||||
{ |
||||
printf("%c%2d", sep, *permute(a, MAX_QUERY, 0) + 1); |
||||
a = (long *)NULL; |
||||
sep = ','; |
||||
} |
||||
a = sequence; |
||||
index=1; |
||||
} |
||||
printf("}\n};\n"); |
||||
return(0); |
||||
|
||||
usage: |
||||
printf("Usage: %s <seed> <streams>\n",av[0]); |
||||
printf(" uses <seed> to start the generation of <streams> permutations of [1..%d]\n", MAX_QUERY); |
||||
return(-1); |
||||
|
||||
} |
||||
#endif /* TEST */ |
@ -0,0 +1,64 @@ |
||||
/*
|
||||
* $Id: permute.h,v 1.2 2005/01/03 20:08:59 jms Exp $ |
||||
* |
||||
* Revision History |
||||
* =================== |
||||
* $Log: permute.h,v $ |
||||
* Revision 1.2 2005/01/03 20:08:59 jms |
||||
* change line terminations |
||||
* |
||||
* Revision 1.1.1.1 2004/11/24 23:31:47 jms |
||||
* re-establish external server |
||||
* |
||||
* Revision 1.1.1.1 2003/04/03 18:54:21 jms |
||||
* recreation after CVS crash |
||||
* |
||||
* Revision 1.1.1.1 2003/04/03 18:54:21 jms |
||||
* initial checkin |
||||
* |
||||
* |
||||
*/ |
||||
long permutation[41][22] = |
||||
{ |
||||
{14, 2, 9,20, 6,17,18, 8,21,13, 3,22,16, 4,11,15, 1,10,19, 5, 7,12}, |
||||
{21, 3,18, 5,11, 7, 6,20,17,12,16,15,13,10, 2, 8,14,19, 9,22, 1, 4}, |
||||
{ 6,17,14,16,19,10, 9, 2,15, 8, 5,22,12, 7,13,18, 1, 4,20, 3,11,21}, |
||||
{ 8, 5, 4, 6,17, 7, 1,18,22,14, 9,10,15,11,20, 2,21,19,13,16,12, 3}, |
||||
{ 5,21,14,19,15,17,12, 6, 4, 9, 8,16,11, 2,10,18, 1,13, 7,22, 3,20}, |
||||
{21,15, 4, 6, 7,16,19,18,14,22,11,13, 3, 1, 2, 5, 8,20,12,17,10, 9}, |
||||
{10, 3,15,13, 6, 8, 9, 7, 4,11,22,18,12, 1, 5,16, 2,14,19,20,17,21}, |
||||
{18, 8,20,21, 2, 4,22,17, 1,11, 9,19, 3,13, 5, 7,10,16, 6,14,15,12}, |
||||
{19, 1,15,17, 5, 8, 9,12,14, 7, 4, 3,20,16, 6,22,10,13, 2,21,18,11}, |
||||
{ 8,13, 2,20,17, 3, 6,21,18,11,19,10,15, 4,22, 1, 7,12, 9,14, 5,16}, |
||||
{ 6,15,18,17,12, 1, 7, 2,22,13,21,10,14, 9, 3,16,20,19,11, 4, 8, 5}, |
||||
{15,14,18,17,10,20,16,11, 1, 8, 4,22, 5,12, 3, 9,21, 2,13, 6,19, 7}, |
||||
{ 1, 7,16,17,18,22,12, 6, 8, 9,11, 4, 2, 5,20,21,13,10,19, 3,14,15}, |
||||
{21,17, 7, 3, 1,10,12,22, 9,16, 6,11, 2, 4, 5,14, 8,20,13,18,15,19}, |
||||
{ 2, 9, 5, 4,18, 1,20,15,16,17, 7,21,13,14,19, 8,22,11,10, 3,12, 6}, |
||||
{16, 9,17, 8,14,11,10,12, 6,21, 7, 3,15, 5,22,20, 1,13,19, 2, 4,18}, |
||||
{ 1, 3, 6, 5, 2,16,14,22,17,20, 4, 9,10,11,15, 8,12,19,18,13, 7,21}, |
||||
{ 3,16, 5,11,21, 9, 2,15,10,18,17, 7, 8,19,14,13, 1, 4,22,20, 6,12}, |
||||
{14, 4,13, 5,21,11, 8, 6, 3,17, 2,20, 1,19,10, 9,12,18,15, 7,22,16}, |
||||
{ 4,12,22,14, 5,15,16, 2, 8,10,17, 9,21, 7, 3, 6,13,18,11,20,19, 1}, |
||||
{16,15,14,13, 4,22,18,19, 7, 1,12,17, 5,10,20, 3, 9,21,11, 2, 6, 8}, |
||||
{20,14,21,12,15,17, 4,19,13,10,11, 1,16, 5,18, 7, 8,22, 9, 6, 3, 2}, |
||||
{16,14,13, 2,21,10,11, 4, 1,22,18,12,19, 5, 7, 8, 6, 3,15,20, 9,17}, |
||||
{18,15, 9,14,12, 2, 8,11,22,21,16, 1, 6,17, 5,10,19, 4,20,13, 3, 7}, |
||||
{ 7, 3,10,14,13,21,18, 6,20, 4, 9, 8,22,15, 2, 1, 5,12,19,17,11,16}, |
||||
{18, 1,13, 7,16,10,14, 2,19, 5,21,11,22,15, 8,17,20, 3, 4,12, 6, 9}, |
||||
{13, 2,22, 5,11,21,20,14, 7,10, 4, 9,19,18, 6, 3, 1, 8,15,12,17,16}, |
||||
{14,17,21, 8, 2, 9, 6, 4, 5,13,22, 7,15, 3, 1,18,16,11,10,12,20,19}, |
||||
{10,22, 1,12,13,18,21,20, 2,14,16, 7,15, 3, 4,17, 5,19, 6, 8, 9,11}, |
||||
{10, 8, 9,18,12, 6, 1, 5,20,11,17,22,16, 3,13, 2,15,21,14,19, 7, 4}, |
||||
{ 7,17,22, 5, 3,10,13,18, 9, 1,14,15,21,19,16,12, 8, 6,11,20, 4, 2}, |
||||
{ 2, 9,21, 3, 4, 7, 1,11,16, 5,20,19,18, 8,17,13,10,12,15, 6,14,22}, |
||||
{15,12, 8, 4,22,13,16,17,18, 3, 7, 5, 6, 1, 9,11,21,10,14,20,19, 2}, |
||||
{15,16, 2,11,17, 7, 5,14,20, 4,21, 3,10, 9,12, 8,13, 6,18,19,22, 1}, |
||||
{ 1,13,11, 3, 4,21, 6,14,15,22,18, 9, 7, 5,10,20,12,16,17, 8,19, 2}, |
||||
{14,17,22,20, 8,16, 5,10, 1,13, 2,21,12, 9, 4,18, 3, 7, 6,19,15,11}, |
||||
{ 9,17, 7, 4, 5,13,21,18,11, 3,22, 1, 6,16,20,14,15,10, 8, 2,12,19}, |
||||
{13,14, 5,22,19,11, 9, 6,18,15, 8,10, 7, 4,17,16, 3, 1,12, 2,21,20}, |
||||
{20, 5, 4,14,11, 1, 6,16, 8,22, 7, 3, 2,12,21,19,17,13,10,15,18, 9}, |
||||
{ 3, 7,14,15, 6, 5,21,20,18,10, 4,16,19, 1,13, 9, 8,17,11,12,22, 2}, |
||||
{13,15,17, 1,22,11, 3, 4, 7,20,14,21, 9, 8, 2,18,16, 6,10,12, 5,19} |
||||
}; |
Binary file not shown.
@ -0,0 +1,444 @@ |
||||
/*
|
||||
* $Id: print.c,v 1.3 2005/10/28 02:56:22 jms Exp $ |
||||
* |
||||
* Revision History |
||||
* =================== |
||||
* $Log: print.c,v $ |
||||
* Revision 1.3 2005/10/28 02:56:22 jms |
||||
* add platform-specific printf formats to allow for DSS_HUGE data type |
||||
* |
||||
* Revision 1.2 2005/01/03 20:08:59 jms |
||||
* change line terminations |
||||
* |
||||
* Revision 1.1.1.1 2004/11/24 23:31:47 jms |
||||
* re-establish external server |
||||
* |
||||
* Revision 1.4 2004/02/18 16:26:49 jms |
||||
* 32/64 bit changes for overflow handling needed additional changes when ported back to windows |
||||
* |
||||
* Revision 1.3 2004/02/18 14:05:53 jms |
||||
* porting changes for LINUX and 64 bit RNG |
||||
* |
||||
* Revision 1.2 2004/01/22 05:49:29 jms |
||||
* AIX porting (AIX 5.1) |
||||
* |
||||
* Revision 1.1.1.1 2003/08/07 17:58:34 jms |
||||
* recreation after CVS crash |
||||
* |
||||
* Revision 1.2 2003/08/07 17:58:34 jms |
||||
* Convery RNG to 64bit space as preparation for new large scale RNG |
||||
* |
||||
* Revision 1.1.1.1 2003/04/03 18:54:21 jms |
||||
* initial checkin |
||||
* |
||||
* |
||||
*/ |
||||
/* generate flat files for data load */ |
||||
#include <stdio.h> |
||||
#ifndef VMS |
||||
#include <sys/types.h> |
||||
#endif |
||||
#if defined(SUN) |
||||
#include <unistd.h> |
||||
#endif |
||||
#include <math.h> |
||||
|
||||
#include "dss.h" |
||||
#include "dsstypes.h" |
||||
#include <string.h> |
||||
|
||||
/*
|
||||
* Function Prototypes |
||||
*/ |
||||
FILE *print_prep PROTO((int table, int update)); |
||||
int pr_drange PROTO((int tbl, DSS_HUGE min, DSS_HUGE cnt, long num)); |
||||
|
||||
FILE * |
||||
print_prep(int table, int update) |
||||
{ |
||||
char upath[128]; |
||||
FILE *res; |
||||
|
||||
if (updates) |
||||
{ |
||||
if (update > 0) /* updates */ |
||||
if ( insert_segments ) |
||||
{ |
||||
int this_segment; |
||||
if(strcmp(tdefs[table].name,"orders.tbl")) |
||||
this_segment=++insert_orders_segment; |
||||
else
|
||||
this_segment=++insert_lineitem_segment; |
||||
sprintf(upath, "%s%c%s.u%d.%d",
|
||||
env_config(PATH_TAG, PATH_DFLT), |
||||
PATH_SEP, tdefs[table].name, update%10000,this_segment); |
||||
} |
||||
else |
||||
{ |
||||
sprintf(upath, "%s%c%s.u%d", |
||||
env_config(PATH_TAG, PATH_DFLT), |
||||
PATH_SEP, tdefs[table].name, update); |
||||
} |
||||
else /* deletes */ |
||||
if ( delete_segments ) |
||||
{ |
||||
++delete_segment; |
||||
sprintf(upath, "%s%cdelete.u%d.%d", |
||||
env_config(PATH_TAG, PATH_DFLT), PATH_SEP, -update%10000, |
||||
delete_segment); |
||||
} |
||||
else |
||||
{ |
||||
sprintf(upath, "%s%cdelete.%d", |
||||
env_config(PATH_TAG, PATH_DFLT), PATH_SEP, -update); |
||||
} |
||||
return(fopen(upath, "w")); |
||||
} |
||||
res = tbl_open(table, "w"); |
||||
OPEN_CHECK(res, tdefs[table].name); |
||||
return(res); |
||||
} |
||||
|
||||
int |
||||
dbg_print(int format, FILE *target, void *data, int len, int sep) |
||||
{ |
||||
int dollars, |
||||
cents; |
||||
|
||||
switch(format) |
||||
{ |
||||
case DT_STR: |
||||
fprintf(target, "%s", (char *)data); |
||||
break; |
||||
#ifdef MVS |
||||
case DT_VSTR: |
||||
/* note: only used in MVS, assumes columnar output */ |
||||
fprintf(target, "%c%c%-*s",
|
||||
(len >> 8) & 0xFF, len & 0xFF, len, (char *)data); |
||||
break; |
||||
#endif /* MVS */ |
||||
case DT_INT: |
||||
fprintf(target, "%ld", (long)data); |
||||
break; |
||||
case DT_HUGE: |
||||
fprintf(target, HUGE_FORMAT, *(DSS_HUGE *)data); |
||||
break; |
||||
case DT_KEY: |
||||
fprintf(target, "%ld", (long)data); |
||||
break; |
||||
case DT_MONEY: |
||||
cents = (int)*(DSS_HUGE *)data; |
||||
if (cents < 0) |
||||
{ |
||||
fprintf(target, "-"); |
||||
cents = -cents; |
||||
} |
||||
dollars = cents / 100; |
||||
cents %= 100; |
||||
fprintf(target, "%ld.%02ld", dollars, cents); |
||||
break; |
||||
case DT_CHR: |
||||
fprintf(target, "%c", *(char *)data); |
||||
break; |
||||
} |
||||
|
||||
#ifdef EOL_HANDLING |
||||
if (sep) |
||||
#endif /* EOL_HANDLING */ |
||||
fprintf(target, "%c", SEPARATOR); |
||||
|
||||
return(0); |
||||
} |
||||
|
||||
int |
||||
pr_cust(customer_t *c, int mode) |
||||
{ |
||||
static FILE *fp = NULL; |
||||
|
||||
if (fp == NULL) |
||||
fp = print_prep(CUST, 0); |
||||
|
||||
PR_STRT(fp); |
||||
PR_HUGE(fp, &c->custkey); |
||||
if (scale <= 3000) |
||||
PR_VSTR(fp, c->name, C_NAME_LEN); |
||||
else |
||||
PR_VSTR(fp, c->name, C_NAME_LEN + 3); |
||||
PR_VSTR(fp, c->address, c->alen); |
||||
PR_HUGE(fp, &c->nation_code); |
||||
PR_STR(fp, c->phone, PHONE_LEN); |
||||
PR_MONEY(fp, &c->acctbal); |
||||
PR_STR(fp, c->mktsegment, C_MSEG_LEN); |
||||
PR_VSTR_LAST(fp, c->comment, c->clen); |
||||
PR_END(fp); |
||||
|
||||
return(0); |
||||
} |
||||
|
||||
/*
|
||||
* print the numbered order
|
||||
*/ |
||||
int |
||||
pr_order(order_t *o, int mode) |
||||
{ |
||||
static FILE *fp_o = NULL; |
||||
static int last_mode = 0; |
||||
|
||||
if (fp_o == NULL || mode != last_mode) |
||||
{ |
||||
if (fp_o)
|
||||
fclose(fp_o); |
||||
fp_o = print_prep(ORDER, mode); |
||||
last_mode = mode; |
||||
} |
||||
PR_STRT(fp_o); |
||||
PR_HUGE(fp_o, &o->okey); |
||||
PR_HUGE(fp_o, &o->custkey); |
||||
PR_CHR(fp_o, &o->orderstatus); |
||||
PR_MONEY(fp_o, &o->totalprice); |
||||
PR_STR(fp_o, o->odate, DATE_LEN); |
||||
PR_STR(fp_o, o->opriority, O_OPRIO_LEN); |
||||
PR_STR(fp_o, o->clerk, O_CLRK_LEN); |
||||
PR_INT(fp_o, o->spriority); |
||||
PR_VSTR_LAST(fp_o, o->comment, o->clen); |
||||
PR_END(fp_o); |
||||
|
||||
return(0); |
||||
} |
||||
|
||||
/*
|
||||
* print an order's lineitems |
||||
*/ |
||||
int |
||||
pr_line(order_t *o, int mode) |
||||
{ |
||||
static FILE *fp_l = NULL; |
||||
static int last_mode = 0; |
||||
long i; |
||||
|
||||
if (fp_l == NULL || mode != last_mode) |
||||
{ |
||||
if (fp_l)
|
||||
fclose(fp_l); |
||||
fp_l = print_prep(LINE, mode); |
||||
last_mode = mode; |
||||
} |
||||
|
||||
for (i = 0; i < o->lines; i++) |
||||
{ |
||||
PR_STRT(fp_l); |
||||
PR_HUGE(fp_l, &o->l[i].okey); |
||||
PR_HUGE(fp_l, &o->l[i].partkey); |
||||
PR_HUGE(fp_l, &o->l[i].suppkey); |
||||
PR_HUGE(fp_l, &o->l[i].lcnt); |
||||
PR_HUGE(fp_l, &o->l[i].quantity); |
||||
PR_MONEY(fp_l, &o->l[i].eprice); |
||||
PR_MONEY(fp_l, &o->l[i].discount); |
||||
PR_MONEY(fp_l, &o->l[i].tax); |
||||
PR_CHR(fp_l, &o->l[i].rflag[0]); |
||||
PR_CHR(fp_l, &o->l[i].lstatus[0]); |
||||
PR_STR(fp_l, o->l[i].sdate, DATE_LEN); |
||||
PR_STR(fp_l, o->l[i].cdate, DATE_LEN); |
||||
PR_STR(fp_l, o->l[i].rdate, DATE_LEN); |
||||
PR_STR(fp_l, o->l[i].shipinstruct, L_INST_LEN); |
||||
PR_STR(fp_l, o->l[i].shipmode, L_SMODE_LEN); |
||||
PR_VSTR_LAST(fp_l, o->l[i].comment,o->l[i].clen); |
||||
PR_END(fp_l); |
||||
} |
||||
|
||||
return(0); |
||||
} |
||||
|
||||
/*
|
||||
* print the numbered order *and* its associated lineitems |
||||
*/ |
||||
int |
||||
pr_order_line(order_t *o, int mode) |
||||
{ |
||||
tdefs[ORDER].name = tdefs[ORDER_LINE].name; |
||||
pr_order(o, mode); |
||||
pr_line(o, mode); |
||||
|
||||
return(0); |
||||
} |
||||
|
||||
/*
|
||||
* print the given part |
||||
*/ |
||||
int |
||||
pr_part(part_t *part, int mode) |
||||
{ |
||||
static FILE *p_fp = NULL; |
||||
|
||||
if (p_fp == NULL) |
||||
p_fp = print_prep(PART, 0); |
||||
|
||||
PR_STRT(p_fp); |
||||
PR_HUGE(p_fp, &part->partkey); |
||||
PR_VSTR(p_fp, part->name,part->nlen); |
||||
PR_STR(p_fp, part->mfgr, P_MFG_LEN); |
||||
PR_STR(p_fp, part->brand, P_BRND_LEN); |
||||
PR_VSTR(p_fp, part->type,part->tlen); |
||||
PR_HUGE(p_fp, &part->size); |
||||
PR_STR(p_fp, part->container, P_CNTR_LEN); |
||||
PR_MONEY(p_fp, &part->retailprice); |
||||
PR_VSTR_LAST(p_fp, part->comment,part->clen); |
||||
PR_END(p_fp); |
||||
|
||||
return(0); |
||||
} |
||||
|
||||
/*
|
||||
* print the given part's suppliers |
||||
*/ |
||||
int |
||||
pr_psupp(part_t *part, int mode) |
||||
{ |
||||
static FILE *ps_fp = NULL; |
||||
long i; |
||||
|
||||
if (ps_fp == NULL) |
||||
ps_fp = print_prep(PSUPP, mode); |
||||
|
||||
for (i = 0; i < SUPP_PER_PART; i++) |
||||
{ |
||||
PR_STRT(ps_fp); |
||||
PR_HUGE(ps_fp, &part->s[i].partkey); |
||||
PR_HUGE(ps_fp, &part->s[i].suppkey); |
||||
PR_HUGE(ps_fp, &part->s[i].qty); |
||||
PR_MONEY(ps_fp, &part->s[i].scost); |
||||
PR_VSTR_LAST(ps_fp, part->s[i].comment,part->s[i].clen); |
||||
PR_END(ps_fp); |
||||
} |
||||
|
||||
return(0); |
||||
} |
||||
|
||||
/*
|
||||
* print the given part *and* its suppliers |
||||
*/ |
||||
int |
||||
pr_part_psupp(part_t *part, int mode) |
||||
{ |
||||
tdefs[PART].name = tdefs[PART_PSUPP].name; |
||||
pr_part(part, mode); |
||||
pr_psupp(part, mode); |
||||
|
||||
return(0); |
||||
} |
||||
|
||||
int |
||||
pr_supp(supplier_t *supp, int mode) |
||||
{ |
||||
static FILE *fp = NULL; |
||||
|
||||
if (fp == NULL) |
||||
fp = print_prep(SUPP, mode); |
||||
|
||||
PR_STRT(fp); |
||||
PR_HUGE(fp, &supp->suppkey); |
||||
PR_STR(fp, supp->name, S_NAME_LEN); |
||||
PR_VSTR(fp, supp->address, supp->alen); |
||||
PR_HUGE(fp, &supp->nation_code); |
||||
PR_STR(fp, supp->phone, PHONE_LEN); |
||||
PR_MONEY(fp, &supp->acctbal); |
||||
PR_VSTR_LAST(fp, supp->comment, supp->clen); |
||||
PR_END(fp); |
||||
|
||||
return(0); |
||||
} |
||||
|
||||
int |
||||
pr_nation(code_t *c, int mode) |
||||
{ |
||||
static FILE *fp = NULL; |
||||
|
||||
if (fp == NULL) |
||||
fp = print_prep(NATION, mode); |
||||
|
||||
PR_STRT(fp); |
||||
PR_HUGE(fp, &c->code); |
||||
PR_STR(fp, c->text, NATION_LEN); |
||||
PR_INT(fp, c->join); |
||||
PR_VSTR_LAST(fp, c->comment, c->clen); |
||||
PR_END(fp); |
||||
|
||||
return(0); |
||||
} |
||||
|
||||
int |
||||
pr_region(code_t *c, int mode) |
||||
{ |
||||
static FILE *fp = NULL; |
||||
|
||||
if (fp == NULL) |
||||
fp = print_prep(REGION, mode); |
||||
|
||||
PR_STRT(fp); |
||||
PR_HUGE(fp, &c->code); |
||||
PR_STR(fp, c->text, REGION_LEN); |
||||
PR_VSTR_LAST(fp, c->comment, c->clen); |
||||
PR_END(fp); |
||||
|
||||
return(0); |
||||
} |
||||
|
||||
/*
|
||||
* NOTE: this routine does NOT use the BCD2_* routines. As a result, |
||||
* it WILL fail if the keys being deleted exceed 32 bits. Since this |
||||
* would require ~660 update iterations, this seems an acceptable |
||||
* oversight |
||||
*/ |
||||
int |
||||
pr_drange(int tbl, DSS_HUGE min, DSS_HUGE cnt, long num) |
||||
{ |
||||
static int last_num = 0; |
||||
static FILE *dfp = NULL; |
||||
DSS_HUGE child = -1; |
||||
DSS_HUGE start, last, new; |
||||
|
||||
static DSS_HUGE rows_per_segment=0; |
||||
static DSS_HUGE rows_this_segment=0; |
||||
|
||||
if (last_num != num) |
||||
{ |
||||
if (dfp) |
||||
fclose(dfp); |
||||
dfp = print_prep(tbl, -num); |
||||
if (dfp == NULL) |
||||
return(-1); |
||||
last_num = num; |
||||
rows_this_segment=0; |
||||
} |
||||
|
||||
start = MK_SPARSE(min, num/ (10000 / UPD_PCT)); |
||||
last = start - 1; |
||||
for (child=min; cnt > 0; child++, cnt--) |
||||
{ |
||||
new = MK_SPARSE(child, num/ (10000 / UPD_PCT)); |
||||
if (delete_segments) |
||||
{ |
||||
|
||||
if(rows_per_segment==0)
|
||||
rows_per_segment = (cnt / delete_segments) + 1; |
||||
if((++rows_this_segment) > rows_per_segment) |
||||
{ |
||||
fclose(dfp); |
||||
dfp = print_prep(tbl, -num); |
||||
if (dfp == NULL) return(-1); |
||||
last_num = num; |
||||
rows_this_segment=1; |
||||
} |
||||
} |
||||
PR_STRT(dfp); |
||||
PR_HUGE_LAST(dfp, &new); |
||||
PR_END(dfp); |
||||
start = new; |
||||
last = new; |
||||
} |
||||
|
||||
return(0); |
||||
} |
||||
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
@ -0,0 +1,489 @@ |
||||
/*
|
||||
* $Id: qgen.c,v 1.3 2005/10/28 02:54:35 jms Exp $ |
||||
* |
||||
* Revision History |
||||
* =================== |
||||
* $Log: qgen.c,v $ |
||||
* Revision 1.3 2005/10/28 02:54:35 jms |
||||
* add release.h changes |
||||
* |
||||
* Revision 1.2 2005/01/03 20:08:59 jms |
||||
* change line terminations |
||||
* |
||||
* Revision 1.1.1.1 2004/11/24 23:31:47 jms |
||||
* re-establish external server |
||||
* |
||||
* Revision 1.1.1.1 2003/04/03 18:54:21 jms |
||||
* recreation after CVS crash |
||||
* |
||||
* Revision 1.1.1.1 2003/04/03 18:54:21 jms |
||||
* initial checkin |
||||
* |
||||
* |
||||
*/ |
||||
/*
|
||||
* qgen.c -- routines to convert query templates to executable query |
||||
* text for TPC-H and TPC-R |
||||
*/ |
||||
#define DECLARER |
||||
|
||||
#include <stdio.h> |
||||
#include <string.h> |
||||
#if (defined(_POSIX_)||!defined(WIN32)) |
||||
#include <unistd.h> |
||||
#else |
||||
#include "process.h" |
||||
#endif /* WIN32 */ |
||||
#include <ctype.h> |
||||
#include <time.h> |
||||
#include "config.h" |
||||
#include "dss.h" |
||||
#include "tpcd.h" |
||||
#include "permute.h" |
||||
#include "release.h" |
||||
|
||||
|
||||
#define LINE_SIZE 512 |
||||
|
||||
/*
|
||||
* Function Protoypes |
||||
*/ |
||||
void varsub PROTO((int qnum, int vnum, int flags)); |
||||
int strip_comments PROTO((char *line)); |
||||
void usage PROTO((void)); |
||||
int process_options PROTO((int cnt, char **args)); |
||||
int setup PROTO((void)); |
||||
void qsub PROTO((char *qtag, int flags)); |
||||
|
||||
|
||||
|
||||
extern char *optarg; |
||||
extern int optind; |
||||
char **mk_ascdate(void); |
||||
extern seed_t Seed[]; |
||||
|
||||
char **asc_date; |
||||
int snum = -1; |
||||
char *prog; |
||||
tdef tdefs = { NULL }; |
||||
long rndm; |
||||
double flt_scale; |
||||
distribution q13a, q13b; |
||||
int qnum; |
||||
char *db_name = NULL; |
||||
|
||||
|
||||
/*
|
||||
* FUNCTION strip_comments(line) |
||||
* |
||||
* remove all comments from 'line'; recognizes both {} and -- comments |
||||
*/ |
||||
int |
||||
strip_comments(char *line) |
||||
{ |
||||
static int in_comment = 0; |
||||
char *cp1, *cp2; |
||||
|
||||
cp1 = line; |
||||
|
||||
while (1) /* traverse the entire string */ |
||||
{ |
||||
if (in_comment) |
||||
{ |
||||
if ((cp2 = strchr(cp1, '}')) != NULL) /* comment ends */ |
||||
{ |
||||
strcpy(cp1, cp2 + 1); |
||||
in_comment = 0; |
||||
continue; |
||||
} |
||||
else
|
||||
{ |
||||
*cp1 = '\0'; |
||||
break; |
||||
} |
||||
} |
||||
else /* not in_comment */ |
||||
{ |
||||
if ((cp2 = strchr(cp1, '-')) != NULL) |
||||
{ |
||||
if (*(cp2 + 1) == '-') /* found a '--' comment */ |
||||
{ |
||||
*cp2 = '\0'; |
||||
break; |
||||
} |
||||
} |
||||
if ((cp2 = strchr(cp1, '{')) != NULL) /* comment starts */ |
||||
{ |
||||
in_comment = 1; |
||||
*cp2 = ' '; |
||||
continue; |
||||
} |
||||
else break; |
||||
} |
||||
} |
||||
return(0); |
||||
} |
||||
|
||||
/*
|
||||
* FUNCTION qsub(char *qtag, int flags) |
||||
* |
||||
* based on the settings of flags, and the template file $QDIR/qtag.sql |
||||
* make the following substitutions to turn a query template into EQT |
||||
* |
||||
* String Converted to Based on |
||||
* ====== ============ =========== |
||||
* first line database <db_name>; -n from command line |
||||
* second line set explain on; -x from command line |
||||
* :<number> parameter <number> |
||||
* :k set number |
||||
* :o output to outpath/qnum.snum
|
||||
* -o from command line, SET_OUTPUT |
||||
* :s stream number |
||||
* :b BEGIN WORK; -a from command line, START_TRAN |
||||
* :e COMMIT WORK; -a from command line, END_TRAN |
||||
* :q query number |
||||
* :n<number> sets rowcount to be returned |
||||
*/ |
||||
void |
||||
qsub(char *qtag, int flags) |
||||
{ |
||||
static char *line = NULL, |
||||
*qpath = NULL; |
||||
FILE *qfp; |
||||
char *cptr, |
||||
*mark, |
||||
*qroot = NULL; |
||||
|
||||
qnum = atoi(qtag); |
||||
if (line == NULL) |
||||
{ |
||||
line = malloc(BUFSIZ); |
||||
qpath = malloc(BUFSIZ); |
||||
MALLOC_CHECK(line); |
||||
MALLOC_CHECK(qpath); |
||||
} |
||||
|
||||
qroot = env_config(QDIR_TAG, QDIR_DFLT); |
||||
sprintf(qpath, "%s%c%s.sql",
|
||||
qroot, PATH_SEP, qtag); |
||||
qfp = fopen(qpath, "r"); |
||||
OPEN_CHECK(qfp, qpath); |
||||
|
||||
rowcnt = rowcnt_dflt[qnum]; |
||||
varsub(qnum, 0, flags); /* set the variables */ |
||||
if (flags & DFLT_NUM) |
||||
fprintf(ofp, SET_ROWCOUNT, rowcnt); |
||||
while (fgets(line, BUFSIZ, qfp) != NULL) |
||||
{ |
||||
if (!(flags & COMMENT)) |
||||
strip_comments(line); |
||||
mark = line; |
||||
while ((cptr = strchr(mark, VTAG)) != NULL) |
||||
{ |
||||
*cptr = '\0'; |
||||
cptr++; |
||||
fprintf(ofp,"%s", mark); |
||||
switch(*cptr) |
||||
{ |
||||
case 'b': |
||||
case 'B': |
||||
if (!(flags & ANSI)) |
||||
fprintf(ofp,"%s\n", START_TRAN); |
||||
cptr++; |
||||
break; |
||||
case 'c': |
||||
case 'C': |
||||
if (flags & DBASE) |
||||
fprintf(ofp, SET_DBASE, db_name); |
||||
cptr++; |
||||
break; |
||||
case 'e': |
||||
case 'E': |
||||
if (!(flags & ANSI)) |
||||
fprintf(ofp,"%s\n", END_TRAN); |
||||
cptr++; |
||||
break; |
||||
case 'n': |
||||
case 'N': |
||||
if (!(flags & DFLT_NUM)) |
||||
{ |
||||
rowcnt=atoi(++cptr); |
||||
while (isdigit(*cptr) || *cptr == ' ') cptr++; |
||||
fprintf(ofp, SET_ROWCOUNT, rowcnt); |
||||
} |
||||
continue; |
||||
case 'o': |
||||
case 'O': |
||||
if (flags & OUTPUT) |
||||
fprintf(ofp,"%s '%s/%s.%d'", SET_OUTPUT, osuff,
|
||||
qtag, (snum < 0)?0:snum); |
||||
cptr++; |
||||
break; |
||||
case 'q': |
||||
case 'Q': |
||||
fprintf(ofp,"%s", qtag); |
||||
cptr++; |
||||
break; |
||||
case 's': |
||||
case 'S': |
||||
fprintf(ofp,"%d", (snum < 0)?0:snum); |
||||
cptr++; |
||||
break; |
||||
case 'X': |
||||
case 'x': |
||||
if (flags & EXPLAIN) |
||||
fprintf(ofp, "%s\n", GEN_QUERY_PLAN); |
||||
cptr++; |
||||
break; |
||||
case '1': |
||||
case '2': |
||||
case '3': |
||||
case '4': |
||||
case '5': |
||||
case '6': |
||||
case '7': |
||||
case '8': |
||||
case '9': |
||||
varsub(qnum, atoi(cptr), flags & DFLT); |
||||
while (isdigit(*++cptr)); |
||||
break; |
||||
default: |
||||
fprintf(stderr, "-- unknown flag '%c%c' ignored\n",
|
||||
VTAG, *cptr); |
||||
cptr++; |
||||
break; |
||||
} |
||||
mark=cptr; |
||||
} |
||||
fprintf(ofp,"%s", mark); |
||||
} |
||||
fclose(qfp); |
||||
fflush(stdout); |
||||
return; |
||||
} |
||||
|
||||
void |
||||
usage(void) |
||||
{ |
||||
printf("%s Parameter Substitution (v. %d.%d.%d build %d)\n",
|
||||
NAME, VERSION,RELEASE, |
||||
PATCH,BUILD); |
||||
printf("Copyright %s %s\n", TPC, C_DATES); |
||||
printf("USAGE: %s <options> [ queries ]\n", prog); |
||||
printf("Options:\n"); |
||||
printf("\t-a\t\t-- use ANSI semantics.\n"); |
||||
printf("\t-b <str>\t-- load distributions from <str>\n"); |
||||
printf("\t-c\t\t-- retain comments found in template.\n"); |
||||
printf("\t-d\t\t-- use default substitution values.\n"); |
||||
printf("\t-h\t\t-- print this usage summary.\n"); |
||||
printf("\t-i <str>\t-- use the contents of file <str> to begin a query.\n"); |
||||
printf("\t-l <str>\t-- log parameters to <str>.\n"); |
||||
printf("\t-n <str>\t-- connect to database <str>.\n"); |
||||
printf("\t-N\t\t-- use default rowcounts and ignore :n directive.\n"); |
||||
printf("\t-o <str>\t-- set the output file base path to <str>.\n"); |
||||
printf("\t-p <n>\t\t-- use the query permutation for stream <n>\n"); |
||||
printf("\t-r <n>\t\t-- seed the random number generator with <n>\n"); |
||||
printf("\t-s <n>\t\t-- base substitutions on an SF of <n>\n"); |
||||
printf("\t-v\t\t-- verbose.\n"); |
||||
printf("\t-t <str>\t-- use the contents of file <str> to complete a query\n"); |
||||
printf("\t-x\t\t-- enable SET EXPLAIN in each query.\n"); |
||||
} |
||||
|
||||
int |
||||
process_options(int cnt, char **args) |
||||
{ |
||||
int flag; |
||||
|
||||
while((flag = getopt(cnt, args, "ab:cdhi:n:Nl:o:p:r:s:t:vx")) != -1) |
||||
switch(flag) |
||||
{ |
||||
case 'a': /* use ANSI semantics */ |
||||
flags |= ANSI; |
||||
break; |
||||
case 'b': /* load distributions from named file */ |
||||
d_path = (char *)malloc((int)strlen(optarg) + 1); |
||||
MALLOC_CHECK(d_path); |
||||
strcpy(d_path, optarg); |
||||
break; |
||||
case 'c': /* retain comments in EQT */ |
||||
flags |= COMMENT; |
||||
break; |
||||
case 'd': /* use default substitution values */ |
||||
flags |= DFLT; |
||||
break; |
||||
case 'h': /* just generate the usage summary */ |
||||
usage(); |
||||
exit(0); |
||||
break; |
||||
case 'i': /* set stream initialization file name */ |
||||
ifile = malloc((int)strlen(optarg) + 1); |
||||
MALLOC_CHECK(ifile); |
||||
strcpy(ifile, optarg); |
||||
flags |= INIT; |
||||
break; |
||||
case 'l': /* log parameter usages */ |
||||
lfile = malloc((int)strlen(optarg) + 1); |
||||
MALLOC_CHECK(lfile); |
||||
strcpy(lfile, optarg); |
||||
flags |= LOG; |
||||
break; |
||||
case 'N': /* use default rowcounts */ |
||||
flags |= DFLT_NUM; |
||||
break; |
||||
case 'n': /* set database name */ |
||||
db_name = malloc((int)strlen(optarg) + 1); |
||||
MALLOC_CHECK(db_name); |
||||
strcpy(db_name, optarg); |
||||
flags |= DBASE; |
||||
break; |
||||
case 'o': /* set the output path */ |
||||
osuff = malloc((int)strlen(optarg) + 1); |
||||
MALLOC_CHECK(osuff); |
||||
strcpy(osuff, optarg); |
||||
flags |=OUTPUT; |
||||
break; |
||||
case 'p': /* permutation for a given stream */ |
||||
snum = atoi(optarg); |
||||
break; |
||||
case 'r': /* set random number seed for parameter gen */ |
||||
flags |= SEED; |
||||
rndm = atol(optarg); |
||||
break; |
||||
case 's': /* scale of data set to run against */ |
||||
flt_scale = atof(optarg); |
||||
if (scale > MAX_SCALE) |
||||
fprintf(stderr, "%s %5.0f %s\n%s\n", |
||||
"WARNING: Support for scale factors >", |
||||
MAX_SCALE, |
||||
"GB is still in development.", |
||||
"Data set integrity is not guaranteed.\n"); |
||||
break; |
||||
case 't': /* set termination file name */ |
||||
tfile = malloc((int)strlen(optarg) + 1); |
||||
MALLOC_CHECK(tfile); |
||||
strcpy(tfile, optarg); |
||||
flags |= TERMINATE; |
||||
break; |
||||
case 'v': /* verbose */ |
||||
flags |= VERBOSE; |
||||
break; |
||||
case 'x': /* set explain in the queries */ |
||||
flags |= EXPLAIN; |
||||
break; |
||||
default: |
||||
printf("unknown option '%s' ignored\n", args[optind]); |
||||
usage(); |
||||
exit(1); |
||||
break; |
||||
} |
||||
return(0); |
||||
} |
||||
|
||||
int |
||||
setup(void) |
||||
{ |
||||
asc_date = mk_ascdate(); |
||||
read_dist(env_config(DIST_TAG, DIST_DFLT), "p_cntr", &p_cntr_set); |
||||
read_dist(env_config(DIST_TAG, DIST_DFLT), "colors", &colors); |
||||
read_dist(env_config(DIST_TAG, DIST_DFLT), "p_types", &p_types_set); |
||||
read_dist(env_config(DIST_TAG, DIST_DFLT), "nations", &nations); |
||||
read_dist(env_config(DIST_TAG, DIST_DFLT), "nations2", &nations2); |
||||
read_dist(env_config(DIST_TAG, DIST_DFLT), "regions", ®ions); |
||||
read_dist(env_config(DIST_TAG, DIST_DFLT), "o_oprio",
|
||||
&o_priority_set); |
||||
read_dist(env_config(DIST_TAG, DIST_DFLT), "instruct",
|
||||
&l_instruct_set); |
||||
read_dist(env_config(DIST_TAG, DIST_DFLT), "smode", &l_smode_set); |
||||
read_dist(env_config(DIST_TAG, DIST_DFLT), "category",
|
||||
&l_category_set); |
||||
read_dist(env_config(DIST_TAG, DIST_DFLT), "rflag", &l_rflag_set); |
||||
read_dist(env_config(DIST_TAG, DIST_DFLT), "msegmnt", &c_mseg_set); |
||||
read_dist(env_config(DIST_TAG, DIST_DFLT), "Q13a", &q13a); |
||||
read_dist(env_config(DIST_TAG, DIST_DFLT), "Q13b", &q13b); |
||||
|
||||
return(0); |
||||
} |
||||
|
||||
|
||||
int main(int ac, char **av) |
||||
{ |
||||
int i; |
||||
FILE *ifp; |
||||
char line[LINE_SIZE]; |
||||
|
||||
prog = av[0]; |
||||
flt_scale = (double)1.0; |
||||
flags = 0; |
||||
d_path = NULL; |
||||
process_options(ac, av); |
||||
if (flags & VERBOSE) |
||||
fprintf(ofp,
|
||||
"-- TPC %s Parameter Substitution (Version %d.%d.%d build %d)\n", |
||||
NAME, VERSION, RELEASE, PATCH, BUILD); |
||||
|
||||
setup(); |
||||
|
||||
if (!(flags & DFLT)) /* perturb the RNG */ |
||||
{ |
||||
if (!(flags & SEED)) |
||||
rndm = (long)((unsigned)time(NULL)); |
||||
if (rndm < 0) |
||||
rndm += 2147483647; |
||||
Seed[0].value = rndm; |
||||
for (i=1; i <= QUERIES_PER_SET; i++) |
||||
{ |
||||
Seed[0].value = NextRand(Seed[0].value); |
||||
Seed[i].value = Seed[0].value; |
||||
} |
||||
printf("-- using %ld as a seed to the RNG\n", rndm); |
||||
} |
||||
else |
||||
printf("-- using default substitutions\n"); |
||||
|
||||
if (flags & INIT) /* init stream with ifile */ |
||||
{ |
||||
ifp = fopen(ifile, "r"); |
||||
OPEN_CHECK(ifp, ifile); |
||||
while (fgets(line, LINE_SIZE, ifp) != NULL) |
||||
fprintf(stdout, "%s", line); |
||||
} |
||||
|
||||
if (snum >= 0) |
||||
if (optind < ac) |
||||
for (i=optind; i < ac; i++) |
||||
{ |
||||
char qname[10]; |
||||
sprintf(qname, "%d", SEQUENCE(snum, atoi(av[i]))); |
||||
qsub(qname, flags); |
||||
} |
||||
else |
||||
for (i=1; i <= QUERIES_PER_SET; i++) |
||||
{ |
||||
char qname[10]; |
||||
sprintf(qname, "%d", SEQUENCE(snum, i)); |
||||
qsub(qname, flags); |
||||
} |
||||
else |
||||
if (optind < ac) |
||||
for (i=optind; i < ac; i++) |
||||
qsub(av[i], flags);
|
||||
else |
||||
for (i=1; i <= QUERIES_PER_SET; i++) |
||||
{ |
||||
char qname[10]; |
||||
sprintf(qname, "%d", i); |
||||
qsub(qname, flags); |
||||
} |
||||
|
||||
if (flags & TERMINATE) /* terminate stream with tfile */ |
||||
{ |
||||
ifp = fopen(tfile, "r"); |
||||
if (ifp == NULL) |
||||
OPEN_CHECK(ifp, tfile); |
||||
while (fgets(line, LINE_SIZE, ifp) != NULL) |
||||
fprintf(stdout, "%s", line); |
||||
} |
||||
|
||||
return(0); |
||||
} |
||||
|
Binary file not shown.
@ -0,0 +1,265 @@ |
||||
<?xml version="1.0" encoding="Windows-1252"?> |
||||
<VisualStudioProject |
||||
ProjectType="Visual C++" |
||||
Version="8.00" |
||||
Name="qgen" |
||||
ProjectGUID="{9BAF8942-2DFD-4BD1-B5ED-DBDDF0169E22}" |
||||
RootNamespace="qgen" |
||||
> |
||||
<Platforms> |
||||
<Platform |
||||
Name="Win32" |
||||
/> |
||||
</Platforms> |
||||
<ToolFiles> |
||||
</ToolFiles> |
||||
<Configurations> |
||||
<Configuration |
||||
Name="Debug|Win32" |
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)" |
||||
IntermediateDirectory="$(ConfigurationName)" |
||||
ConfigurationType="1" |
||||
CharacterSet="2" |
||||
> |
||||
<Tool |
||||
Name="VCPreBuildEventTool" |
||||
/> |
||||
<Tool |
||||
Name="VCCustomBuildTool" |
||||
/> |
||||
<Tool |
||||
Name="VCXMLDataGeneratorTool" |
||||
/> |
||||
<Tool |
||||
Name="VCWebServiceProxyGeneratorTool" |
||||
/> |
||||
<Tool |
||||
Name="VCMIDLTool" |
||||
/> |
||||
<Tool |
||||
Name="VCCLCompilerTool" |
||||
Optimization="0" |
||||
PreprocessorDefinitions="WIN32;TPCH;SQLSERVER;_CRT_SECURE_NO_WARNINGS" |
||||
MinimalRebuild="true" |
||||
BasicRuntimeChecks="3" |
||||
RuntimeLibrary="3" |
||||
WarningLevel="3" |
||||
Detect64BitPortabilityProblems="true" |
||||
DebugInformationFormat="4" |
||||
/> |
||||
<Tool |
||||
Name="VCManagedResourceCompilerTool" |
||||
/> |
||||
<Tool |
||||
Name="VCResourceCompilerTool" |
||||
/> |
||||
<Tool |
||||
Name="VCPreLinkEventTool" |
||||
/> |
||||
<Tool |
||||
Name="VCLinkerTool" |
||||
GenerateDebugInformation="true" |
||||
TargetMachine="1" |
||||
/> |
||||
<Tool |
||||
Name="VCALinkTool" |
||||
/> |
||||
<Tool |
||||
Name="VCManifestTool" |
||||
/> |
||||
<Tool |
||||
Name="VCXDCMakeTool" |
||||
/> |
||||
<Tool |
||||
Name="VCBscMakeTool" |
||||
/> |
||||
<Tool |
||||
Name="VCFxCopTool" |
||||
/> |
||||
<Tool |
||||
Name="VCAppVerifierTool" |
||||
/> |
||||
<Tool |
||||
Name="VCWebDeploymentTool" |
||||
/> |
||||
<Tool |
||||
Name="VCPostBuildEventTool" |
||||
/> |
||||
</Configuration> |
||||
<Configuration |
||||
Name="Release|Win32" |
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)" |
||||
IntermediateDirectory="$(ConfigurationName)" |
||||
ConfigurationType="1" |
||||
CharacterSet="2" |
||||
WholeProgramOptimization="1" |
||||
> |
||||
<Tool |
||||
Name="VCPreBuildEventTool" |
||||
/> |
||||
<Tool |
||||
Name="VCCustomBuildTool" |
||||
/> |
||||
<Tool |
||||
Name="VCXMLDataGeneratorTool" |
||||
/> |
||||
<Tool |
||||
Name="VCWebServiceProxyGeneratorTool" |
||||
/> |
||||
<Tool |
||||
Name="VCMIDLTool" |
||||
/> |
||||
<Tool |
||||
Name="VCCLCompilerTool" |
||||
RuntimeLibrary="2" |
||||
WarningLevel="3" |
||||
Detect64BitPortabilityProblems="true" |
||||
DebugInformationFormat="3" |
||||
/> |
||||
<Tool |
||||
Name="VCManagedResourceCompilerTool" |
||||
/> |
||||
<Tool |
||||
Name="VCResourceCompilerTool" |
||||
/> |
||||
<Tool |
||||
Name="VCPreLinkEventTool" |
||||
/> |
||||
<Tool |
||||
Name="VCLinkerTool" |
||||
GenerateDebugInformation="true" |
||||
OptimizeReferences="2" |
||||
EnableCOMDATFolding="2" |
||||
TargetMachine="1" |
||||
/> |
||||
<Tool |
||||
Name="VCALinkTool" |
||||
/> |
||||
<Tool |
||||
Name="VCManifestTool" |
||||
/> |
||||
<Tool |
||||
Name="VCXDCMakeTool" |
||||
/> |
||||
<Tool |
||||
Name="VCBscMakeTool" |
||||
/> |
||||
<Tool |
||||
Name="VCFxCopTool" |
||||
/> |
||||
<Tool |
||||
Name="VCAppVerifierTool" |
||||
/> |
||||
<Tool |
||||
Name="VCWebDeploymentTool" |
||||
/> |
||||
<Tool |
||||
Name="VCPostBuildEventTool" |
||||
/> |
||||
</Configuration> |
||||
</Configurations> |
||||
<References> |
||||
</References> |
||||
<Files> |
||||
<Filter |
||||
Name="Source Files" |
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" |
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" |
||||
> |
||||
<File |
||||
RelativePath=".\bm_utils.c" |
||||
> |
||||
</File> |
||||
<File |
||||
RelativePath=".\build.c" |
||||
> |
||||
</File> |
||||
<File |
||||
RelativePath=".\permute.c" |
||||
> |
||||
</File> |
||||
<File |
||||
RelativePath=".\print.c" |
||||
> |
||||
</File> |
||||
<File |
||||
RelativePath=".\qgen.c" |
||||
> |
||||
</File> |
||||
<File |
||||
RelativePath=".\rnd.c" |
||||
> |
||||
</File> |
||||
<File |
||||
RelativePath=".\rng64.c" |
||||
> |
||||
</File> |
||||
<File |
||||
RelativePath=".\speed_seed.c" |
||||
> |
||||
</File> |
||||
<File |
||||
RelativePath=".\text.c" |
||||
> |
||||
</File> |
||||
<File |
||||
RelativePath=".\varsub.c" |
||||
> |
||||
</File> |
||||
</Filter> |
||||
<Filter |
||||
Name="Header Files" |
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd" |
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" |
||||
> |
||||
<File |
||||
RelativePath=".\config.h" |
||||
> |
||||
</File> |
||||
<File |
||||
RelativePath=".\dss.h" |
||||
> |
||||
</File> |
||||
<File |
||||
RelativePath=".\dsstypes.h" |
||||
> |
||||
</File> |
||||
<File |
||||
RelativePath=".\permute.h" |
||||
> |
||||
</File> |
||||
<File |
||||
RelativePath=".\release.h" |
||||
> |
||||
</File> |
||||
<File |
||||
RelativePath=".\rnd.h" |
||||
> |
||||
</File> |
||||
<File |
||||
RelativePath=".\rng64.h" |
||||
> |
||||
</File> |
||||
<File |
||||
RelativePath=".\seed.h" |
||||
> |
||||
</File> |
||||
<File |
||||
RelativePath=".\shared.h" |
||||
> |
||||
</File> |
||||
<File |
||||
RelativePath=".\tpcd.h" |
||||
> |
||||
</File> |
||||
</Filter> |
||||
<Filter |
||||
Name="Resource Files" |
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" |
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" |
||||
> |
||||
</Filter> |
||||
</Files> |
||||
<Globals> |
||||
</Globals> |
||||
</VisualStudioProject> |
@ -0,0 +1,29 @@ |
||||
--begin q01 |
||||
-- $ID$ |
||||
-- TPC-H/TPC-R Pricing Summary Report Query (Q1) |
||||
-- Functional Query Definition |
||||
-- Approved February 1998 |
||||
:x |
||||
:o |
||||
select |
||||
l_returnflag, |
||||
l_linestatus, |
||||
sum(l_quantity) as sum_qty, |
||||
sum(l_extendedprice) as sum_base_price, |
||||
sum(l_extendedprice * (1 - l_discount)) as sum_disc_price, |
||||
sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as sum_charge, |
||||
avg(l_quantity) as avg_qty, |
||||
avg(l_extendedprice) as avg_price, |
||||
avg(l_discount) as avg_disc, |
||||
count(*) as count_order |
||||
from |
||||
tpch.lineitem |
||||
where |
||||
l_shipdate <= ADD_DAYS(DATE '2000-02-28', -:1) |
||||
group by |
||||
l_returnflag, |
||||
l_linestatus |
||||
order by |
||||
l_returnflag, |
||||
l_linestatus; |
||||
--end q01 |
@ -0,0 +1,40 @@ |
||||
--begin q10 |
||||
-- $ID$ |
||||
-- TPC-H/TPC-R Returned Item Reporting Query (Q10) |
||||
-- Functional Query Definition |
||||
-- Approved February 1998 |
||||
:x |
||||
:o |
||||
select |
||||
c_custkey, |
||||
c_name, |
||||
sum(l_extendedprice * (1 - l_discount)) as revenue, |
||||
c_acctbal, |
||||
n_name, |
||||
c_address, |
||||
c_phone, |
||||
c_comment |
||||
from |
||||
tpch.customer, |
||||
tpch.orders, |
||||
tpch.lineitem, |
||||
tpch.nation |
||||
where |
||||
c_custkey = o_custkey |
||||
and l_orderkey = o_orderkey |
||||
and o_orderdate >= date ':1' |
||||
and o_orderdate < ADD_MONTHS(date ':1', 3) |
||||
and l_returnflag = 'R' |
||||
and c_nationkey = n_nationkey |
||||
group by |
||||
c_custkey, |
||||
c_name, |
||||
c_acctbal, |
||||
c_phone, |
||||
n_name, |
||||
c_address, |
||||
c_comment |
||||
order by |
||||
revenue desc; |
||||
:n 20; |
||||
--end q10 |
@ -0,0 +1,35 @@ |
||||
--begin q11 |
||||
-- $ID$ |
||||
-- TPC-H/TPC-R Important Stock Identification Query (Q11) |
||||
-- Functional Query Definition |
||||
-- Approved February 1998 |
||||
:x |
||||
:o |
||||
select |
||||
ps_partkey, |
||||
sum(ps_supplycost * ps_availqty) as val |
||||
from |
||||
tpch.partsupp, |
||||
tpch.supplier, |
||||
tpch.nation |
||||
where |
||||
ps_suppkey = s_suppkey |
||||
and s_nationkey = n_nationkey |
||||
and n_name = ':1' |
||||
group by |
||||
ps_partkey having |
||||
sum(ps_supplycost * ps_availqty) > ( |
||||
select |
||||
sum(ps_supplycost * ps_availqty) * :2 |
||||
from |
||||
tpch.partsupp, |
||||
tpch.supplier, |
||||
tpch.nation |
||||
where |
||||
ps_suppkey = s_suppkey |
||||
and s_nationkey = n_nationkey |
||||
and n_name = ':1' |
||||
) |
||||
order by |
||||
val desc; |
||||
--end q11 |
@ -0,0 +1,36 @@ |
||||
--begin q12 |
||||
-- $ID$ |
||||
-- TPC-H/TPC-R Shipping Modes and Order Priority Query (Q12) |
||||
-- Functional Query Definition |
||||
-- Approved February 1998 |
||||
:x |
||||
:o |
||||
select |
||||
l_shipmode, |
||||
sum(case |
||||
when o_orderpriority = '1-URGENT' |
||||
or o_orderpriority = '2-HIGH' |
||||
then 1 |
||||
else 0 |
||||
end) as high_line_count, |
||||
sum(case |
||||
when o_orderpriority <> '1-URGENT' |
||||
and o_orderpriority <> '2-HIGH' |
||||
then 1 |
||||
else 0 |
||||
end) as low_line_count |
||||
from |
||||
tpch.orders, |
||||
tpch.lineitem |
||||
where |
||||
o_orderkey = l_orderkey |
||||
and l_shipmode in (':1', ':2') |
||||
and l_commitdate < l_receiptdate |
||||
and l_shipdate < l_commitdate |
||||
and l_receiptdate >= date ':3' |
||||
and l_receiptdate < ADD_YEARS(DATE ':3', 1) |
||||
group by |
||||
l_shipmode |
||||
order by |
||||
l_shipmode; |
||||
--end q12 |
@ -0,0 +1,28 @@ |
||||
--begin q13 |
||||
-- $ID$ |
||||
-- TPC-H/TPC-R Customer Distribution Query (Q13) |
||||
-- Functional Query Definition |
||||
-- Approved February 1998 |
||||
:x |
||||
:o |
||||
select |
||||
c_count, |
||||
count(*) as custdist |
||||
from |
||||
( |
||||
select |
||||
c_custkey, |
||||
count(o_orderkey) |
||||
from |
||||
tpch.customer left outer join tpch.orders on |
||||
c_custkey = o_custkey |
||||
and o_comment not like '%:1%:2%' |
||||
group by |
||||
c_custkey |
||||
) as c_orders (c_custkey, c_count) |
||||
group by |
||||
c_count |
||||
order by |
||||
custdist desc, |
||||
c_count desc; |
||||
--end q13 |
@ -0,0 +1,21 @@ |
||||
--begin q14 |
||||
-- $ID$ |
||||
-- TPC-H/TPC-R Promotion Effect Query (Q14) |
||||
-- Functional Query Definition |
||||
-- Approved February 1998 |
||||
:x |
||||
:o |
||||
select |
||||
100.00 * sum(case |
||||
when p_type like 'PROMO%' |
||||
then l_extendedprice * (1 - l_discount) |
||||
else 0 |
||||
end) / sum(l_extendedprice * (1 - l_discount)) as promo_revenue |
||||
from |
||||
tpch.lineitem, |
||||
tpch.part |
||||
where |
||||
l_partkey = p_partkey |
||||
and l_shipdate >= date ':1' |
||||
and l_shipdate < ADD_MONTHS(date ':1', 1); |
||||
--end q14 |
@ -0,0 +1,38 @@ |
||||
--begin q15 |
||||
-- $ID$ |
||||
-- TPC-H/TPC-R Top Supplier Query (Q15) |
||||
-- Variant A |
||||
-- Approved February 1998 |
||||
:x |
||||
:o |
||||
with revenue (supplier_no, total_revenue) as ( |
||||
select |
||||
l_suppkey, |
||||
sum(l_extendedprice * (1-l_discount)) |
||||
from |
||||
tpch.lineitem |
||||
where |
||||
l_shipdate >= date ':1' |
||||
and l_shipdate < ADD_MONTHS(date':1', 3) |
||||
group by |
||||
l_suppkey |
||||
) |
||||
select |
||||
s_suppkey, |
||||
s_name, |
||||
s_address, |
||||
s_phone, |
||||
total_revenue |
||||
from |
||||
tpch.supplier, |
||||
revenue |
||||
where |
||||
s_suppkey = supplier_no |
||||
and total_revenue = ( |
||||
select |
||||
max(total_revenue) |
||||
from |
||||
revenue |
||||
) |
||||
order by |
||||
s_suppkey; |
@ -0,0 +1,38 @@ |
||||
--begin q16 |
||||
-- $ID$ |
||||
-- TPC-H/TPC-R Parts/Supplier Relationship Query (Q16) |
||||
-- Functional Query Definition |
||||
-- Approved February 1998 |
||||
:x |
||||
:o |
||||
select |
||||
p_brand, |
||||
p_type, |
||||
p_size, |
||||
count(distinct ps_suppkey) as supplier_cnt |
||||
from |
||||
tpch.partsupp, |
||||
tpch.part |
||||
where |
||||
p_partkey = ps_partkey |
||||
and p_brand <> ':1' |
||||
and p_type not like ':2%' |
||||
and p_size in (:3, :4, :5, :6, :7, :8, :9, :10) |
||||
and ps_suppkey not in ( |
||||
select |
||||
s_suppkey |
||||
from |
||||
tpch.supplier |
||||
where |
||||
s_comment like '%Customer%Complaints%' |
||||
) |
||||
group by |
||||
p_brand, |
||||
p_type, |
||||
p_size |
||||
order by |
||||
supplier_cnt desc, |
||||
p_brand, |
||||
p_type, |
||||
p_size; |
||||
--end q16 |
@ -0,0 +1,25 @@ |
||||
--begin q17 |
||||
-- $ID$ |
||||
-- TPC-H/TPC-R Small-Quantity-Order Revenue Query (Q17) |
||||
-- Functional Query Definition |
||||
-- Approved February 1998 |
||||
:x |
||||
:o |
||||
select |
||||
sum(l_extendedprice) / 7.0 as avg_yearly |
||||
from |
||||
tpch.lineitem, |
||||
tpch.part |
||||
where |
||||
p_partkey = l_partkey |
||||
and p_brand = ':1' |
||||
and p_container = ':2' |
||||
and l_quantity < ( |
||||
select |
||||
0.2 * avg(l_quantity) |
||||
from |
||||
tpch.lineitem |
||||
where |
||||
l_partkey = p_partkey |
||||
); |
||||
--end q17 |
@ -0,0 +1,41 @@ |
||||
--begin q18 |
||||
-- $ID$ |
||||
-- TPC-H/TPC-R Large Volume Customer Query (Q18) |
||||
-- Function Query Definition |
||||
-- Approved February 1998 |
||||
:x |
||||
:o |
||||
select |
||||
c_name, |
||||
c_custkey, |
||||
o_orderkey, |
||||
o_orderdate, |
||||
o_totalprice, |
||||
sum(l_quantity) |
||||
from |
||||
tpch.customer, |
||||
tpch.orders, |
||||
tpch.lineitem |
||||
where |
||||
o_orderkey in ( |
||||
select |
||||
l_orderkey |
||||
from |
||||
tpch.lineitem |
||||
group by |
||||
l_orderkey having |
||||
sum(l_quantity) > :1 |
||||
) |
||||
and c_custkey = o_custkey |
||||
and o_orderkey = l_orderkey |
||||
group by |
||||
c_name, |
||||
c_custkey, |
||||
o_orderkey, |
||||
o_orderdate, |
||||
o_totalprice |
||||
order by |
||||
o_totalprice desc, |
||||
o_orderdate; |
||||
:n 100; |
||||
--end q18 |
@ -0,0 +1,43 @@ |
||||
--begin q19 |
||||
-- $ID$ |
||||
-- TPC-H/TPC-R Discounted Revenue Query (Q19) |
||||
-- Functional Query Definition |
||||
-- Approved February 1998 |
||||
:x |
||||
:o |
||||
select |
||||
sum(l_extendedprice* (1 - l_discount)) as revenue |
||||
from |
||||
tpch.lineitem, |
||||
tpch.part |
||||
where |
||||
( |
||||
p_partkey = l_partkey |
||||
and p_brand = ':1' |
||||
and p_container in ('SM CASE', 'SM BOX', 'SM PACK', 'SM PKG') |
||||
and l_quantity >= :4 and l_quantity <= :4 + 10 |
||||
and p_size between 1 and 5 |
||||
and l_shipmode in ('AIR', 'AIR REG') |
||||
and l_shipinstruct = 'DELIVER IN PERSON' |
||||
) |
||||
or |
||||
( |
||||
p_partkey = l_partkey |
||||
and p_brand = ':2' |
||||
and p_container in ('MED BAG', 'MED BOX', 'MED PKG', 'MED PACK') |
||||
and l_quantity >= :5 and l_quantity <= :5 + 10 |
||||
and p_size between 1 and 10 |
||||
and l_shipmode in ('AIR', 'AIR REG') |
||||
and l_shipinstruct = 'DELIVER IN PERSON' |
||||
) |
||||
or |
||||
( |
||||
p_partkey = l_partkey |
||||
and p_brand = ':3' |
||||
and p_container in ('LG CASE', 'LG BOX', 'LG PACK', 'LG PKG') |
||||
and l_quantity >= :6 and l_quantity <= :6 + 10 |
||||
and p_size between 1 and 15 |
||||
and l_shipmode in ('AIR', 'AIR REG') |
||||
and l_shipinstruct = 'DELIVER IN PERSON' |
||||
); |
||||
--end q19 |
@ -0,0 +1,52 @@ |
||||
--begin q02 |
||||
-- $ID$ |
||||
-- TPC-H/TPC-R Minimum Cost Supplier Query (Q2) |
||||
-- Functional Query Definition |
||||
-- Approved February 1998 |
||||
:x |
||||
:o |
||||
select |
||||
s_acctbal, |
||||
s_name, |
||||
n_name, |
||||
p_partkey, |
||||
p_mfgr, |
||||
s_address, |
||||
s_phone, |
||||
s_comment |
||||
from |
||||
tpch.part, |
||||
tpch.supplier, |
||||
tpch.partsupp, |
||||
tpch.nation, |
||||
tpch.region |
||||
where |
||||
p_partkey = ps_partkey |
||||
and s_suppkey = ps_suppkey |
||||
and p_size = :1 |
||||
and p_type like '%:2' |
||||
and s_nationkey = n_nationkey |
||||
and n_regionkey = r_regionkey |
||||
and r_name = ':3' |
||||
and ps_supplycost = ( |
||||
select |
||||
min(ps_supplycost) |
||||
from |
||||
tpch.partsupp, |
||||
tpch.supplier, |
||||
tpch.nation, |
||||
tpch.region |
||||
where |
||||
p_partkey = ps_partkey |
||||
and s_suppkey = ps_suppkey |
||||
and s_nationkey = n_nationkey |
||||
and n_regionkey = r_regionkey |
||||
and r_name = ':3' |
||||
) |
||||
order by |
||||
s_acctbal desc, |
||||
n_name, |
||||
s_name, |
||||
p_partkey; |
||||
:n 100; |
||||
--end q02 |
@ -0,0 +1,45 @@ |
||||
--begin q20 |
||||
-- $ID$ |
||||
-- TPC-H/TPC-R Potential Part Promotion Query (Q20) |
||||
-- Function Query Definition |
||||
-- Approved February 1998 |
||||
:x |
||||
:o |
||||
select |
||||
s_name, |
||||
s_address |
||||
from |
||||
tpch.supplier, |
||||
tpch.nation |
||||
where |
||||
s_suppkey in ( |
||||
select |
||||
ps_suppkey |
||||
from |
||||
tpch.partsupp |
||||
where |
||||
ps_partkey in ( |
||||
select |
||||
p_partkey |
||||
from |
||||
tpch.part |
||||
where |
||||
p_name like ':1%' |
||||
) |
||||
and ps_availqty > ( |
||||
select |
||||
0.5 * sum(l_quantity) |
||||
from |
||||
tpch.lineitem |
||||
where |
||||
l_partkey = ps_partkey |
||||
and l_suppkey = ps_suppkey |
||||
and l_shipdate >= date ':2' |
||||
and l_shipdate < ADD_YEARS(date ':2', 1) |
||||
) |
||||
) |
||||
and s_nationkey = n_nationkey |
||||
and n_name = ':3' |
||||
order by |
||||
s_name; |
||||
--end q20 |
@ -0,0 +1,48 @@ |
||||
--begin q21 |
||||
-- $ID$ |
||||
-- TPC-H/TPC-R Suppliers Who Kept Orders Waiting Query (Q21) |
||||
-- Functional Query Definition |
||||
-- Approved February 1998 |
||||
:x |
||||
:o |
||||
select |
||||
s_name, |
||||
count(*) as numwait |
||||
from |
||||
tpch.supplier, |
||||
tpch.lineitem l1, |
||||
tpch.orders, |
||||
tpch.nation |
||||
where |
||||
s_suppkey = l1.l_suppkey |
||||
and o_orderkey = l1.l_orderkey |
||||
and o_orderstatus = 'F' |
||||
and l1.l_receiptdate > l1.l_commitdate |
||||
and exists ( |
||||
select |
||||
* |
||||
from |
||||
tpch.lineitem l2 |
||||
where |
||||
l2.l_orderkey = l1.l_orderkey |
||||
and l2.l_suppkey <> l1.l_suppkey |
||||
) |
||||
and not exists ( |
||||
select |
||||
* |
||||
from |
||||
tpch.lineitem l3 |
||||
where |
||||
l3.l_orderkey = l1.l_orderkey |
||||
and l3.l_suppkey <> l1.l_suppkey |
||||
and l3.l_receiptdate > l3.l_commitdate |
||||
) |
||||
and s_nationkey = n_nationkey |
||||
and n_name = ':1' |
||||
group by |
||||
s_name |
||||
order by |
||||
numwait desc, |
||||
s_name; |
||||
:n 100; |
||||
--end q21 |
@ -0,0 +1,45 @@ |
||||
--begin q22 |
||||
-- $ID$ |
||||
-- TPC-H/TPC-R Global Sales Opportunity Query (Q22) |
||||
-- Functional Query Definition |
||||
-- Approved February 1998 |
||||
:x |
||||
:o |
||||
select |
||||
cntrycode, |
||||
count(*) as numcust, |
||||
sum(c_acctbal) as totacctbal |
||||
from |
||||
( |
||||
select |
||||
substring(c_phone from 1 for 2) as cntrycode, |
||||
c_acctbal |
||||
from |
||||
tpch.customer |
||||
where |
||||
substring(c_phone from 1 for 2) in |
||||
(':1', ':2', ':3', ':4', ':5', ':6', ':7') |
||||
and c_acctbal > ( |
||||
select |
||||
avg(c_acctbal) |
||||
from |
||||
tpch.customer |
||||
where |
||||
c_acctbal > 0.00 |
||||
and substring(c_phone from 1 for 2) in |
||||
(':1', ':2', ':3', ':4', ':5', ':6', ':7') |
||||
) |
||||
and not exists ( |
||||
select |
||||
* |
||||
from |
||||
tpch.orders |
||||
where |
||||
o_custkey = c_custkey |
||||
) |
||||
) as custsale |
||||
group by |
||||
cntrycode |
||||
order by |
||||
cntrycode; |
||||
--end q22 |
@ -0,0 +1,31 @@ |
||||
--begin q03 |
||||
-- $ID$ |
||||
-- TPC-H/TPC-R Shipping Priority Query (Q3) |
||||
-- Functional Query Definition |
||||
-- Approved February 1998 |
||||
:x |
||||
:o |
||||
select |
||||
l_orderkey, |
||||
sum(l_extendedprice * (1 - l_discount)) as revenue, |
||||
o_orderdate, |
||||
o_shippriority |
||||
from |
||||
tpch.customer, |
||||
tpch.orders, |
||||
tpch.lineitem |
||||
where |
||||
c_mktsegment = ':1' |
||||
and c_custkey = o_custkey |
||||
and l_orderkey = o_orderkey |
||||
and o_orderdate < date ':2' |
||||
and l_shipdate > date ':2' |
||||
group by |
||||
l_orderkey, |
||||
o_orderdate, |
||||
o_shippriority |
||||
order by |
||||
revenue desc, |
||||
o_orderdate; |
||||
:n 10; |
||||
--end q03 |
@ -0,0 +1,29 @@ |
||||
--begin q04 |
||||
-- $ID$ |
||||
-- TPC-H/TPC-R Order Priority Checking Query (Q4) |
||||
-- Functional Query Definition |
||||
-- Approved February 1998 |
||||
:x |
||||
:o |
||||
select |
||||
o_orderpriority, |
||||
count(*) as order_count |
||||
from |
||||
tpch.orders |
||||
where |
||||
o_orderdate >= date ':1' |
||||
and o_orderdate < ADD_MONTHS(date ':1', 3) |
||||
and exists ( |
||||
select |
||||
* |
||||
from |
||||
tpch.lineitem |
||||
where |
||||
l_orderkey = o_orderkey |
||||
and l_commitdate < l_receiptdate |
||||
) |
||||
group by |
||||
o_orderpriority |
||||
order by |
||||
o_orderpriority; |
||||
--end q04 |
@ -0,0 +1,32 @@ |
||||
--begin q05 |
||||
-- $ID$ |
||||
-- TPC-H/TPC-R Local Supplier Volume Query (Q5) |
||||
-- Functional Query Definition |
||||
-- Approved February 1998 |
||||
:x |
||||
:o |
||||
select |
||||
n_name, |
||||
sum(l_extendedprice * (1 - l_discount)) as revenue |
||||
from |
||||
tpch.customer, |
||||
tpch.orders, |
||||
tpch.lineitem, |
||||
tpch.supplier, |
||||
tpch.nation, |
||||
tpch.region |
||||
where |
||||
c_custkey = o_custkey |
||||
and l_orderkey = o_orderkey |
||||
and l_suppkey = s_suppkey |
||||
and c_nationkey = s_nationkey |
||||
and s_nationkey = n_nationkey |
||||
and n_regionkey = r_regionkey |
||||
and r_name = ':1' |
||||
and o_orderdate >= date ':2' |
||||
and o_orderdate < ADD_YEARS(date ':2', 1) |
||||
group by |
||||
n_name |
||||
order by |
||||
revenue desc; |
||||
--end q05 |
@ -0,0 +1,17 @@ |
||||
--begin q06 |
||||
-- $ID$ |
||||
-- TPC-H/TPC-R Forecasting Revenue Change Query (Q6) |
||||
-- Functional Query Definition |
||||
-- Approved February 1998 |
||||
:x |
||||
:o |
||||
select |
||||
sum(l_extendedprice * l_discount) as revenue |
||||
from |
||||
tpch.lineitem |
||||
where |
||||
l_shipdate >= date ':1' |
||||
and l_shipdate < ADD_YEARS(date ':1', 1) |
||||
and l_discount between :2 - 0.01 and :2 + 0.01 |
||||
and l_quantity < :3; |
||||
--end q06 |
@ -0,0 +1,47 @@ |
||||
--begin q07 |
||||
-- $ID$ |
||||
-- TPC-H/TPC-R Volume Shipping Query (Q7) |
||||
-- Functional Query Definition |
||||
-- Approved February 1998 |
||||
:x |
||||
:o |
||||
select |
||||
supp_nation, |
||||
cust_nation, |
||||
l_year, |
||||
sum(volume) as revenue |
||||
from |
||||
( |
||||
select |
||||
n1.n_name as supp_nation, |
||||
n2.n_name as cust_nation, |
||||
extract(year from l_shipdate) as l_year, |
||||
l_extendedprice * (1 - l_discount) as volume |
||||
from |
||||
tpch.supplier, |
||||
tpch.lineitem, |
||||
tpch.orders, |
||||
tpch.customer, |
||||
tpch.nation n1, |
||||
tpch.nation n2 |
||||
where |
||||
s_suppkey = l_suppkey |
||||
and o_orderkey = l_orderkey |
||||
and c_custkey = o_custkey |
||||
and s_nationkey = n1.n_nationkey |
||||
and c_nationkey = n2.n_nationkey |
||||
and ( |
||||
(n1.n_name = ':1' and n2.n_name = ':2') |
||||
or (n1.n_name = ':2' and n2.n_name = ':1') |
||||
) |
||||
and l_shipdate between date '1995-01-01' and date '1996-12-31' |
||||
) as shipping |
||||
group by |
||||
supp_nation, |
||||
cust_nation, |
||||
l_year |
||||
order by |
||||
supp_nation, |
||||
cust_nation, |
||||
l_year; |
||||
--end q07 |
@ -0,0 +1,45 @@ |
||||
--begin q08 |
||||
-- $ID$ |
||||
-- TPC-H/TPC-R National Market Share Query (Q8) |
||||
-- Functional Query Definition |
||||
-- Approved February 1998 |
||||
:x |
||||
:o |
||||
select |
||||
o_year, |
||||
sum(case |
||||
when nation = ':1' then volume |
||||
else 0 |
||||
end) / sum(volume) as mkt_share |
||||
from |
||||
( |
||||
select |
||||
extract(year from o_orderdate) as o_year, |
||||
l_extendedprice * (1 - l_discount) as volume, |
||||
n2.n_name as nation |
||||
from |
||||
tpch.part, |
||||
tpch.supplier, |
||||
tpch.lineitem, |
||||
tpch.orders, |
||||
tpch.customer, |
||||
tpch.nation n1, |
||||
tpch.nation n2, |
||||
tpch.region |
||||
where |
||||
p_partkey = l_partkey |
||||
and s_suppkey = l_suppkey |
||||
and l_orderkey = o_orderkey |
||||
and o_custkey = c_custkey |
||||
and c_nationkey = n1.n_nationkey |
||||
and n1.n_regionkey = r_regionkey |
||||
and r_name = ':2' |
||||
and s_nationkey = n2.n_nationkey |
||||
and o_orderdate between date '1995-01-01' and date '1996-12-31' |
||||
and p_type = ':3' |
||||
) as all_nations |
||||
group by |
||||
o_year |
||||
order by |
||||
o_year; |
||||
--end q08 |
@ -0,0 +1,40 @@ |
||||
--begin q09 |
||||
-- $ID$ |
||||
-- TPC-H/TPC-R Product Type Profit Measure Query (Q9) |
||||
-- Functional Query Definition |
||||
-- Approved February 1998 |
||||
:x |
||||
:o |
||||
select |
||||
nation, |
||||
o_year, |
||||
sum(amount) as sum_profit |
||||
from |
||||
( |
||||
select |
||||
n_name as nation, |
||||
extract(year from o_orderdate) as o_year, |
||||
l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity as amount |
||||
from |
||||
tpch.part, |
||||
tpch.supplier, |
||||
tpch.lineitem, |
||||
tpch.partsupp, |
||||
tpch.orders, |
||||
tpch.nation |
||||
where |
||||
s_suppkey = l_suppkey |
||||
and ps_suppkey = l_suppkey |
||||
and ps_partkey = l_partkey |
||||
and p_partkey = l_partkey |
||||
and o_orderkey = l_orderkey |
||||
and s_nationkey = n_nationkey |
||||
and p_name like '%:1%' |
||||
) as profit |
||||
group by |
||||
nation, |
||||
o_year |
||||
order by |
||||
nation, |
||||
o_year desc; |
||||
--end q09 |
@ -0,0 +1,22 @@ |
||||
select |
||||
l_returnflag, |
||||
l_linestatus, |
||||
sum(l_quantity) as sum_qty, |
||||
sum(l_extendedprice) as sum_base_price, |
||||
sum(l_extendedprice * (1 - l_discount)) as sum_disc_price, |
||||
sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as sum_charge, |
||||
avg(l_quantity) as avg_qty, |
||||
avg(l_extendedprice) as avg_price, |
||||
avg(l_discount) as avg_disc, |
||||
count(*) as count_order |
||||
from |
||||
tpch.lineitem |
||||
where |
||||
l_shipdate <= '1998-12-01'::timestamp - '90 day'::interval |
||||
group by |
||||
l_returnflag, |
||||
l_linestatus |
||||
order by |
||||
l_returnflag, |
||||
l_linestatus; |
||||
|
@ -0,0 +1,31 @@ |
||||
select |
||||
c_custkey, |
||||
c_name, |
||||
sum(l_extendedprice * (1 - l_discount)) as revenue, |
||||
c_acctbal, |
||||
n_name, |
||||
c_address, |
||||
c_phone, |
||||
c_comment |
||||
from |
||||
tpch.customer, |
||||
tpch.orders, |
||||
tpch.lineitem, |
||||
tpch.nation |
||||
where |
||||
c_custkey = o_custkey |
||||
and l_orderkey = o_orderkey |
||||
and o_orderdate >= ':1'::timestamp |
||||
and o_orderdate < ':1'::timestamp + '3 month'::interval |
||||
and l_returnflag = 'R' |
||||
and c_nationkey = n_nationkey |
||||
group by |
||||
c_custkey, |
||||
c_name, |
||||
c_acctbal, |
||||
c_phone, |
||||
n_name, |
||||
c_address, |
||||
c_comment |
||||
order by |
||||
revenue desc; |
@ -0,0 +1,27 @@ |
||||
select |
||||
ps_partkey, |
||||
sum(ps_supplycost * ps_availqty) as value |
||||
from |
||||
tpch.partsupp, |
||||
tpch.supplier, |
||||
tpch.nation |
||||
where |
||||
ps_suppkey = s_suppkey |
||||
and s_nationkey = n_nationkey |
||||
and n_name = ':1' |
||||
group by |
||||
ps_partkey having |
||||
sum(ps_supplycost * ps_availqty) > ( |
||||
select |
||||
sum(ps_supplycost * ps_availqty) * :2 |
||||
from |
||||
tpch.partsupp, |
||||
tpch.supplier, |
||||
tpch.nation |
||||
where |
||||
ps_suppkey = s_suppkey |
||||
and s_nationkey = n_nationkey |
||||
and n_name = ':1' |
||||
) |
||||
order by |
||||
value desc; |
@ -0,0 +1,28 @@ |
||||
select |
||||
l_shipmode, |
||||
sum(case |
||||
when o_orderpriority = '1-URGENT' |
||||
or o_orderpriority = '2-HIGH' |
||||
then 1 |
||||
else 0 |
||||
end) as high_line_count, |
||||
sum(case |
||||
when o_orderpriority <> '1-URGENT' |
||||
and o_orderpriority <> '2-HIGH' |
||||
then 1 |
||||
else 0 |
||||
end) as low_line_count |
||||
from |
||||
tpch.orders, |
||||
tpch.lineitem |
||||
where |
||||
o_orderkey = l_orderkey |
||||
and l_shipmode in (':1', ':2') |
||||
and l_commitdate < l_receiptdate |
||||
and l_shipdate < l_commitdate |
||||
and l_receiptdate >= ':3'::timestamp |
||||
and l_receiptdate < ':3'::timestamp + '1 year'::interval |
||||
group by |
||||
l_shipmode |
||||
order by |
||||
l_shipmode; |
@ -0,0 +1,20 @@ |
||||
select |
||||
c_count, |
||||
count(*) as custdist |
||||
from |
||||
( |
||||
select |
||||
c_custkey, |
||||
count(o_orderkey) |
||||
from |
||||
tpch.customer left outer join tpch.orders on |
||||
c_custkey = o_custkey |
||||
and o_comment not like '%:1%:2%' |
||||
group by |
||||
c_custkey |
||||
) as c_orders (c_custkey, c_count) |
||||
group by |
||||
c_count |
||||
order by |
||||
custdist desc, |
||||
c_count desc; |
@ -0,0 +1,13 @@ |
||||
select |
||||
100.00 * sum(case |
||||
when p_type like 'PROMO%' |
||||
then l_extendedprice * (1 - l_discount) |
||||
else 0 |
||||
end) / sum(l_extendedprice * (1 - l_discount)) as promo_revenue |
||||
from |
||||
tpch.lineitem, |
||||
tpch.part |
||||
where |
||||
l_partkey = p_partkey |
||||
and l_shipdate >= ':1'::timestamp |
||||
and l_shipdate < ':1'::timestamp + '1 month'::interval; |
@ -0,0 +1,11 @@ |
||||
create view tpch.revenue:s as |
||||
select |
||||
l_suppkey as supplier_no, |
||||
sum(l_extendedprice * (1 - l_discount)) as total_revenue |
||||
from |
||||
tpch.lineitem |
||||
where |
||||
l_shipdate >= ':1'::timestamp |
||||
and l_shipdate < ':1'::timestamp + '3 month'::interval |
||||
group by |
||||
l_suppkey; |
@ -0,0 +1,30 @@ |
||||
select |
||||
p_brand, |
||||
p_type, |
||||
p_size, |
||||
count(distinct ps_suppkey) as supplier_cnt |
||||
from |
||||
tpch.partsupp, |
||||
tpch.part |
||||
where |
||||
p_partkey = ps_partkey |
||||
and p_brand <> ':1' |
||||
and p_type not like ':2%' |
||||
and p_size in (:3, :4, :5, :6, :7, :8, :9, :10) |
||||
and ps_suppkey not in ( |
||||
select |
||||
s_suppkey |
||||
from |
||||
tpch.supplier |
||||
where |
||||
s_comment like '%Customer%Complaints%' |
||||
) |
||||
group by |
||||
p_brand, |
||||
p_type, |
||||
p_size |
||||
order by |
||||
supplier_cnt desc, |
||||
p_brand, |
||||
p_type, |
||||
p_size; |
@ -0,0 +1,17 @@ |
||||
select |
||||
sum(l_extendedprice) / 7.0 as avg_yearly |
||||
from |
||||
tpch.lineitem, |
||||
tpch.part |
||||
where |
||||
p_partkey = l_partkey |
||||
and p_brand = ':1' |
||||
and p_container = ':2' |
||||
and l_quantity < ( |
||||
select |
||||
0.2 * avg(l_quantity) |
||||
from |
||||
tpch.lineitem |
||||
where |
||||
l_partkey = p_partkey |
||||
); |
@ -0,0 +1,32 @@ |
||||
select |
||||
c_name, |
||||
c_custkey, |
||||
o_orderkey, |
||||
o_orderdate, |
||||
o_totalprice, |
||||
sum(l_quantity) |
||||
from |
||||
tpch.customer, |
||||
tpch.orders, |
||||
tpch.lineitem |
||||
where |
||||
o_orderkey in ( |
||||
select |
||||
l_orderkey |
||||
from |
||||
tpch.lineitem |
||||
group by |
||||
l_orderkey having |
||||
sum(l_quantity) > :1 |
||||
) |
||||
and c_custkey = o_custkey |
||||
and o_orderkey = l_orderkey |
||||
group by |
||||
c_name, |
||||
c_custkey, |
||||
o_orderkey, |
||||
o_orderdate, |
||||
o_totalprice |
||||
order by |
||||
o_totalprice desc, |
||||
o_orderdate; |
@ -0,0 +1,35 @@ |
||||
select |
||||
sum(l_extendedprice* (1 - l_discount)) as revenue |
||||
from |
||||
tpch.lineitem, |
||||
tpch.part |
||||
where |
||||
( |
||||
p_partkey = l_partkey |
||||
and p_brand = ':1' |
||||
and p_container in ('SM CASE', 'SM BOX', 'SM PACK', 'SM PKG') |
||||
and l_quantity >= :4 and l_quantity <= :4 + 10 |
||||
and p_size between 1 and 5 |
||||
and l_shipmode in ('AIR', 'AIR REG') |
||||
and l_shipinstruct = 'DELIVER IN PERSON' |
||||
) |
||||
or |
||||
( |
||||
p_partkey = l_partkey |
||||
and p_brand = ':2' |
||||
and p_container in ('MED BAG', 'MED BOX', 'MED PKG', 'MED PACK') |
||||
and l_quantity >= :5 and l_quantity <= :5 + 10 |
||||
and p_size between 1 and 10 |
||||
and l_shipmode in ('AIR', 'AIR REG') |
||||
and l_shipinstruct = 'DELIVER IN PERSON' |
||||
) |
||||
or |
||||
( |
||||
p_partkey = l_partkey |
||||
and p_brand = ':3' |
||||
and p_container in ('LG CASE', 'LG BOX', 'LG PACK', 'LG PKG') |
||||
and l_quantity >= :6 and l_quantity <= :6 + 10 |
||||
and p_size between 1 and 15 |
||||
and l_shipmode in ('AIR', 'AIR REG') |
||||
and l_shipinstruct = 'DELIVER IN PERSON' |
||||
); |
@ -0,0 +1,43 @@ |
||||
select |
||||
s_acctbal, |
||||
s_name, |
||||
n_name, |
||||
p_partkey, |
||||
p_mfgr, |
||||
s_address, |
||||
s_phone, |
||||
s_comment |
||||
from |
||||
tpch.part, |
||||
tpch.supplier, |
||||
tpch.partsupp, |
||||
tpch.nation, |
||||
tpch.region |
||||
where |
||||
p_partkey = ps_partkey |
||||
and s_suppkey = ps_suppkey |
||||
and p_size = :1 |
||||
and p_type like '%:2' |
||||
and s_nationkey = n_nationkey |
||||
and n_regionkey = r_regionkey |
||||
and r_name = ':3' |
||||
and ps_supplycost = ( |
||||
select |
||||
min(ps_supplycost) |
||||
from |
||||
tpch.partsupp, |
||||
tpch.supplier, |
||||
tpch.nation, |
||||
tpch.region |
||||
where |
||||
p_partkey = ps_partkey |
||||
and s_suppkey = ps_suppkey |
||||
and s_nationkey = n_nationkey |
||||
and n_regionkey = r_regionkey |
||||
and r_name = ':3' |
||||
) |
||||
order by |
||||
s_acctbal desc, |
||||
n_name, |
||||
s_name, |
||||
p_partkey; |
@ -0,0 +1,37 @@ |
||||
select |
||||
s_name, |
||||
s_address |
||||
from |
||||
tpch.supplier, |
||||
tpch.nation |
||||
where |
||||
s_suppkey in ( |
||||
select |
||||
ps_suppkey |
||||
from |
||||
tpch.partsupp |
||||
where |
||||
ps_partkey in ( |
||||
select |
||||
p_partkey |
||||
from |
||||
tpch.part |
||||
where |
||||
p_name like ':1%' |
||||
) |
||||
and ps_availqty > ( |
||||
select |
||||
0.5 * sum(l_quantity) |
||||
from |
||||
tpch.lineitem |
||||
where |
||||
l_partkey = ps_partkey |
||||
and l_suppkey = ps_suppkey |
||||
and l_shipdate >= ':2'::timestamp |
||||
and l_shipdate < ':2'::timestamp + '1 year'::interval |
||||
) |
||||
) |
||||
and s_nationkey = n_nationkey |
||||
and n_name = ':3' |
||||
order by |
||||
s_name; |
@ -0,0 +1,46 @@ |
||||
--begin q21 |
||||
-- $ID$ |
||||
-- TPC-H/TPC-R Suppliers Who Kept Orders Waiting Query (Q21) |
||||
-- Functional Query Definition |
||||
-- Approved February 1998 |
||||
:x |
||||
:o |
||||
select |
||||
s_name, |
||||
count(*) as numwait |
||||
from |
||||
tpch.supplier, |
||||
tpch.lineitem l1, |
||||
tpch.orders, |
||||
tpch.nation |
||||
where |
||||
s_suppkey = l1.l_suppkey |
||||
and o_orderkey = l1.l_orderkey |
||||
and o_orderstatus = 'F' |
||||
and l1.l_receiptdate > l1.l_commitdate |
||||
and exists ( |
||||
select |
||||
* |
||||
from |
||||
tpch.lineitem l2 |
||||
where |
||||
l2.l_orderkey = l1.l_orderkey |
||||
and l2.l_suppkey <> l1.l_suppkey |
||||
) |
||||
and not exists ( |
||||
select |
||||
* |
||||
from |
||||
tpch.lineitem l3 |
||||
where |
||||
l3.l_orderkey = l1.l_orderkey |
||||
and l3.l_suppkey <> l1.l_suppkey |
||||
and l3.l_receiptdate > l3.l_commitdate |
||||
) |
||||
and s_nationkey = n_nationkey |
||||
and n_name = ':1' |
||||
group by |
||||
s_name |
||||
order by |
||||
numwait desc, |
||||
s_name; |
@ -0,0 +1,35 @@ |
||||
select |
||||
cntrycode, |
||||
count(*) as numcust, |
||||
sum(c_acctbal) as totacctbal |
||||
from |
||||
( |
||||
select |
||||
substring(c_phone from 1 for 2) as cntrycode, |
||||
c_acctbal |
||||
from |
||||
tpch.customer |
||||
where |
||||
substring(c_phone from 1 for 2) in |
||||
(':1', ':2', ':3', ':4', ':5', ':6', ':7') |
||||
and c_acctbal > ( |
||||
select |
||||
avg(c_acctbal) |
||||
from |
||||
tpch.customer |
||||
where |
||||
c_acctbal > 0.00 |
||||
and substring(c_phone from 1 for 2) in |
||||
(':1', ':2', ':3', ':4', ':5', ':6', ':7') |
||||
) |
||||
and c_custkey not in ( |
||||
select |
||||
o_custkey |
||||
from |
||||
tpch.orders |
||||
) |
||||
) as custsale |
||||
group by |
||||
cntrycode |
||||
order by |
||||
cntrycode; |
@ -0,0 +1,22 @@ |
||||
select |
||||
l_orderkey, |
||||
sum(l_extendedprice * (1 - l_discount)) as revenue, |
||||
o_orderdate, |
||||
o_shippriority |
||||
from |
||||
tpch.customer, |
||||
tpch.orders, |
||||
tpch.lineitem |
||||
where |
||||
c_mktsegment = ':1' |
||||
and c_custkey = o_custkey |
||||
and l_orderkey = o_orderkey |
||||
and o_orderdate < ':2'::timestamp |
||||
and l_shipdate > ':2'::timestamp |
||||
group by |
||||
l_orderkey, |
||||
o_orderdate, |
||||
o_shippriority |
||||
order by |
||||
revenue desc, |
||||
o_orderdate; |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue