Subject | Re: Firebird Usage Question |
---|---|
Author | bazarin |
Post date | 2004-05-06T15:10:04Z |
Set:
While waiting for clues, I did changed the SQL for parameters, like:
DM.cdsPalavra.Params.ParamBtName
('pfLetra').AsString:= '''%'+Letra+'''';
DM.cdsPalavra.Params.ParamBtName
('piLetra').AsString:= ''''+Letra+'%''';
and the SQL to:
SQL_Text:='select * from palavra where original like :piLetra and
ordenada not like :pfLetra and original=ordenada;
I could get a little bit better performance (less than 5% I think),
but the final results are the same.
I expected that Firebird could deal with concurrent requests in the
same table doing a very good conflict(lock) administration, but
that's something I am not convinced to.
Another thing, as this is a test, for sure this SQL is not the one's
I will use so 'original starting :Param1' could increase the
performance, but the will not solve the problem (How to run 100 users
acessing the same database with very intensive SQL requests with a
good performance - I considered a good performance if 100 users could
run their SQL with some percentage time of one user and not 100 times
of that).
Thank you for you prompted answer and I will keep searching a
solution.
Regards,
Wagner
--- In firebird-support@yahoogroups.com, "Svein Erling"
<svein.erling.tysvaer@k...> wrote:
While waiting for clues, I did changed the SQL for parameters, like:
DM.cdsPalavra.Params.ParamBtName
('pfLetra').AsString:= '''%'+Letra+'''';
DM.cdsPalavra.Params.ParamBtName
('piLetra').AsString:= ''''+Letra+'%''';
and the SQL to:
SQL_Text:='select * from palavra where original like :piLetra and
ordenada not like :pfLetra and original=ordenada;
I could get a little bit better performance (less than 5% I think),
but the final results are the same.
I expected that Firebird could deal with concurrent requests in the
same table doing a very good conflict(lock) administration, but
that's something I am not convinced to.
Another thing, as this is a test, for sure this SQL is not the one's
I will use so 'original starting :Param1' could increase the
performance, but the will not solve the problem (How to run 100 users
acessing the same database with very intensive SQL requests with a
good performance - I considered a good performance if 100 users could
run their SQL with some percentage time of one user and not 100 times
of that).
Thank you for you prompted answer and I will keep searching a
solution.
Regards,
Wagner
--- In firebird-support@yahoogroups.com, "Svein Erling"
<svein.erling.tysvaer@k...> wrote:
> Well, you could possibly save some time by using parameters ratheruse
> 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
> any indexes (indexes cannot be used when you do not know thebeginning
> 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