Slow execution of copy command and multi-row inserts

23 Jan 2024
Product Affected Versions Related Issues Fixed In
YSQL v2.19.1.x, v2.20.0.x #20398 v2.20.1.3

Description

You can face slow data load when using the copy command or when doing multi-row inserts. This particular issue can be identified with the following metrics.

  • Low bloom filter usage; very low value for metrics rocksdb_bloom_filter_checked and rocksdb_bloom_filter_useful
  • High block cache miss; high value for metric rocksdb_block_cache_data_miss

Mitigation

Upgrade to a release with the fix.

Details

Data load into a table using multi-insert statements or copy command slowed performance due to a bug in bloom filter check. This issue arose from two commits which were preventing bloom filters from being used. To address this, the commits were reverted, although this action needed to be selective to retain a crucial bug fix. A fix that addresses the issue essentially includes a rollback of the original changes, while preserving the necessary bug fix. The fix has been backported and is available in v2.20.1.3+ and v2.20.2.0.