Vinyl 引擎的 len() 和 count() 有什么区别?

What is the difference between len() and count() for the Vinyl engine?

我对 space:len()space:count() 对于 space 使用乙烯基发动机的结果不同。这些方法有什么用 return?

扫描乙烯基 space 并计算确切数量可能非常昂贵,这就是 :len() function exists. It gives you fast but approximate result. If it doesn't work for you, use :count() 函数的原因。它进行全面扫描并 returns 正确结果。

有关更多信息,相关 issue on this topic and implementation commit 说明如下:

index.len returns the total number of rows stored in the index.
It is the sum of memory.rows and disk.rows as reported by
index.info. Note, it may be greater than the number of tuples
stored in the space, because it includes DELETE and UPDATE
statements.