Subject | Re: Firebird Usage Question |
---|---|
Author | Svein Erling |
Post date | 2004-05-06T14:45:51Z |
Well, you could possibly save some time by using parameters rather
than rewriting the query for each execution, e.g.
SQL_Text:='select * from palavra where original like :Param1 and ' +
'ordenada not like :Param2 and original=ordenada';
But the main bottleneck in your case is probably that you cannot use
any indexes (indexes cannot be used when you do not know the beginning
of the string, nor when using NOT).
Hence, I think your query will be slow regardless of how you do it.
The opposite,
SQL_Text:='select * from palavra where original starting :Param1 ' +
'and ordenada not like :Param2 and original=ordenada';
should execute considerably quicker if you had a decent index for
original.
Set
than rewriting the query for each execution, e.g.
SQL_Text:='select * from palavra where original like :Param1 and ' +
'ordenada not like :Param2 and original=ordenada';
But the main bottleneck in your case is probably that you cannot use
any indexes (indexes cannot be used when you do not know the beginning
of the string, nor when using NOT).
Hence, I think your query will be slow regardless of how you do it.
The opposite,
SQL_Text:='select * from palavra where original starting :Param1 ' +
'and ordenada not like :Param2 and original=ordenada';
should execute considerably quicker if you had a decent index for
original.
Set