Skip to content

Commit 5d516c6

Browse files
authored
Performance / locking fixes/enhancements (#65)
* Use a temp table rather than (slow) json concatenation in search function * Reduce locks when creating constraints by using "NOT VALID" * Add logic to remove any cached searches that use data from updated partitions on ingest (Fixes Update where_stats after ingest of new data #62 ) * Add validate_constraints function to validate any constraints constructed with NOT VALID flag * Fixes issue with docker image startup. Use pypgstac migrate for initializing docker database (Fixes cannot start database service built with pgstac:v0.3.5 #59 )
1 parent 2983165 commit 5d516c6

File tree

11 files changed

+2793
-26
lines changed

11 files changed

+2793
-26
lines changed

Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ RUN \
4242
EXPOSE 5432
4343

4444
RUN mkdir -p /docker-entrypoint-initdb.d
45-
COPY pgstac.sql /docker-entrypoint-initdb.d/
46-
COPY ./sql /docker-entrypoint-initdb.d/sql/
45+
RUN echo "#!/bin/bash \n unset PGHOST \n pypgstac migrate" >/docker-entrypoint-initdb.d/initpgstac.sh && chmod +x /docker-entrypoint-initdb.d/initpgstac.sh
4746

4847
RUN mkdir -p /opt/src/pypgstac
4948

pypgstac/pypgstac/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""PyPGStac Version."""
2-
__version__ = "0.3.5"
2+
__version__ = "0.3.6"

pypgstac/pypgstac/migrate.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ async def run_migration(
145145
await conn.close()
146146
return toversion
147147
if oldversion is None:
148+
typer.echo(
149+
"**** You can ignore error above that says relation "
150+
"pgstac.migrations does not exist *****"
151+
)
148152
typer.echo(f"No pgstac version set, installing {toversion} from scratch.")
149153
files.append(os.path.join(migrations_dir, f"pgstac.{toversion}.sql"))
150154
else:

0 commit comments

Comments
 (0)