Subject | Re: [ib-support] Blob Text Using Containing is slow?? |
---|---|
Author | Ivan Prenosil |
Post date | 2002-12-03T14:26:25Z |
> From: Leandro Segatti UOL <lesegatti@...>Depends on your requirements. CONTAINING itself never uses index for optimization, so
>
> Hi, I Have 3 Questions: Is a Good soluction to use Containing in a Blob
> Text field in FB 1.0???? Is slow????
SELECT *
FROM Million_Rows_Table
WHERE MyBlob CONTAINING 'some text';
will be probably too slow for you, because it will read/scan whole table (all blobs).
It will be reasonbly fast if you have just few hundreds (or even thousands) rows.
However Firebird is clever enough to use indexes if WHERE clause contains
additional restrictions, e.g.
SELECT *
FROM Million_Rows_Table
WHERE MyBlob CONTAINING 'some text' AND ID BETWEEN 1 AND 100;
will perform blob-scan only with 100 rows, not whole table.
(provided that ID column is indexed.)
Note that CONTAINING is not much suitable for searching blobs
if you use national characters (because it is case-sensitive then).
> Exists any optimization for the BlobFor large data volumes only full-text is viable solution
> Text and Containing?
(you should find some references in the list archive)
Ivan
http://www.volny.cz/iprenosil/interbase