From 3bca240151bca7bb835b0b116475e8fcb425b481 Mon Sep 17 00:00:00 2001 From: bookug Date: Tue, 16 May 2017 21:16:40 +0800 Subject: [PATCH] feat: add http branch --- Database/Join.cpp | 5 ++++- Database/Join.h | 2 +- README.md | 2 +- makefile | 7 ++++++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Database/Join.cpp b/Database/Join.cpp index 7225a6d..d9f8120 100644 --- a/Database/Join.cpp +++ b/Database/Join.cpp @@ -132,7 +132,8 @@ Join::judge(int _smallest, int _biggest) //BETTER:how to guess the size of can_lists double size = (_smallest + _biggest) / 2.0; double ans = Join::PARAM_DENSE * dense - size / Join::PARAM_SIZE; - if (ans > Join::JUDGE_LIMIT) + double limit = 1.0 / (double)Join::JUDGE_LIMIT; + if (ans > limit) return 0; //multi_join method else return 1; //index_join method @@ -1229,6 +1230,8 @@ Join::multi_join() for (int i = 0; i < start_size; ++i) { int ele = start_table.getID(i); + //NOTICE: we can denote the total size here in vector, but no need because the variables' num is small + //(won't double to require more space) RecordType record(1, ele); this->current_table.push_back(record); //this->table_row_new.push_back(false); diff --git a/Database/Join.h b/Database/Join.h index 41d8eca..b88f7d3 100644 --- a/Database/Join.h +++ b/Database/Join.h @@ -55,7 +55,7 @@ private: static const unsigned PARAM_SIZE = 1000000; static const unsigned PARAM_PRE = 10000; static const unsigned PARAM_DENSE = 1; - static const double JUDGE_LIMIT = 0.5; + static const int JUDGE_LIMIT = 2; static const int LIMIT_CANDIDATE_LIST_SIZE = 1000; //BETTER?:predefine size to avoid copy cost TableType current_table; diff --git a/README.md b/README.md index 7e16703..7a7d2de 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ If you want to understand the details of the gStore system, or you want to try s We have written a series of short essays addressing recurring challenges in using gStore to realize applications, which are placed in [Recipe Book](docs/TIPS.md). -You are welcome to report any advice or errors in the github Issues part of this repository, if not requiring in-time reply. However, if you want to urgent on us to deal with your reports, please email to to submit your suggestions and report bugs to us by emailing to . A full list of our whole team is in [Mailing List](docs/MAIL.md). +You are welcome to report any advice or errors in the github Issues part of this repository, if not requiring in-time reply. However, if you want to urgent on us to deal with your reports, please email to to submit your suggestions and report bugs to us by emailing to . A full list of our whole team is in [Mailing List](docs/MAIL.md). There are some restrictions when you use the current gStore project, you can see them on [Limit Description](docs/LIMIT.md). diff --git a/makefile b/makefile index 2d27bda..0df68c5 100644 --- a/makefile +++ b/makefile @@ -23,6 +23,10 @@ #http://blog.csdn.net/cscrazybing/article/details/50789482 #http://blog.163.com/liuhonggaono1@126/blog/static/10497901201210254622141/ +#NOTICE: to debug the program, gdb and valgrind can be used +# objdump, nm and size command +#To analyse the performance, gprof and gcov/lcov can be used + #TODO:the dependences are not complete! @@ -35,7 +39,7 @@ #compile parameters -CC = ccache g++ +CC = ccache g++ -std=c++11 #CC = g++ #the optimazition level of gcc/g++ @@ -51,6 +55,7 @@ EXEFLAG = -g -pthread #-fprofile-arcs -ftest-coverage #-pg #add -lreadline -ltermcap if using readline or objs contain readline library = -ltermcap -lreadline -L./lib -lantlr -lgcov +library = -ltermcap -lreadline -L./lib -L/usr/local/lib/ -lantlr -lgcov -lboost_filesystem -lboost_system -lpthread def64IO = -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE # paths