문제

I have question about PostgreSQL join. Does PostgreSQL create temporary table for JOINed tables or it makes everything
without any temporary tables?

The reason of my question is: When I make SELECT request with many JOINs, I see IO spike in write operations. What can be the reason of this issue?

Thanks a lot.

도움이 되었습니까?

해결책

PostgreSQL will temporarily spill result-sets to disk if they get large enough. Unless you have a database smaller than your RAM it doesn't have much choice.

However, you can also see unexpected writes if this is the first time you have read in data pages since they were created. There are "hint bits" set on each page to optimise visibility checks. These get set when vacuuming etc. or when a page is accessed. If you do a large import followed by a table scan you can get a lot of unexpected IO as all the hint bits get set and written out.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top