Merge pull request #50976 from kssenii/fix-data-lakes-too-many-head-requests

Fix data lakes slowness because of synchronous head requests
This commit is contained in:
Kseniia Sumarokova 2023-06-15 13:33:09 +02:00 committed by GitHub
commit c15e7b93cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -460,7 +460,10 @@ public:
for (auto && key : all_keys)
{
std::optional<S3::ObjectInfo> info;
if (need_total_size)
/// In case all_keys.size() > 1, avoid getting object info now
/// (it will be done anyway eventually, but with delay and in parallel).
/// But progress bar will not work in this case.
if (need_total_size && all_keys.size() == 1)
{
info = S3::getObjectInfo(client_, bucket, key, version_id_, request_settings_);
total_size += info->size;