Skip to content

Commit b7054a0

Browse files
committed
feat: use hypercore for TA tables
we're enabling Timescale's hypercore feature for the TA testrun hypertable and the testrun summary and testrun branch summary CAs. We're doing this for the space savings, since we're not really doing point queries on the testruns table. We're segmenting by repoid and branch because we will almost always filter on repo_id if we're running queries against any TA table, and I'm choosing to also segment by branch because we'll be filtering by branch in some of the CAs and when we're reading raw data from the table in the API. For the orderby section I'm choosing to order by testsuite, classname, name then timestamp because i want to have similar tests grouped together in chunks so we can make the most of the compression and also because we're grouping by those fields in the computations for the CAs. the old image is 2 years old and is using timescale 2.10.2. We want to use the hypercore API so we have to have at least 2.18.0, so I'm updating the image we're using so CI works.
1 parent 1619c5e commit b7054a0

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

ci-tests.docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ services:
3838
- codecov
3939

4040
timescale:
41-
image: timescale/timescaledb-ha:pg14-latest
41+
image: timescale/timescaledb:latest-pg14
4242
environment:
4343
- POSTGRES_USER=postgres
4444
- POSTGRES_HOST_AUTH_METHOD=trust

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ services:
144144
- codecov
145145

146146
timescale:
147-
image: timescale/timescaledb-ha:pg14-latest
147+
image: timescale/timescaledb:latest-pg14
148148
environment:
149149
- POSTGRES_HOST_AUTH_METHOD=trust
150150
volumes:
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
from django.db import migrations
2+
3+
from shared.django_apps.migration_utils import RiskyRunSQL
4+
5+
6+
class Migration(migrations.Migration):
7+
dependencies = [
8+
("ta_timeseries", "0023_create_cagg_indexes"),
9+
]
10+
11+
operations = [
12+
RiskyRunSQL(
13+
"""
14+
ALTER TABLE ta_timeseries_testrun SET (
15+
timescaledb.enable_columnstore,
16+
timescaledb.segmentby = 'repo_id, branch',
17+
timescaledb.orderby = 'testsuite, classname, name, timestamp DESC'
18+
);
19+
""",
20+
reverse_sql="ALTER TABLE ta_timeseries_testrun SET (timescaledb.enable_columnstore = false);",
21+
),
22+
RiskyRunSQL(
23+
"""
24+
CALL add_columnstore_policy('ta_timeseries_testrun', INTERVAL '7 days');
25+
""",
26+
reverse_sql="CALL remove_columnstore_policy('ta_timeseries_testrun');",
27+
),
28+
]

0 commit comments

Comments
 (0)