mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
Reduce number of "stat" syscalls for MergeTree data parts
This commit is contained in:
parent
e3b21be1bb
commit
49c4f2ffed
@ -44,9 +44,6 @@ MergeTreeReader::MergeTreeReader(const String & path,
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!Poco::File(path).exists())
|
||||
throw Exception("Part " + path + " is missing", ErrorCodes::NOT_FOUND_EXPECTED_DATA_PART);
|
||||
|
||||
for (const NameAndTypePair & column : columns)
|
||||
addStreams(column.name, *column.type, profile_callback, clock_type);
|
||||
}
|
||||
@ -163,7 +160,7 @@ void MergeTreeReader::addStreams(const String & name, const IDataType & type,
|
||||
if (streams.count(stream_name))
|
||||
return;
|
||||
|
||||
bool data_file_exists = Poco::File(path + stream_name + DATA_FILE_EXTENSION).exists();
|
||||
bool data_file_exists = data_part->checksums.files.count(path + stream_name + DATA_FILE_EXTENSION);
|
||||
|
||||
/** If data file is missing then we will not try to open it.
|
||||
* It is necessary since it allows to add new column to structure of the table without creating new files for old parts.
|
||||
|
Loading…
Reference in New Issue
Block a user