Changeset: 01fdad544bcc for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=01fdad544bcc
Modified Files:
monetdb5/mal/mal_runtime.c
monetdb5/mal/mal_runtime.h
Branch: default
Log Message:
Provide storage size for BATs
diffs (43 lines):
diff --git a/monetdb5/mal/mal_runtime.c b/monetdb5/mal/mal_runtime.c
--- a/monetdb5/mal/mal_runtime.c
+++ b/monetdb5/mal/mal_runtime.c
@@ -22,7 +22,7 @@
#include "mal_private.h"
#define heapinfo(X) ((X) && (X)->base ? (X)->free: 0)
-#define hashinfo(X) (((X) && (X) != (Hash *) 1 && (X)->mask)? ((X)->mask +
(X)->lim + 1) * sizeof(int) + sizeof(*(X)) + cnt * sizeof(int): 0)
+#define hashinfo(X) ( (X)? heapinfo((X)->heap):0)
// Keep a queue of running queries
QueryQueue QRYqueue;
@@ -212,6 +212,19 @@ runtimeProfileExit(Client cntxt, MalBlkP
* may trigger a side effect, such as creating a hash-index.
* Side effects are ignored.
*/
+
+lng
+getBatSpace(BAT *b){
+ lng space=0;
+ if( b == NULL)
+ return 0;
+ if( b->T) space += heapinfo(&b->T->heap);
+ if( b->T->vheap) space += heapinfo(b->T->vheap);
+ if(b->T) space += hashinfo(b->T->hash);
+ space += IMPSimprintsize(b);
+ return space;
+}
+
lng getVolume(MalStkPtr stk, InstrPtr pci, int rd)
{
int i, limit;
diff --git a/monetdb5/mal/mal_runtime.h b/monetdb5/mal/mal_runtime.h
--- a/monetdb5/mal/mal_runtime.h
+++ b/monetdb5/mal/mal_runtime.h
@@ -41,6 +41,7 @@ mal_export void runtimeProfileBegin(Clie
mal_export void runtimeProfileExit(Client cntxt, MalBlkPtr mb, MalStkPtr stk,
InstrPtr pci, RuntimeProfile prof);
mal_export void finishSessionProfiler(Client cntxt);
mal_export lng getVolume(MalStkPtr stk, InstrPtr pci, int rd);
+mal_export lng getBatSpace(BAT *b);
mal_export QueryQueue QRYqueue;
#endif
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list