Merge branch 'main' of github.com:uabluerail/indexer

main
mathan 2024-02-25 09:05:50 -08:00
commit 2172651870
4 changed files with 22 additions and 3 deletions

View File

@ -1,7 +1,8 @@
alter table records alter content set compression lz4;
alter table records rename to records_like; alter table records rename to records_like;
create table records create table records
(like records_like including defaults) (like records_like including defaults including compression)
partition by list (collection); partition by list (collection);
drop index idx_repo_record_key; drop index idx_repo_record_key;

View File

@ -0,0 +1,12 @@
-- Only affects future writes
alter table records_like alter content set compression lz4;
alter table records alter content set compression lz4;
alter table records_default alter content set compression lz4;
alter table records_post alter content set compression lz4;
alter table records_follow alter content set compression lz4;
alter table records_block alter content set compression lz4;
alter table records_repost alter content set compression lz4;
alter table records_profile alter content set compression lz4;
alter table records_list alter content set compression lz4;
alter table records_listblock alter content set compression lz4;
alter table records_listitem alter content set compression lz4;

View File

@ -13,7 +13,13 @@ services:
environment: environment:
POSTGRES_DB: bluesky POSTGRES_DB: bluesky
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD:?specify password in .env file}" POSTGRES_PASSWORD: "${POSTGRES_PASSWORD:?specify password in .env file}"
command: ["-c", "max_connections=1000"] command: [
"-c", "max_connections=1000",
"-c", "shared_buffers=8GB",
"-c", "work_mem=2GB",
"-c", "max_parallel_workers_per_gather=8",
]
shm_size: '16gb'
lister: lister:
build: build:
context: . context: .

View File

@ -38,7 +38,7 @@ type Record struct {
Rkey string `gorm:"index:idx_repo_record_key,unique,priority:3"` Rkey string `gorm:"index:idx_repo_record_key,unique,priority:3"`
AtRev string `gorm:"index:idx_repo_rev"` AtRev string `gorm:"index:idx_repo_rev"`
Content json.RawMessage `gorm:"type:JSONB"` Content json.RawMessage `gorm:"type:JSONB"`
Deleted bool Deleted bool `gorm:"default:false"`
} }
func AutoMigrate(db *gorm.DB) error { func AutoMigrate(db *gorm.DB) error {