index scan is default on
This commit is contained in:
4
debug.h
4
debug.h
@@ -14,7 +14,9 @@ std::vector<std::string> k_debug_sql_commands {
|
|||||||
"set 'DATE_FORMAT' = '%Y-%m-%d'",
|
"set 'DATE_FORMAT' = '%Y-%m-%d'",
|
||||||
"create index sf1_symbol on sf1(symbol)",
|
"create index sf1_symbol on sf1(symbol)",
|
||||||
"load into sf1 '/srv/SHARADAR_SF1.csv'",
|
"load into sf1 '/srv/SHARADAR_SF1.csv'",
|
||||||
|
// "set 'USE_INDEXSCAN' = 'true'",
|
||||||
"select distinct dimension from sf1 where symbol = 'ALLY'",
|
"select distinct dimension from sf1 where symbol = 'ALLY'",
|
||||||
|
"select calendar_date, calendar_date, dimension from sf1 where symbol = 'ALLY' and dimension = 'MRQ' and calendar_date <= 1653487723 order by calendar_date desc limit 10",
|
||||||
// "set 'USE_INDEXSCAN' = 'false'",
|
// "set 'USE_INDEXSCAN' = 'false'",
|
||||||
// "select dimension, to_char(calendar_date, '%d.%m.%Y'), pp(eps, \"%.2f\"), pp(shareswadil), pp(revenue), pp(netinc), pp(cashneq), pp(assets), pp(debt), pp(ncfdebt), pp(roe*100), pp(intangibles), calendar_date from sf1 where symbol = 'MU' and dimension = 'ARQ' order by dimension, calendar_date desc limit 5",
|
// "select dimension, to_char(calendar_date, '%d.%m.%Y'), pp(eps, \"%.2f\"), pp(shareswadil), pp(revenue), pp(netinc), pp(cashneq), pp(assets), pp(debt), pp(ncfdebt), pp(roe*100), pp(intangibles), calendar_date from sf1 where symbol = 'MU' and dimension = 'ARQ' order by dimension, calendar_date desc limit 5",
|
||||||
// "set 'USE_INDEXSCAN' = 'true'",
|
// "set 'USE_INDEXSCAN' = 'true'",
|
||||||
@@ -54,7 +56,7 @@ std::vector<std::string> k_debug_sql_commands {
|
|||||||
// "select max(to_char(datetime, '%Y%m%d')) from d",
|
// "select max(to_char(datetime, '%Y%m%d')) from d",
|
||||||
// "select max(to_int(to_float(to_char(datetime, '%Y%m%d')))) from d",
|
// "select max(to_int(to_float(to_char(datetime, '%Y%m%d')))) from d",
|
||||||
|
|
||||||
"select * from usql_tables",
|
// "select * from usql_tables",
|
||||||
// "select * from usql_columns"
|
// "select * from usql_columns"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ std::vector<std::pair<std::string, std::string>> Settings::m_settings =
|
|||||||
std::make_pair("BOOL_TRUE_LITERAL", "Y"),
|
std::make_pair("BOOL_TRUE_LITERAL", "Y"),
|
||||||
std::make_pair("BOOL_FALSE_LITERAL", "N"),
|
std::make_pair("BOOL_FALSE_LITERAL", "N"),
|
||||||
std::make_pair("DOUBLE_FORMAT", "%.2f"),
|
std::make_pair("DOUBLE_FORMAT", "%.2f"),
|
||||||
std::make_pair("USE_INDEXSCAN", "N"),
|
std::make_pair("USE_INDEXSCAN", "Y"),
|
||||||
std::make_pair("MAX_PARALLELISM", "1") }; // values "AUTO" or number of workers; when number negative means std::thread::hardware_concurrency() - number
|
std::make_pair("MAX_PARALLELISM", "1") }; // values "AUTO" or number of workers; when number negative means std::thread::hardware_concurrency() - number
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ std::pair<bool, std::vector<rowid_t>> USql::look_for_usable_index(const Node *wh
|
|||||||
if (used_index != nullptr) {
|
if (used_index != nullptr) {
|
||||||
std::vector<rowid_t> rowids = used_index->search((ValueNode *)ron->right.get());
|
std::vector<rowid_t> rowids = used_index->search((ValueNode *)ron->right.get());
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
std::cout << "using index " << table->m_name << "(" << used_index->get_column_name() << "), " << rowids.size() << "/" << table->rows_count() << std::endl;
|
std::cerr << "using index " << table->m_name << "(" << used_index->get_column_name() << "), " << rowids.size() << "/" << table->rows_count() << std::endl;
|
||||||
#endif
|
#endif
|
||||||
return std::make_pair(true, rowids);
|
return std::make_pair(true, rowids);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user