Optimize performance for queries on recent rows of a large table

前端 未结 2 681
眼角桃花
眼角桃花 2021-01-14 18:34

I have a large table:

CREATE TABLE \"orders\" (
\"id\" serial NOT NULL,
\"person_id\" int4,
\"created\" int4,
CONSTRAINT \"orders_pkey\" PRIMARY KEY (\"id\")         


        
2条回答
  •  一个人的身影
    2021-01-14 19:39

    Suggesstion:-

    It may help you. Since the table size is growing, your query performance going to be decreased gradually. Better maintain 3-5 days ( If you are very sure about going to access only 2-3 days ) records and periodically migrate the old records to backup table.

提交回复
热议问题