Replies: 1 comment 1 reply
-
Can you quote some numbers on the potential performance gain? AFAIK the query plan will be exactly the same, so it's just the difference in pre-processing. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Motivation and Proposal
A change was made to sea-query adding
PgFunc::starts_with()
to support PostgreSQL'sstarts_with
function. (Issue: SeaQL/sea-query#520, PR: SeaQL/sea-query#529)Within Sea-ORM, for the
ColumnTrait::starts_with()
method, a branch could be added to check for Postgres, and if so, have it usestarts_with(column, 'prefix')
instead ofLIKE 'prefix%'
for an improvement in query performance. This would be transparent to the caller, so they could switch to a different DB backend with no change in code here.Current Workarounds
Just using
starts_with()
and taking the performance hit.Beta Was this translation helpful? Give feedback.
All reactions