Hello Jose,

On Wed, Jun 23, 2010 at 11:26 AM, JOSE FELIX HERNANDEZ BARRIO
<[email protected]> wrote:
> hi,
>
> in a repository with 1 million records
>
> if i execute the query :
> select * from test:Contracts where test:Id like 'B11111%'
> it returns 1000 results in about 0.3s
>
> but if i execute the query
> select * from test:Contracts where test:Id like 'B11111%' order by test:Id
> it returns the same 1000 results but takes 3.5s to calculate.
> does the order clause affect the hole repository ?? it must'nt take 3.5 to
> sort only 1000 results.

how long does the second time take, for example when you search on
'B22222%' order by test:Id. The first time, Lucene has to read all
terms for test:Id into memory, which can take some time (also
depending on your FS and whether FS caches are warm). Anyways, if all
your 1.000.000 nodes contain a title, all have to be read into memory
for sorting. After the first time, this is cached and it should be
fast.

Regards Ard

>
> the same problem with sql and jcr-sql2
>
> any tip ?
> is this a bug in lucene search?
>
> --
> Jose Hernandez
> 675599600
> Isthari
> http://www.isthari.com
>

Reply via email to