Use inspect-file, if possible, for total row count (#666)

For large tables, counting the number of rows in the table can take a
significant amount of time. Instead, where an inspect-file is provided
for an immutable database, look up the row-count for a plain count(*).

Thanks, @kevindkeogh
This commit is contained in:
Kevin Keogh 2020-02-25 15:19:29 -05:00 committed by GitHub
commit 3041c6b641
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 1 deletions

View file

@ -227,6 +227,12 @@ def app_client_with_cors():
yield from make_app_client(cors=True)
@pytest.fixture(scope="session")
def app_client_immutable_and_inspect_file():
inspect_data = {'fixtures': {'tables': {'sortable': {'count': 100}}}}
yield from make_app_client(is_immutable=True, inspect_data=inspect_data)
def generate_compound_rows(num):
for a, b, c in itertools.islice(
itertools.product(string.ascii_lowercase, repeat=3), num