File tree 8 files changed +10
-15
lines changed
pragma-entities/migrations
2023-11-18-131303_add_entries_index
2023-11-18-143139_add_composite_index
2023-11-24-185951_add_source_index
2023-12-29-052754_add_hypertable_entries
8 files changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ services:
44
44
dockerfile : infra/pragma-node/Dockerfile
45
45
46
46
db :
47
- image : timescale/timescaledb:1.7.4-pg12
47
+ image : timescale/timescaledb-ha:pg14-latest
48
48
restart : always
49
49
user : postgres
50
50
secrets :
@@ -61,7 +61,7 @@ services:
61
61
expose :
62
62
- 5432
63
63
healthcheck :
64
- test : ["CMD", "pg_isready"]
64
+ test : [ "CMD", "pg_isready" ]
65
65
interval : 10s
66
66
timeout : 5s
67
67
retries : 5
@@ -102,7 +102,7 @@ services:
102
102
" kafka-topics" ,
103
103
" --list" ,
104
104
" --bootstrap-server" ,
105
- " pragma-kafka:9092" ,
105
+ " pragma-kafka:9092"
106
106
]
107
107
environment :
108
108
KAFKA_BROKER_ID : 1
@@ -153,6 +153,7 @@ volumes:
153
153
pragma_zookeeper_data :
154
154
pragma_zookeeper_logs :
155
155
156
+
156
157
secrets :
157
158
db-password :
158
159
file : infra/db/password.txt
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
-- This file should undo anything in `up.sql`
2
- DROP INDEX IF EXISTS idx_entries_source ;
2
+ DROP INDEX IF EXISTS idx_entries_unique ;
Original file line number Diff line number Diff line change 1
1
-- Your SQL goes here
2
- DROP INDEX IF EXISTS idx_entries_publisher_source_timestamp;
3
- CREATE INDEX idx_entries_source ON entries(source);
2
+ CREATE UNIQUE INDEX idx_entries_unique
3
+ ON entries(pair_id, source, timestamp );
Original file line number Diff line number Diff line change 1
1
-- Your SQL goes here
2
- SELECT create_hypertable(' entries' , ' timestamp' );
2
+ SELECT create_hypertable(' entries' , by_range(' timestamp' ));
3
+ SELECT * FROM add_dimension(' entries' , by_hash(' pair_id' , 4 ))
4
+ SELECT * FROM add_dimension(' entries' , by_hash(' source' , 4 ))
You can’t perform that action at this time.
0 commit comments