ฉันมีไม่กี่ล้านแถวในฐานข้อมูลของฉันแล้ว ฉันไม่รู้เกี่ยวกับชนิดข้อมูล PostgreSQL UUID เมื่อฉันออกแบบสคีมาของฉัน
หนึ่งในตารางมีแถว 16M (ประมาณ 3.5M ถึง 4 M ระเบียนต่อชาร์ด) เติบโตที่ประมาณ 500K ระเบียนต่อวัน ฉันยังคงมีความหรูหราในการทำให้ระบบการผลิตหยุดลงหากต้องการ ฉันจะไม่มีความหรูหรานี้ในหนึ่งหรือสองสัปดาห์
คำถามของฉันคือมันจะคุ้มค่าที่จะทำเช่นนั้น? ฉันสงสัยเกี่ยวกับประสิทธิภาพของ JOIN การใช้พื้นที่ดิสก์ (การถ่ายโอนข้อมูลแบบเต็ม gzip คือ 1.25 GiB) สิ่งต่าง ๆ ในลักษณะนั้น
สคีมาของตารางคือ:
# \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.)