jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JOSE FELIX HERNANDEZ BARRIO <jose.hernan...@isthari.com>
Subject Re: query performance
Date Wed, 23 Jun 2010 09:43:10 GMT
>
> > 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.

you're ok the second time it's really fast (0.06s)


> 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.
>

but my question is, only 1000 records matches the where (test:Id like
'B11111%') why is necessary to read every record and not only the 1000 of
the resultset which are the ones to be sorted ??
it takes the same time to read and sort 1000 record than sort the hole
repository and takes the 100 first results !!


>
> 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
> >
>



-- 
Jose Hernandez
675599600
Isthari
http://www.isthari.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message