mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-18 05:32:52 +00:00
58e5dad1a1
commite712f469a5
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:59:13 2017 +0300 Less dependencies [#CLICKHOUSE-2] commit2a00282308
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:58:30 2017 +0300 Less dependencies [#CLICKHOUSE-2] commit9e06f407c8
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:55:14 2017 +0300 Less dependencies [#CLICKHOUSE-2] commit9581620f1e
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:54:22 2017 +0300 Less dependencies [#CLICKHOUSE-2] commit2a8564c68c
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:47:34 2017 +0300 Less dependencies [#CLICKHOUSE-2] commitcf60632d78
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:40:09 2017 +0300 Less dependencies [#CLICKHOUSE-2] commitee3d1dc6e0
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:22:49 2017 +0300 Less dependencies [#CLICKHOUSE-2] commit65592ef711
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:18:17 2017 +0300 Less dependencies [#CLICKHOUSE-2] commit37972c2573
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:17:06 2017 +0300 Less dependencies [#CLICKHOUSE-2] commitdd909d1499
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:16:28 2017 +0300 Less dependencies [#CLICKHOUSE-2] commit3cf43266ca
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:15:42 2017 +0300 Less dependencies [#CLICKHOUSE-2] commit6731a3df96
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:13:35 2017 +0300 Less dependencies [#CLICKHOUSE-2] commit1b5727e0d5
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:11:18 2017 +0300 Less dependencies [#CLICKHOUSE-2] commitbbcf726a55
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:09:04 2017 +0300 Less dependencies [#CLICKHOUSE-2] commitc03b477d5e
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:06:30 2017 +0300 Less dependencies [#CLICKHOUSE-2] commit2986e2fb04
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:05:44 2017 +0300 Less dependencies [#CLICKHOUSE-2] commit5d6cdef13d
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:04:53 2017 +0300 Less dependencies [#CLICKHOUSE-2] commitf2b819b25c
Author: Alexey Milovidov <milovidov@yandex-team.ru> Date: Sat Jan 14 11:01:47 2017 +0300 Less dependencies [#CLICKHOUSE-2]
81 lines
2.5 KiB
C++
81 lines
2.5 KiB
C++
#pragma once
|
||
|
||
#include <DB/Storages/MergeTree/MergeTreeData.h>
|
||
#include <DB/Storages/MergeTree/RangesInDataPart.h>
|
||
|
||
|
||
namespace DB
|
||
{
|
||
|
||
class PKCondition;
|
||
|
||
|
||
/** Выполняет запросы SELECT на данных из merge-дерева.
|
||
*/
|
||
class MergeTreeDataSelectExecutor
|
||
{
|
||
public:
|
||
MergeTreeDataSelectExecutor(MergeTreeData & data_);
|
||
|
||
/** При чтении, выбирается набор кусков, покрывающий нужный диапазон индекса.
|
||
* max_block_number_to_read - если не ноль - не читать все куски, у которых правая граница больше этого порога.
|
||
*/
|
||
BlockInputStreams read(
|
||
const Names & column_names,
|
||
ASTPtr query,
|
||
const Context & context,
|
||
const Settings & settings,
|
||
QueryProcessingStage::Enum & processed_stage,
|
||
size_t max_block_size,
|
||
unsigned threads,
|
||
size_t * inout_part_index, /// Если не nullptr, из этого счетчика берутся значения для виртуального столбца _part_index.
|
||
Int64 max_block_number_to_read) const;
|
||
|
||
private:
|
||
MergeTreeData & data;
|
||
|
||
Logger * log;
|
||
|
||
BlockInputStreams spreadMarkRangesAmongThreads(
|
||
RangesInDataParts parts,
|
||
size_t threads,
|
||
const Names & column_names,
|
||
size_t max_block_size,
|
||
bool use_uncompressed_cache,
|
||
ExpressionActionsPtr prewhere_actions,
|
||
const String & prewhere_column,
|
||
const Names & virt_columns,
|
||
const Settings & settings) const;
|
||
|
||
BlockInputStreams spreadMarkRangesAmongThreadsFinal(
|
||
RangesInDataParts parts,
|
||
size_t threads,
|
||
const Names & column_names,
|
||
size_t max_block_size,
|
||
bool use_uncompressed_cache,
|
||
ExpressionActionsPtr prewhere_actions,
|
||
const String & prewhere_column,
|
||
const Names & virt_columns,
|
||
const Settings & settings,
|
||
const Context & context) const;
|
||
|
||
/// Получить приблизительное значение (оценку снизу - только по полным засечкам) количества строк, попадающего под индекс.
|
||
size_t getApproximateTotalRowsToRead(
|
||
const MergeTreeData::DataPartsVector & parts,
|
||
const PKCondition & key_condition,
|
||
const Settings & settings) const;
|
||
|
||
/// Создать выражение "Sign == 1".
|
||
void createPositiveSignCondition(
|
||
ExpressionActionsPtr & out_expression,
|
||
String & out_column,
|
||
const Context & context) const;
|
||
|
||
MarkRanges markRangesFromPKRange(
|
||
const MergeTreeData::DataPart::Index & index,
|
||
const PKCondition & key_condition,
|
||
const Settings & settings) const;
|
||
};
|
||
|
||
}
|