developmentseed / developmentseed/eoAPI

Add SQL function to create geom/datetime indexes when creating a new Table in the public schema

Đang mở
#68 4 bình luận 0 reaction 1 người được giao Được @bitner nhận Xem trên GitHub
enhancement
Ngôn ngữ chính
Shell
Star
326
Fork
33
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

eoAPI is built on top a Postgres database that has a pgSTAC schema but also a public one we can use to store other geo data. We don't have a service to ingest data but I think it will be cool to create a simple SQL script to automatically create INDEX on any geometry and datetime column so `eoapi.vector` is fast.

```sql
CREATE OR REPLACE FUNCTION on_create_table_func()
RETURNS event_trigger AS $$
BEGIN
-- find geom/datetime column
-- add indexes
END
$$
LANGUAGE plpgsql;

CREATE EVENT TRIGGER
on_create_table ON ddl_command_end
WHEN TAG IN ('CREATE TABLE')
EXECUTE PROCEDURE on_create_table_func();
```

The function and trigger should be used in https://github.com/developmentseed/eoAPI/blob/019e4b56cbfe5919883833a3656c28ba6ad3375e/infrastructure/aws/handlers/db_handler.py#L268

cc @bitner

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.