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
[#26512] YSQL: Support MOD and some text expression pushdown in mixed mode
Summary:
Add support and tests for pushing down MOD, LIKE, ASCII, SUBSTRING when in mixed mode of a major
version upgrade.
Also, update the initiatial definition of `yb_mixed_mode_expression_pushdown` to `true` in `ybc_guc.cc` to match it's default in `guc.c`.
**Upgrade/Rollback safety**
This is safe without autoflags because tservers (both PG11 and PG15) already know how to handle each of these functions. Versions before this change will not push them down, versions with this change will push down these functions. However, in either case, whatever is sent to DocDB can be handled by default.
Jira: DB-15879
Test Plan:
```
./yb_build.sh --cxx-test integration-tests_ysql_major_upgrade_expression_pushdown-test
./yb_build.sh --cxx-test integration-tests_ysql_major_upgrade_expression_pushdown-test --gtest_filter YsqlMajorUpgradeExpressionPushdownTest.TestStringOperations
```
Output of the python collector script:
```
UNTESTED WHITELISTED FUNCTIONS 1 / 276
{2074: 'F_SUBSTRING_TEXT_TEXT_TEXT'}
```
`SUBSTRING_TEXT_TEXT_TEXT` is difficult to test, as it always gets rewritten to another
function. It is left whitelisted though.
```
explain analyze select * from tttt where (substring(t, 'h.'::text, c) = 'he'::text);
QUERY PLAN
----------------------------------------------------------------------------------------------------
Seq Scan on tttt (cost=0.00..110.00 rows=1000 width=40) (actual time=3.630..3.631 rows=0 loops=1)
Storage Filter: ("substring"(t, similar_to_escape('h.'::text, (c)::text)) = 'he'::text)
Planning Time: 1.686 ms
Execution Time: 3.754 ms
(4 rows)
```
Notice that `substring(t, 'h.'::text, c)` was rewritten to `"substring"(t, similar_to_escape('h.'::text, (c)::text))`
Reviewers: hsunder, amartsinchyk, fizaa
Reviewed By: fizaa
Subscribers: svc_phabricator, jason, yql
Differential Revision: https://phorge.dev.yugabyte.com/D42372
0 commit comments