Skip to content

Commit bd539fb

Browse files
committed
Reduce the data file chunk size to have smaller Parquet files
1 parent 78b0ac9 commit bd539fb

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

src/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
)
99

1010
const (
11-
VERSION = "0.51.0"
11+
VERSION = "0.51.1"
1212

1313
ENV_PORT = "BEMIDB_PORT"
1414
ENV_DATABASE = "BEMIDB_DATABASE"

src/syncer.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const (
1919
MAX_PG_ROWS_BATCH_SIZE = 1 * 1024 * 1024 // 1 MB
2020
PING_PG_INTERVAL_SECONDS = 24
2121

22-
MAX_PARQUET_PAYLOAD_THRESHOLD = 4 * 1024 * 1024 * 1024 // 4 GB (compressed to ~512 MB Parquet)
22+
MAX_PARQUET_PAYLOAD_THRESHOLD = 2 * 1024 * 1024 * 1024 // 2 GB (compressed to ~256 MB Parquet)
2323
)
2424

2525
type Syncer struct {
@@ -48,7 +48,11 @@ func NewSyncer(config *Config) *Syncer {
4848

4949
func (syncer *Syncer) SyncFromPostgres() {
5050
ctx := context.Background()
51-
syncer.sendAnonymousAnalytics("sync-start")
51+
if syncer.config.Pg.IncrementallyRefreshedTables == nil {
52+
syncer.sendAnonymousAnalytics("sync-start")
53+
} else {
54+
syncer.sendAnonymousAnalytics("sync-start-incremental")
55+
}
5256

5357
databaseUrl := syncer.urlEncodePassword(syncer.config.Pg.DatabaseUrl)
5458
icebergSchemaTables, icebergSchemaTablesErr := syncer.icebergReader.SchemaTables()
@@ -86,7 +90,11 @@ func (syncer *Syncer) SyncFromPostgres() {
8690
syncer.deleteOldIcebergSchemaTables(syncedPgSchemaTables)
8791
}
8892

89-
syncer.sendAnonymousAnalytics("sync-finish")
93+
if syncer.config.Pg.IncrementallyRefreshedTables == nil {
94+
syncer.sendAnonymousAnalytics("sync-finish")
95+
} else {
96+
syncer.sendAnonymousAnalytics("sync-finish-incremental")
97+
}
9098
}
9199

92100
func (syncer *Syncer) WriteInternalStartSqlFile(pgSchemaTables []PgSchemaTable) {

0 commit comments

Comments
 (0)