简体   繁体   English

带有索引的 Postgres 未记录表与不带索引的性能

[英]Postgres Unlogged Table With Index Vs Without Index Performance

How is the read / write performance with the unlogged table different from index and non-index?未记录表的读/写性能与索引和非索引有何不同?

UNLOGGED has no impact on the speed of SELECT statements, but it makes all data modifying statements faster, because no WAL has to be written. UNLOGGEDSELECT语句的速度没有影响,但它使所有的数据修改语句更快,因为不必编写 WAL。

Tables without any index are very fast for INSERT , because rows are just stuffed into the first best block of the “heap” where there is room.没有任何索引的表对于INSERT来说非常快,因为行只是被填充到有空间的“堆”的第一个最佳块中。 Indexes are up to an order of magnitude more expensive to modify, because the order has to be preserved.索引的修改成本要高出一个数量级,因为必须保留顺序。

The question of LOGGED / UNLOGGED is independent from the question of indexed/not indexed. LOGGED / UNLOGGED的问题独立于索引/未索引的问题。 Both UNLOGGED and not indexed speed up data modifications. UNLOGGED和未编制索引都加快了数据修改速度。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM