gdk_relop.c

来自「这个是内存数据库中的一个管理工具」· C语言 代码 · 共 2,482 行 · 第 1/5 页

C
2,482
字号
	dst = BUNfirst(bn);	base = BUNindex(r, BUNfirst(r));	offset = (ssize_t) (base - r->hseqbase);	end = base + BATcount(r);	BATmmap_pin(r);	ALGODEBUG THRprintf(GDKout, "#BATfetchjoin: defaultfetchjoin(chr,chr);\n");	BATloopFast(l, l_cur, l_end, xx) {		yy = offset + *(oid *) BUNtail(l, l_cur);		if (yy < base || yy >= end) {			continue;		}		r_cur = BUNptr(r, yy);		#line 510 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_relop.mx"	Hchrput(bn, BUNhloc(bn, dst));	Tchrput(bn, BUNtloc(bn, dst));#line 604 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_relop.mx"		dst += zz;	}	BATmmap_unpin(r);	ret = bn;      goto bunins_failed;      bunins_failed:	BATmmap_unpin(r);	bn->batBuns->free = dst - bn->batBuns->base;	BATsetcount(bn,bn->batBuns->free/zz);	if (!ret)		BBPreclaim(bn);	return ret;}#line 620 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_relop.mx"	#line 514 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_relop.mx"static BAT *densefetchjoin_chr_bte(BAT *bn, BAT *l, BAT *r){	BUN l_cur, l_end, r_cur, dst;	ssize_t offset;	size_t base, xx;	int yy, zz;	BAT *ret = NULL;	zz = BUNsize(bn);	yy = BUNsize(r);	dst = BUNfirst(bn);	base = BUNindex(r, BUNfirst(r));	offset = (ssize_t) (base - r->hseqbase);	r_cur = BUNptr(r, offset + *(oid *) BUNtail(l, BUNfirst(l)));	ALGODEBUG THRprintf(GDKout, "#BATfetchjoin: densefetchjoin(chr,bte);\n");	BATloopFast(l, l_cur, l_end, xx) {		#line 510 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_relop.mx"	Hchrput(bn, BUNhloc(bn, dst));	Tbteput(bn, BUNtloc(bn, dst));#line 533 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_relop.mx"		r_cur += yy;		dst += zz;	}	ret = bn;      goto bunins_failed;      bunins_failed: 	bn->batBuns->free = dst - bn->batBuns->base;	BATsetcount(bn,bn->batBuns->free/zz);	if (!ret)		BBPreclaim(bn);	return ret;}static BAT *orderedfetchjoin_chr_bte(BAT *bn, BAT *l, BAT *r){	BUN l_cur, l_end, r_cur, dst;	ssize_t offset;	size_t base, xx, yy;	int zz;	BAT *ret = NULL;	zz = BUNsize(bn);	dst = BUNfirst(bn);	base = BUNindex(r, BUNfirst(r));	offset = (ssize_t) (base - r->hseqbase);	ALGODEBUG THRprintf(GDKout, "#BATfetchjoin: orderedfetchjoin(chr,bte);\n");	BATloopFast(l, l_cur, l_end, xx) {		yy = offset + *(oid *) BUNtail(l, l_cur);		r_cur = BUNptr(r, yy);		#line 510 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_relop.mx"	Hchrput(bn, BUNhloc(bn, dst));	Tbteput(bn, BUNtloc(bn, dst));#line 566 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_relop.mx"		dst += zz;	}	ret = bn;      goto bunins_failed;      bunins_failed:	bn->batBuns->free = dst - bn->batBuns->base;	BATsetcount(bn,bn->batBuns->free/zz);	if (!ret)		BBPreclaim(bn);	return ret;}static BAT *defaultfetchjoin_chr_bte(BAT *bn, BAT *l, BAT *r){	BUN l_cur, l_end, r_cur, dst;	ssize_t offset;	size_t xx, yy, base, end;	int zz;	BAT *ret = NULL;	zz = BUNsize(bn);	dst = BUNfirst(bn);	base = BUNindex(r, BUNfirst(r));	offset = (ssize_t) (base - r->hseqbase);	end = base + BATcount(r);	BATmmap_pin(r);	ALGODEBUG THRprintf(GDKout, "#BATfetchjoin: defaultfetchjoin(chr,bte);\n");	BATloopFast(l, l_cur, l_end, xx) {		yy = offset + *(oid *) BUNtail(l, l_cur);		if (yy < base || yy >= end) {			continue;		}		r_cur = BUNptr(r, yy);		#line 510 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_relop.mx"	Hchrput(bn, BUNhloc(bn, dst));	Tbteput(bn, BUNtloc(bn, dst));#line 604 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_relop.mx"		dst += zz;	}	BATmmap_unpin(r);	ret = bn;      goto bunins_failed;      bunins_failed:	BATmmap_unpin(r);	bn->batBuns->free = dst - bn->batBuns->base;	BATsetcount(bn,bn->batBuns->free/zz);	if (!ret)		BBPreclaim(bn);	return ret;}#line 621 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_relop.mx"	#line 514 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_relop.mx"static BAT *densefetchjoin_chr_sht(BAT *bn, BAT *l, BAT *r){	BUN l_cur, l_end, r_cur, dst;	ssize_t offset;	size_t base, xx;	int yy, zz;	BAT *ret = NULL;	zz = BUNsize(bn);	yy = BUNsize(r);	dst = BUNfirst(bn);	base = BUNindex(r, BUNfirst(r));	offset = (ssize_t) (base - r->hseqbase);	r_cur = BUNptr(r, offset + *(oid *) BUNtail(l, BUNfirst(l)));	ALGODEBUG THRprintf(GDKout, "#BATfetchjoin: densefetchjoin(chr,sht);\n");	BATloopFast(l, l_cur, l_end, xx) {		#line 510 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_relop.mx"	Hchrput(bn, BUNhloc(bn, dst));	Tshtput(bn, BUNtloc(bn, dst));#line 533 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_relop.mx"		r_cur += yy;		dst += zz;	}	ret = bn;      goto bunins_failed;      bunins_failed: 	bn->batBuns->free = dst - bn->batBuns->base;	BATsetcount(bn,bn->batBuns->free/zz);	if (!ret)		BBPreclaim(bn);	return ret;}static BAT *orderedfetchjoin_chr_sht(BAT *bn, BAT *l, BAT *r){	BUN l_cur, l_end, r_cur, dst;	ssize_t offset;	size_t base, xx, yy;	int zz;	BAT *ret = NULL;	zz = BUNsize(bn);	dst = BUNfirst(bn);	base = BUNindex(r, BUNfirst(r));	offset = (ssize_t) (base - r->hseqbase);	ALGODEBUG THRprintf(GDKout, "#BATfetchjoin: orderedfetchjoin(chr,sht);\n");	BATloopFast(l, l_cur, l_end, xx) {		yy = offset + *(oid *) BUNtail(l, l_cur);		r_cur = BUNptr(r, yy);		#line 510 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_relop.mx"	Hchrput(bn, BUNhloc(bn, dst));	Tshtput(bn, BUNtloc(bn, dst));#line 566 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_relop.mx"		dst += zz;	}	ret = bn;      goto bunins_failed;      bunins_failed:	bn->batBuns->free = dst - bn->batBuns->base;	BATsetcount(bn,bn->batBuns->free/zz);	if (!ret)		BBPreclaim(bn);	return ret;}static BAT *defaultfetchjoin_chr_sht(BAT *bn, BAT *l, BAT *r){	BUN l_cur, l_end, r_cur, dst;	ssize_t offset;	size_t xx, yy, base, end;	int zz;	BAT *ret = NULL;	zz = BUNsize(bn);	dst = BUNfirst(bn);	base = BUNindex(r, BUNfirst(r));	offset = (ssize_t) (base - r->hseqbase);	end = base + BATcount(r);	BATmmap_pin(r);	ALGODEBUG THRprintf(GDKout, "#BATfetchjoin: defaultfetchjoin(chr,sht);\n");	BATloopFast(l, l_cur, l_end, xx) {		yy = offset + *(oid *) BUNtail(l, l_cur);		if (yy < base || yy >= end) {			continue;		}		r_cur = BUNptr(r, yy);		#line 510 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_relop.mx"	Hchrput(bn, BUNhloc(bn, dst));	Tshtput(bn, BUNtloc(bn, dst));#line 604 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_relop.mx"		dst += zz;	}	BATmmap_unpin(r);	ret = bn;      goto bunins_failed;      bunins_failed:	BATmmap_unpin(r);	bn->batBuns->free = dst - bn->batBuns->base;	BATsetcount(bn,bn->batBuns->free/zz);	if (!ret)		BBPreclaim(bn);	return ret;}#line 622 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_relop.mx"	#line 514 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_relop.mx"static BAT *densefetchjoin_chr_int(BAT *bn, BAT *l, BAT *r){	BUN l_cur, l_end, r_cur, dst;	ssize_t offset;	size_t base, xx;	int yy, zz;	BAT *ret = NULL;	zz = BUNsize(bn);	yy = BUNsize(r);	dst = BUNfirst(bn);	base = BUNindex(r, BUNfirst(r));	offset = (ssize_t) (base - r->hseqbase);	r_cur = BUNptr(r, offset + *(oid *) BUNtail(l, BUNfirst(l)));	ALGODEBUG THRprintf(GDKout, "#BATfetchjoin: densefetchjoin(chr,int);\n");	BATloopFast(l, l_cur, l_end, xx) {		#line 510 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_relop.mx"	Hchrput(bn, BUNhloc(bn, dst));	Tintput(bn, BUNtloc(bn, dst));#line 533 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_relop.mx"		r_cur += yy;		dst += zz;	}	ret = bn;      goto bunins_failed;      bunins_failed: 	bn->batBuns->free = dst - bn->batBuns->base;	BATsetcount(bn,bn->batBuns->free/zz);	if (!ret)		BBPreclaim(bn);	return ret;}static BAT *orderedfetchjoin_chr_int(BAT *bn, BAT *l, BAT *r){	BUN l_cur, l_end, r_cur, dst;	ssize_t offset;	size_t base, xx, yy;	int zz;	BAT *ret = NULL;	zz = BUNsize(bn);	dst = BUNfirst(bn);	base = BUNindex(r, BUNfirst(r));	offset = (ssize_t) (base - r->hseqbase);	ALGODEBUG THRprintf(GDKout, "#BATfetchjoin: orderedfetchjoin(chr,int);\n");	BATloopFast(l, l_cur, l_end, xx) {		yy = offset + *(oid *) BUNtail(l, l_cur);		r_cur = BUNptr(r, yy);		#line 510 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_relop.mx"	Hchrput(bn, BUNhloc(bn, dst));	Tintput(bn, BUNtloc(bn, dst));#line 566 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_relop.mx"		dst += zz;	}	ret = bn;      goto bunins_failed;      bunins_failed:	bn->batBuns->free = dst - bn->batBuns->base;	BATsetcount(bn,bn->batBuns->free/zz);	if (!ret)		BBPreclaim(bn);	return ret;}static BAT *defaultfetchjoin_chr_int(BAT *bn, BAT *l, BAT *r){	BUN l_cur, l_end, r_cur, dst;	ssize_t offset;	size_t xx, yy, base, end;	int zz;	BAT *ret = NULL;	zz = BUNsize(bn);	dst = BUNfirst(bn);	base = BUNindex(r, BUNfirst(r));	offset = (ssize_t) (base - r->hseqbase);	end = base + BATcount(r);	BATmmap_pin(r);	ALGODEBUG THRprintf(GDKout, "#BATfetchjoin: defaultfetchjoin(chr,int);\n");	BATloopFast(l, l_cur, l_end, xx) {		yy = offset + *(oid *) BUNtail(l, l_cur);		if (yy < base || yy >= end) {			continue;		}		r_cur = BUNptr(r, yy);		#line 510 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_relop.mx"	Hchrput(bn, BUNhloc(bn, dst));	Tintput(bn, BUNtloc(bn, dst));#line 604 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_relop.mx"		dst += zz;	}	BATmmap_unpin(r);	ret = bn;      goto bunins_failed;      bunins_failed:	BATmmap_unpin(r);	bn->batBuns->free = dst - bn->batBuns->base;	BATsetcount(bn,bn->batBuns->free/zz);	if (!ret)		BBPreclaim(bn);	return ret;}#line 623 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_relop.mx"	#line 514 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_relop.mx"static BAT *densefetchjoin_chr_lng(BAT *bn, BAT *l, BAT *r){	BUN l_cur, l_end, r_cur, dst;	ssize_t offset;	size_t base, xx;	int yy, zz;	BAT *ret = NULL;	zz = BUNsize(bn);	yy = BUNsize(r);	dst = BUNfirst(bn);	base = BUNindex(r, BUNfirst(r));	offset = (ssize_t) (base - r->hseqbase);	r_cur = BUNptr(r, offset + *(oid *) BUNtail(l, BUNfirst(l)));	ALGODEBUG THRprintf(GDKout, "#BATfetchjoin: densefetchjoin(chr,lng);\n");	BATloopFast(l, l_cur, l_end, xx) {		#line 510 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_relop.mx"	Hchrput(bn, BUNhloc(bn, dst));	Tlngput(bn, BUNtloc(bn, dst));#line 533 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_relop.mx"		r_cur += yy;		dst += zz;	}	ret = bn;      goto bunins_failed;      bunins_failed: 	bn->batBuns->free = dst - bn->batBuns->base;	BATsetcount(bn,bn->batBuns->free/zz);	if (!ret)		BBPreclaim(bn);	return ret;}static BAT *orderedfetchjoin_chr_lng(BAT *bn, BAT *l, BAT *r){	BUN l_cur, l_end, r_cur, dst;	ssize_t offset;	size_t base, xx, yy;	int zz;	BAT *ret = NULL;	zz = BUNsize(bn);	dst = BUNfirst(bn);	base = BUNindex(r, BUNfirst(r));	offset = (ssize_t) (base - r->hseqbase);	ALGODEBUG THRprintf(GDKout, "#BATfetchjoin: orderedfetchjoin(chr,lng);\n");	BATloopFast(l, l_cur, l_end, xx) {		yy = offset + *(oid *) BUNtail(l, l_cur);		r_cur = BUNptr(r, yy);		#line 510 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB/src/gdk/gdk_relop.mx"	Hchrput(bn, BUNhloc(bn, dst));

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?