데이터베이스에 이미 몇 백만 개의 행이 있습니다. 스키마를 설계 할 때 PostgreSQL UUID 데이터 형식에 대해 몰랐습니다.
테이블 중 하나에는 16M 개의 행 (샤드 당 약 3.5M-4M 레코드)이 있으며 하루에 약 500K 레코드로 증가합니다. 필요한 경우 몇 시간 동안 프로덕션 시스템을 중단시키는 사치가 여전히 남아 있습니다. 1-2 주 안에이 사치를 누리지 못할 것입니다.
내 질문은 그렇게 할 가치가 있습니까? JOIN 성능, 디스크 공간 사용 (전체 gzip의 덤프는 1.25GiB), 그 특성에 대해 궁금합니다.
테이블 스키마는 다음과 같습니다.
# \d twitter_interactions
Table "public.twitter_interactions"
Column | Type | Modifiers
-------------------------+-----------------------------+-----------
interaction_id | character(36) | not null
status_text | character varying(1024) | not null
screen_name | character varying(40) | not null
twitter_user_id | bigint |
replying_to_screen_name | character varying(40) |
source | character varying(240) | not null
tweet_id | bigint | not null
created_at | timestamp without time zone | not null
Indexes:
"twitter_interactions_pkey" PRIMARY KEY, btree (interaction_id)
"twitter_interactions_tweet_id_key" UNIQUE, btree (tweet_id)
"index_twitter_interactions_on_created_at" btree (created_at)
"index_twitter_interactions_on_screen_name" btree (screen_name)
Triggers:
insert_twitter_interactions_trigger BEFORE INSERT ON twitter_interactions FOR EACH ROW EXECUTE PROCEDURE twitter_interactions_insert_trigger()
Number of child tables: 9 (Use \d+ to list them.)