On 20/04/2012 10:36, Werner wrote:
I use Firebird SQL, and "like" has a pretty bad performance compared to "starting with", as the later uses an index if one is available.

When using "someklass.somecolumn.startswith('value') SA uses "like", what would have to be done to use "starting with" instead for the Firebird dialect?

Hhm,

The performance issue should be solved with 2.1+, so did some more search and testing.

SA generates something like this when using "startswith" - correct?

select name from cepagesyn where NAME like 'merlot' || '%%';

If I run the above in IBExpert (the db tool I use to admin) it is very slow as the plan is "CEPAGESYN NATURAL"

if I use:

select name from cepagesyn where NAME like 'merlot%';

PLAN (CEPAGESYN INDEX (IX_CEPAGESYN_NAME))

So, could the FB dialect be tweaked to do the concatenation in Python instead of how it is done now?

Werner

--
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to