Subject | Re: [firebird-support] Re: Slow query with like '%xxx%' clause |
---|---|
Author | fabianoaspro@gmail.com |
Post date | 2012-07-13T13:52:55Z |
I agree but:
I have an system with 50.000+ clients with "%some%" too and it works vary
'fast'. In my system the sql executes in less than a second!
It does not use indexes as well but 50.000 records is too little to take
20s, 30s even 60s to run!
Yes Firebird dont will use the indexes but the key is how make the SQL
statement as I posted.
If you want send me this database and I will rewrite your SQL code to you.
Fabiano.
2012/7/13 Tupy... namb� <anhanguera@...>
I have an system with 50.000+ clients with "%some%" too and it works vary
'fast'. In my system the sql executes in less than a second!
It does not use indexes as well but 50.000 records is too little to take
20s, 30s even 60s to run!
Yes Firebird dont will use the indexes but the key is how make the SQL
statement as I posted.
If you want send me this database and I will rewrite your SQL code to you.
Fabiano.
2012/7/13 Tupy... namb� <anhanguera@...>
> **[Non-text portions of this message have been removed]
>
>
> Doesn�t matter if just using Clientes or having a join or a view, a search
> with ' like "%word%" ' will not bring the results you want, this will ever
> use table scan and will be relatively slow for your needs.
>
> Direct in the database, the only approach were you will can speed up your
> searches will be using a solution like suggested by mr.Frank
> Schlottmann-G�dde.
>
> Using only sql commands and clauses, no way to get what you want. Ms.Ann
> Harrison already said "Firebird cannot use an index on partial word matches
> unless it knows the initial characters, so your queries are all going to
> require full table scans."(On Thu, Jul 12, 2012 at 12:08 PM). To this way,
> final words.
>
> ________________________________
> From: peixinhosdalua <peixinhosdalua@...>
> To: firebird-support@yahoogroups.com
> Sent: Friday, July 13, 2012 9:57 AM
> Subject: [firebird-support] Re: Slow query with like '%xxx%' clause
>
>
> What you suggest is not a solution because just using the tables CLIENTES,
> without any join or inside a view, the problem remains. I tried it.
>
> Also, i do not want to make 'word%' search. What i need is '%word%'.
>
> ------------------------------------
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://www.firebirdsql.org/ and click the Resources item
>
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com/
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Yahoo! Groups Links
>
> [Non-text portions of this message have been removed]
>
>
>