资源简介
TPC-H工具包
针对数据库不同的使用场景TPC组织发布了多项测试标准。
TPC-H是决策支持的基准测试。它由一套面向业务的即席查询和并发数据修改组成。 这些查询和填充数据库的数据具有广泛的行业相关性。 该基准测试展示了决策支持系统,它可以检索大量数据,执行高度复杂的查询,并为关键业务问题提供答案。
代码片段和文件信息
/*
* $Id: bcd2.cv 1.2 2005/01/03 20:08:58 jms Exp $
*
* Revision History
* ===================
* $Log: bcd2.cv $
* 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
#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 di
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-12-06 02:31 2.18.0_rc2\
目录 0 2018-12-06 02:29 2.18.0_rc2\dbgen\
目录 0 2018-12-06 02:29 2.18.0_rc2\dbgen\answers\
文件 735 2018-12-06 02:29 2.18.0_rc2\dbgen\answers\q1.out
文件 5622 2018-12-06 02:29 2.18.0_rc2\dbgen\answers\q10.out
文件 33759 2018-12-06 02:29 2.18.0_rc2\dbgen\answers\q11.out
文件 171 2018-12-06 02:29 2.18.0_rc2\dbgen\answers\q12.out
文件 1978 2018-12-06 02:29 2.18.0_rc2\dbgen\answers\q13.out
文件 48 2018-12-06 02:29 2.18.0_rc2\dbgen\answers\q14.out
文件 261 2018-12-06 02:29 2.18.0_rc2\dbgen\answers\q15.out
文件 1483515 2018-12-06 02:29 2.18.0_rc2\dbgen\answers\q16.out
文件 52 2018-12-06 02:29 2.18.0_rc2\dbgen\answers\q17.out
文件 5724 2018-12-06 02:29 2.18.0_rc2\dbgen\answers\q18.out
文件 53 2018-12-06 02:29 2.18.0_rc2\dbgen\answers\q19.out
文件 26873 2018-12-06 02:29 2.18.0_rc2\dbgen\answers\q2.out
文件 12529 2018-12-06 02:29 2.18.0_rc2\dbgen\answers\q20.out
文件 4949 2018-12-06 02:29 2.18.0_rc2\dbgen\answers\q21.out
文件 431 2018-12-06 02:29 2.18.0_rc2\dbgen\answers\q22.out
文件 747 2018-12-06 02:29 2.18.0_rc2\dbgen\answers\q3.out
文件 234 2018-12-06 02:29 2.18.0_rc2\dbgen\answers\q4.out
文件 258 2018-12-06 02:29 2.18.0_rc2\dbgen\answers\q5.out
文件 55 2018-12-06 02:29 2.18.0_rc2\dbgen\answers\q6.out
文件 455 2018-12-06 02:29 2.18.0_rc2\dbgen\answers\q7.out
文件 115 2018-12-06 02:29 2.18.0_rc2\dbgen\answers\q8.out
文件 10414 2018-12-06 02:29 2.18.0_rc2\dbgen\answers\q9.out
文件 6072 2018-12-06 02:29 2.18.0_rc2\dbgen\bcd2.c
文件 859 2018-12-06 02:29 2.18.0_rc2\dbgen\bcd2.h
文件 13632 2018-12-06 02:29 2.18.0_rc2\dbgen\bm_utils.c
文件 27872 2018-12-06 02:29 2.18.0_rc2\dbgen\BUGS
文件 11413 2018-12-06 02:29 2.18.0_rc2\dbgen\build.c
目录 0 2018-12-06 02:29 2.18.0_rc2\dbgen\check_answers\
............此处省略8739个文件信息
评论
共有 条评论