Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up indexing with cursor_tuple_fraction pg option #11382 #11439

Open
wants to merge 1 commit into
base: dev/8.0.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion arches/install/arches-templates/project_name/settings.py-tpl
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ DATABASES = {
"ENGINE": "django.contrib.gis.db.backends.postgis",
"HOST": "localhost",
"NAME": "{{ project_name }}",
"OPTIONS": {},
"OPTIONS": {
"options": "-c cursor_tuple_fraction=1",
},
"PASSWORD": "postgis",
"PORT": "5432",
"POSTGIS_TEMPLATE": "template_postgis",
Expand Down
4 changes: 3 additions & 1 deletion arches/install/arches-templates/tests/test_settings.py-tpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ DATABASES = {
"ENGINE": "django.contrib.gis.db.backends.postgis",
"HOST": "localhost",
"NAME": "{{ project_name }}",
"OPTIONS": {},
"OPTIONS": {
"options": "-c cursor_tuple_fraction=1",
},
"PASSWORD": "postgis",
"PORT": "5432",
"POSTGIS_TEMPLATE": "template_postgis",
Expand Down
3 changes: 3 additions & 0 deletions arches/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"HOST": "localhost", # Set to empty string for localhost. Not used with sqlite3.
"PORT": "5432", # Set to empty string for default. Not used with sqlite3.
"POSTGIS_TEMPLATE": "template_postgis",
"OPTIONS": {
"options": "-c cursor_tuple_fraction=1",
},
}
}

Expand Down
3 changes: 3 additions & 0 deletions arches/settings_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ def get_optional_env_variable(var_name):
"HOST": get_env_variable("PGHOST"),
"PORT": get_env_variable("PGPORT"),
"POSTGIS_TEMPLATE": "template_postgis",
"OPTIONS": {
"options": "-c cursor_tuple_fraction=1",
},
}
}

Expand Down
3 changes: 3 additions & 0 deletions docker/settings_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ def get_optional_env_variable(var_name):
"HOST": get_env_variable("PGHOST"),
"PORT": get_env_variable("PGPORT"),
"POSTGIS_TEMPLATE": "template_postgis",
"OPTIONS": {
"options": "-c cursor_tuple_fraction=1",
},
}
}

Expand Down
10 changes: 10 additions & 0 deletions releases/8.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ Arches 8.0.0 Release Notes
- 9613 Adds editable_future_graphs and the ability to update Graphs without unpublishing.
- 11042 Adds `ResourceInstanceLifecycle`s and `ResourceInstanceLifecycleState`s

### Performance improvements
- Improve indexing and bulk deletion performance [#11382](https://github.com/archesproject/arches/issues/11382)

### Additional highlights

- Add session-based REST APIs for login, logout [#11261](https://github.com/archesproject/arches/issues/11261)
Expand Down Expand Up @@ -52,6 +55,13 @@ JavaScript:

1. Remove "3.10" from the `python-version` matrix in `.github/workflows/main.yml`.

1. In settings.py, add the following key to `DATABASES` to [improve indexing performance](https://github.com/archesproject/arches/issues/11382):
```
"OPTIONS": {
"options": "-c cursor_tuple_fraction=1",
},
```

1. Update your frontend dependencies:
```
rm -rf node_modules package-lock.json
Expand Down
4 changes: 3 additions & 1 deletion tests/fixtures/testing_prj/testing_prj/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@
"ENGINE": "django.contrib.gis.db.backends.postgis",
"HOST": "localhost",
"NAME": "testing_prj",
"OPTIONS": {},
"OPTIONS": {
"options": "-c cursor_tuple_fraction=1",
},
"PASSWORD": "postgis",
"PORT": "5432",
"POSTGIS_TEMPLATE": "template_postgis",
Expand Down