You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running TPC-DS benchmarks on Cloudberry, we noticed that queries on string columns (item descriptions, store names, customer names, etc.) often cause ORCA to fall back to the Postgres planner. The root cause is that ORCA currently does not support columns with COLLATE "C", as tracked in issue #717.
Beyond fixing the fallback, there is a broader performance opportunity: locale C is significantly faster than locale-aware collations for string comparisons.
libc/C collation is the fastest across nearly every benchmark
Even the newer ICU and builtin providers lag significantly behind C
The overhead of locale-aware collation accumulates heavily in analytical workloads like TPC-DS
Current Behavior in Cloudberry / ORCA
-- Table with default collation: ORCA handles it
EXPLAIN SELECT*FROM tbl ORDER BY v;
-- Optimizer: Pivotal Optimizer (GPORCA)-- Table with COLLATE "C": ORCA falls back
EXPLAIN SELECT*FROM tbl_collate_c ORDER BY v;
-- Optimizer: Postgres query optimizer (fallback!)
This means for TPC-DS string columns defined with COLLATE "C", we lose ORCA's superior join ordering, parallel aggregation plans, and better sort/merge strategies.
Proposal
We have opened issue #1603 to track the work. The proposed steps are:
Fix ORCA to support COLLATE "C" (prerequisite: [Bug] ORCA fallbacks for collate "C" #717) — teach ORCA to recognize and use C collation in sort keys, merge keys, and equality operators
Ensure ORCA's string comparison operators are collation-aware — avoid incorrect plans when mixing collations
Recommend C locale for TPC-DS test tables — document or script the best-practice setup so benchmarks reflect ORCA's full optimization capability
Discussion Questions
Should Cloudberry's default cluster initialization (initdb) recommend or default to LC_COLLATE=C for analytical workloads?
Are there correctness concerns with C collation in a distributed MPP setting (e.g., segment-level sort merge across different OS locales)?
What is the right approach for ORCA to handle multiple collations — treat them as opaque and fall back, or model them explicitly in the optimizer?
Has anyone already tested TPC-DS with LC_COLLATE=C on Cloudberry? What were your findings?
Would love to hear thoughts from the community, especially from contributors familiar with ORCA internals and anyone who has run TPC-DS benchmarks on Cloudberry.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Motivation
When running TPC-DS benchmarks on Cloudberry, we noticed that queries on string columns (item descriptions, store names, customer names, etc.) often cause ORCA to fall back to the Postgres planner. The root cause is that ORCA currently does not support columns with
COLLATE "C", as tracked in issue #717.Beyond fixing the fallback, there is a broader performance opportunity: locale C is significantly faster than locale-aware collations for string comparisons.
Performance Evidence
A detailed benchmark published by depesz — How much speed you are leaving at the table if you use default locale — shows:
Key takeaways:
libc/Ccollation is the fastest across nearly every benchmarkCurrent Behavior in Cloudberry / ORCA
This means for TPC-DS string columns defined with COLLATE "C", we lose ORCA's superior join ordering, parallel aggregation plans, and better sort/merge strategies.
Proposal
We have opened issue #1603 to track the work. The proposed steps are:
Discussion Questions
initdb) recommend or default toLC_COLLATE=Cfor analytical workloads?LC_COLLATE=Con Cloudberry? What were your findings?Would love to hear thoughts from the community, especially from contributors familiar with ORCA internals and anyone who has run TPC-DS benchmarks on Cloudberry.
References
Beta Was this translation helpful? Give feedback.
All reactions