mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Log number of rows in user tables in data engine
Summary: Adds a method Table._num_rows using an empty lookup map column. Adds a method Engine.count_rows which adds them all up. Returns the count after applying user actions to be logged by ActiveDoc. Test Plan: Added a unit test in Python. Tested log message manually. Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D3275
This commit is contained in:
@@ -111,6 +111,13 @@ class BaseLookupMapColumn(column.BaseColumn):
|
||||
if not self._lookup_relations:
|
||||
self._engine.mark_lookupmap_for_cleanup(self)
|
||||
|
||||
def _do_fast_empty_lookup(self):
|
||||
"""
|
||||
Simplified version of do_lookup for a lookup column with no key columns
|
||||
to make Table._num_rows as fast as possible.
|
||||
"""
|
||||
return self._row_key_map.lookup_right((), default=())
|
||||
|
||||
def do_lookup(self, key):
|
||||
"""
|
||||
Looks up key in the lookup map and returns a tuple with two elements: the set of matching
|
||||
|
||||
Reference in New Issue
Block a user