Issue 256 - move camsl to geo_point table#263
Issue 256 - move camsl to geo_point table#263jo-asplin-met-no wants to merge 14 commits intomainfrom
Conversation
lukas-phaf
left a comment
There was a problem hiding this comment.
I did a high level review, focusing mostly on the protobuf and postgres migrations. I have added some comments around these, and will try to get to the golang code later.
A general question is how we test this, as there is no ingestion and/or API support to see if inserting and querying actually works (unless I am missing something).
Ideally, we would have the ingestion and API in the same PR, so that we can add some camsl's to the test dataset, and confirm that everything works by testing that the data shows up in the API, preferable using the camsl range query.
| ALTER TABLE geo_point ADD COLUMN camsl INTEGER; | ||
|
|
||
| -- drop UNIQUE constraint of 'point' column | ||
| -- WARNING: we assume that the constraint name is the correct one (it was never explicitly set) |
There was a problem hiding this comment.
The original table definition was this:
id BIGINT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
point GEOGRAPHY(Point, 4326) NOT NULL UNIQUE
);
CREATE INDEX geo_point_idx ON geo_point USING GIST(point);
This gave the following constraint and indieces:


After forcing the migration to your branch, I have the following constraint and indices:


This corresponds to the indices that you would get with the following table definition (without any migrations):
CREATE TABLE geo_point(
id BIGINT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
point GEOGRAPHY(Point, 4326),
camsl INTEGER,
CONSTRAINT geo_point_point_camsl_key UNIQUE NULLS NOT DISTINCT (point, camsl)
);
CREATE INDEX geo_point_idx ON geo_point USING GIST(point);
So I guess the question is, do we want to have a GIST index that includes camsl? This depends on the query, which I haven't looked at.
There was a problem hiding this comment.
Good question. Need to look into it again.
datastore/datastore/storagebackend/postgresql/putobservations.examples.sql
Show resolved
Hide resolved
lukas-phaf
left a comment
There was a problem hiding this comment.
Note to also fix just load. Gives concurrency errors...
datastore/datastore/storagebackend/postgresql/putobservations.go
Outdated
Show resolved
Hide resolved
|
When you continue working with this can you add it to |
This change ensures that 'just test' and 'just ingest-test' can be run without first running 'just up'. So for example: instead of doing $ just destroy $ just up $ just test you can now simply do $ just destroy $ just test
|
I got stuck on |
Fair enough. The problem is not obvious to me by just reading the statement. I will try to look at this tomorrow. |
I committed a fix, which make the I did not yet update the file with example queries. |
…EUMETNET/e-soh into issue_256_move_camsl_to_geo_point_table
Fixes Issue 256.