In Postgres RDS my tables take around 500MB, but it says I am using 17GB?

0

Why does it say I am using so much more space?

I did a bit of searching, and it might be the temporary files. Can you tell me how to clear them? I haven't found a way to connect to RDS to view or clear those files.

1개 답변
0

I would look into VACUUM: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.PostgreSQL.CommonDBATasks.Autovacuum.html. It is a PostgreSQL feature that cleans up space caused by deleted or updated rows.

As an example, you can try to run SQL query to see if your tables need vacuuming:

SELECT datname, age(datfrozenxid) FROM pg_database ORDER BY age(datfrozenxid) desc limit 20;

profile picture
전문가
답변함 일 년 전
  • I ran VACUUM FULL and it says 0 rows were updated.

    I am suspecting that the problem is with temporary files, as I had the flag remove_temp_files_after_crash switched off by default, so a lot of garbage accumulated over time. Is there a way to clear those temporary files? I believe this is a managed DB so I can't access the files directly...

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠