Company
Date Published
Author
Bryn Llewellyn
Word count
1425
Language
English
Hacker News points
None

Summary

The use of partial indexes in distributed SQL databases can significantly improve performance by reducing the maintenance cost of secondary indexes, which are particularly beneficial when dealing with sparse columns where only a small fraction of rows have non-null values. This approach is especially useful in distributed databases like YugabyteDB, where multi-shard transactions can be costly. By using a partial index, the response time for inserts, updates, and deletes can be shortened significantly, as well as the response times for single-row selects. The results of performance tests conducted on a local MacBook and a three-node cluster hosted on AWS showed that regular indexes outperformed partial indexes in terms of elapsed time, but with speed ratios being the same across different environments, indicating that partial indexes can still provide significant benefits.