mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Add IStorage::totalBytes() interface
This commit is contained in:
parent
c2fbba7b9c
commit
4a7ee947b2
@ -459,13 +459,31 @@ public:
|
||||
/// Returns storage policy if storage supports it
|
||||
virtual StoragePolicyPtr getStoragePolicy() const { return {}; }
|
||||
|
||||
/** If it is possible to quickly determine exact number of rows in the table at this moment of time, then return it.
|
||||
*/
|
||||
/// If it is possible to quickly determine exact number of rows in the table at this moment of time, then return it.
|
||||
/// Used for:
|
||||
/// - Simple count() opimization
|
||||
/// - For total_rows column in system.tables
|
||||
///
|
||||
/// Does takes underlying Storage (if any) into account.
|
||||
virtual std::optional<UInt64> totalRows() const
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
/// If it is possible to quickly determine exact number of bytes for the table on storage:
|
||||
/// - memory (approximated)
|
||||
/// - disk (compressed)
|
||||
///
|
||||
/// Used for:
|
||||
/// - For total_bytes column in system.tables
|
||||
//
|
||||
/// Does not takes underlying Storage (if any) into account
|
||||
/// (since for Buffer we still need to know how much bytes it uses).
|
||||
virtual std::optional<UInt64> totalBytes() const
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
private:
|
||||
/// You always need to take the next three locks in this order.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user