Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to update to a newer CRDB version to support S2Cell index queries #1070

Open
jctrouble opened this issue Aug 20, 2024 · 3 comments
Open
Labels
bug Software behaves incorrectly because of this issue dss Relating to one of the DSS implementations P1 High priority

Comments

@jctrouble
Copy link

There is some high latency (700+ms) when querying SCD subscriptions for updates.

This query (source):

SELECT
  id
FROM scd_subscriptions
WHERE
  cells && ARRAY[7698420173010632704,7698420138650894336,7698420104291155968]
FOR UPDATE

triggers a full table scan (analysis bundle):

root@:26257/defaultdb> EXPLAIN SELECT id FROM scd.scd_subscriptions WHERE cells && ARRAY[7698420173010632704,7698420138650894336,7698420104291155968] FOR UPDATE;
                                          info
-----------------------------------------------------------------------------------------
  distribution: local
  vectorized: true

  • filter
  │ estimated row count: 4,450
  │ filter: cells && ARRAY[7698420173010632704,7698420138650894336,7698420104291155968]
  │
  └── • scan
        estimated row count: 13,351 (100% of the table; stats collected 1 hour ago)
        table: scd_subscriptions@primary
        spans: FULL SCAN
        locking strength: for update
(12 rows)


Time: 2ms total (execution 1ms / network 0ms)

Index support for the && operator wasn't added until Apr 9, 2022, but the current deployed CRDB version (v21.2.7) is from March 14, 2022.

In order to effectively perform these queries and use the inverted index scd_subscriptions@cell_idx, we need to update the CRDB version.

@BenjaminPelletier BenjaminPelletier added P1 High priority bug Software behaves incorrectly because of this issue dss Relating to one of the DSS implementations labels Aug 20, 2024
@jctrouble
Copy link
Author

Lots of contention too:

image

@barroco
Copy link
Contributor

barroco commented Aug 20, 2024

Thank you @jctrouble for opening this issue and the detailed analysis. The fix you referenced has been released as part of version 22.2.0. We are planning to upgrade to 24.1.3 shortly.

Screenshot 2024-08-20 at 22 41 32

barroco added a commit that referenced this issue Aug 30, 2024
As requested in #1070 in order to properly support indexes used by the DSS, this PR upgrades CockroachDB to version 24.1.3.
A backward incompatibility impacting migrations has been addressed in #1079.
Depends on #1077, #1076 and #1080 to properly upgrade the version.

This PR includes:

Upgrade of all CRDB image references from 21.2.7 to 24.1.3.
Migration notes and references to CRDB documentation.
Helm: Instructions on how to adjust CRDB Helm deployment instructions to map to our Helm chart practices
Tanka: Manual upgrade
Kubernetes steps number have been changed to 1. instead of incremented numbers to reflect editing practices of other documents.
@barroco
Copy link
Contributor

barroco commented Aug 30, 2024

Upgrade of CockroachDB to 24.1.3 addressed in #1075 and released as part of v0.17.0-rc1.
See MIGRATION.md for upgrade instructions.
Please feel free to reopen this issue if you think additional work is required.
@jctrouble May I kindly ask you to confirm that the upgrade solves the issue ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Software behaves incorrectly because of this issue dss Relating to one of the DSS implementations P1 High priority
Projects
None yet
Development

No branches or pull requests

3 participants