Skip to content

feat(sql): Modify partition scheme for pgvs#137

Merged
devsjc merged 1 commit intomainfrom
devsjc/pgv-partition-by-forecast-uuid
Mar 24, 2026
Merged

feat(sql): Modify partition scheme for pgvs#137
devsjc merged 1 commit intomainfrom
devsjc/pgv-partition-by-forecast-uuid

Conversation

@devsjc
Copy link
Copy Markdown
Contributor

@devsjc devsjc commented Mar 24, 2026

Contribution Checklist

  • Have you followed the Open Climate Fix Contribution Guidelines?
  • Have you referenced the Issue this PR addresses, where applicable?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added a summary of the changes?
  • Have you written new tests for your changes, where applicable?
  • Have you successfully run make lint with your changes locally?
  • Have you successfully run make test with your changes locally?

Warning

PRs may be closed if all the above boxes are not checked.

Changes in this Pull Request

Aligns partitioning in the forecasts and predeicted_generation_values tables for speedier querying.

@devsjc devsjc force-pushed the devsjc/pgv-partition-by-forecast-uuid branch from 003ac78 to 72557dd Compare March 24, 2026 11:14
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 24, 2026

Benchmark Results

Benchmark results
?   	github.com/openclimatefix/data-platform/cmd	[no test files]
?   	github.com/openclimatefix/data-platform/internal/gen/ocf/dp	[no test files]
?   	github.com/openclimatefix/data-platform/internal/interceptors	[no test files]
PASS
ok  	github.com/openclimatefix/data-platform/internal/server/dummy	0.005s
{"level":"debug","time":"2026-03-24T11:16:47Z","message":"Completed migrations"}
goos: linux
goarch: amd64
pkg: github.com/openclimatefix/data-platform/internal/server/postgres
cpu: AMD EPYC 7763 64-Core Processor                
BenchmarkPostgresClient/small/GetForecastAsTimeseries-4         	      66	  17288058 ns/op
BenchmarkPostgresClient/small/GetForecastAtTimestamp-4          	      79	  15007431 ns/op
BenchmarkPostgresClient/small/GetObservationsAsTimeseries-4     	     894	   1269202 ns/op
BenchmarkPostgresClient/small/CreateForecast-4                  	      88	  13041524 ns/op
PASS
ok  	github.com/openclimatefix/data-platform/internal/server/postgres	72.293s
?   	github.com/openclimatefix/data-platform/internal/server/postgres/gen	[no test files]
Benchmark vs base branch
goos: linux
goarch: amd64
pkg: github.com/openclimatefix/data-platform/internal/server/postgres
cpu: AMD EPYC 7763 64-Core Processor                
                                                   │ bench-main.txt │ bench-devsjc-pgv-partition-by-forecast-uuid.txt │
                                                   │     sec/op     │         sec/op           vs base                │
PostgresClient/small/GetForecastAsTimeseries-4         21.08m ± ∞ ¹              17.29m ± ∞ ¹       ~ (p=1.000 n=1) ²
PostgresClient/small/GetForecastAtTimestamp-4          14.82m ± ∞ ¹              15.01m ± ∞ ¹       ~ (p=1.000 n=1) ²
PostgresClient/small/GetObservationsAsTimeseries-4     1.207m ± ∞ ¹              1.269m ± ∞ ¹       ~ (p=1.000 n=1) ²
PostgresClient/small/CreateForecast-4                  14.63m ± ∞ ¹              13.04m ± ∞ ¹       ~ (p=1.000 n=1) ²
geomean                                                8.620m                    8.095m        -6.08%
¹ need >= 6 samples for confidence interval at level 0.95
² need >= 4 samples to detect a difference at alpha level 0.05

@devsjc devsjc merged commit e81e748 into main Mar 24, 2026
4 checks passed
@devsjc devsjc deleted the devsjc/pgv-partition-by-forecast-uuid branch March 24, 2026 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant