Skip to content

Commit

Permalink
fix: Optimize ledger_range query (#1797)
Browse files Browse the repository at this point in the history
  • Loading branch information
godexsoft authored Jan 7, 2025
1 parent 698718a commit 36a9f40
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/data/cassandra/Schema.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class Schema {
'class': 'SimpleStrategy',
'replication_factor': '{}'
}}
AND durable_writes = true
AND durable_writes = True
)",
settingsProvider_.get().getKeyspace(),
settingsProvider_.get().getReplicationFactor()
Expand Down Expand Up @@ -472,7 +472,7 @@ class Schema {
R"(
UPDATE {}
SET sequence = ?
WHERE is_latest = false
WHERE is_latest = False
)",
qualifiedTableName(settingsProvider_.get(), "ledger_range")
));
Expand Down Expand Up @@ -776,7 +776,7 @@ class Schema {
R"(
SELECT sequence
FROM {}
WHERE is_latest = true
WHERE is_latest = True
)",
qualifiedTableName(settingsProvider_.get(), "ledger_range")
));
Expand All @@ -787,6 +787,7 @@ class Schema {
R"(
SELECT sequence
FROM {}
WHERE is_latest in (True, False)
)",
qualifiedTableName(settingsProvider_.get(), "ledger_range")
));
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/data/cassandra/BaseTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class BackendCassandraBaseTest : public NoLoggerFixture {
R"(
CREATE KEYSPACE IF NOT EXISTS {}
WITH replication = {{'class': 'SimpleStrategy', 'replication_factor': '1'}}
AND durable_writes = true
AND durable_writes = True
)",
keyspace
);
Expand Down Expand Up @@ -211,7 +211,7 @@ TEST_F(BackendCassandraBaseTest, KeyspaceManipulation)
R"(
CREATE KEYSPACE {}
WITH replication = {{'class': 'SimpleStrategy', 'replication_factor': '1'}}
AND durable_writes = true
AND durable_writes = True
)",
keyspace
);
Expand Down

0 comments on commit 36a9f40

Please sign in to comment.