Skip to content

Commit

Permalink
Run explain with analyze and buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarton committed Dec 17, 2024
1 parent a3a41b0 commit 3e481a5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion epilepsy12/common_view_functions/aggregate_by.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ def update_kpi_aggregation_model(

print(f"!! kpi_value_counts query !!")
print(f"!! {kpi_value_counts.query} !!")
print(f"!! {kpi_value_counts.explain()}")
print(f"!! {kpi_value_counts.explain(analyze=True, buffers=True)}")

# update models where numbers have changed.
for value_count in kpi_value_counts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@

@pytest.fixture
def disable_nested_loops_in_db(db):
cursor = connection.cursor()
print("!! Disabling nested loops in DB")
cursor.execute("SET enable_nestloop TO off")
yield
print("!! Re-enabling nested loops in DB")
cursor.execute("SET enable_nestloop TO on")
pass
# cursor = connection.cursor()
# print("!! Disabling nested loops in DB")
# cursor.execute("SET enable_nestloop TO off")
# yield
# print("!! Re-enabling nested loops in DB")
# cursor.execute("SET enable_nestloop TO on")


@pytest.mark.parametrize(
Expand Down
6 changes: 3 additions & 3 deletions s/pr-check
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -e

s/test
# s/test

# s/test -s epilepsy12/tests/common_view_functions_tests/aggregate_by_tests/test_calculate_kpi_value_counts_queryset.py \
# epilepsy12/tests/common_view_functions_tests/aggregate_by_tests/test_update_kpiaggregation_model.py
s/test -s epilepsy12/tests/common_view_functions_tests/aggregate_by_tests/test_calculate_kpi_value_counts_queryset.py \
epilepsy12/tests/common_view_functions_tests/aggregate_by_tests/test_update_kpiaggregation_model.py

0 comments on commit 3e481a5

Please sign in to comment.