Skip to content

Commit

Permalink
Add ANALYZE command
Browse files Browse the repository at this point in the history
  • Loading branch information
lpsinger committed Nov 10, 2022
1 parent f63abe5 commit 73c25ab
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,15 @@ Load a sky map for LIGO/Virgo event [GW200115_042309] ([S200115j]) into the

```

Last, run [`ANALYZE`](https://www.postgresql.org/docs/current/sql-analyze.html)
to prepare the data for use:

```pycon
>>> session.execute('ANALYZE')
<sqlalchemy.engine.cursor.CursorResult object at 0x...>

```

### Sample Queries

#### What is the area of each field?
Expand Down
1 change: 1 addition & 0 deletions healpix_alchemy/tests/benchmarks/test_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
def bench(benchmark, session):

def _func(query):
session.execute('ANALYZE')
return benchmark(lambda: session.execute(query).all())

return _func
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ pytest-postgresql = "<4.0.0" # pytest-postgresql 4.0.0 uses psycopg3, but sqlal
addopts = "--doctest-glob *.md"
doctest_plus = true
doctest_optionflags = [
"ELLIPSIS",
"FLOAT_CMP"
]
filterwarnings = [
Expand Down

0 comments on commit 73c25ab

Please sign in to comment.