diff --git a/Database/Join.cpp b/Database/Join.cpp index aa0e675..d2c2d0d 100644 --- a/Database/Join.cpp +++ b/Database/Join.cpp @@ -132,7 +132,9 @@ 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 > Join::JUDGE_LIMIT) + if (ans > limit) return 0; //multi_join method else return 1; //index_join method diff --git a/Database/Join.h b/Database/Join.h index 41d8eca..07dbb43 100644 --- a/Database/Join.h +++ b/Database/Join.h @@ -55,8 +55,12 @@ 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; + + //constexpr needed in C++11 (or in newer g++) + //static const double JUDGE_LIMIT = 0.5; + static const int JUDGE_LIMIT = 2; //use 1.0/JUDGE_LIMIT static const int LIMIT_CANDIDATE_LIST_SIZE = 1000; + //BETTER?:predefine size to avoid copy cost TableType current_table; TableIterator new_start; //keep to end() as default diff --git a/api/cpp/example/Makefile b/api/cpp/example/Makefile index 71a97ea..246bd49 100644 --- a/api/cpp/example/Makefile +++ b/api/cpp/example/Makefile @@ -1,5 +1,5 @@ -#CC=g++ -CC=ccache g++ +CC=g++ +#CC=ccache g++ example: CppAPIExample.o $(CC) -o example CppAPIExample.o -L../lib -lgstoreconnector diff --git a/api/cpp/src/Makefile b/api/cpp/src/Makefile index 273be35..37abdf3 100644 --- a/api/cpp/src/Makefile +++ b/api/cpp/src/Makefile @@ -1,5 +1,5 @@ -#CC=g++ -CC=ccache g++ +CC=g++ +#CC=ccache g++ lib_dir=../lib/ socket_obj_dir=../../../.objs/ diff --git a/makefile b/makefile index 2d27bda..7e51351 100644 --- a/makefile +++ b/makefile @@ -35,8 +35,9 @@ #compile parameters -CC = ccache g++ -#CC = g++ +# WARN: maybe difficult to install ccache in some systems +#CC = ccache g++ +CC = g++ #the optimazition level of gcc/g++ #http://blog.csdn.net/hit_090420216/article/details/44900215