You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Aman Tandon <am...@gmail.com> on 2015/03/27 07:56:03 UTC

Database vs Solr : ID based filtering

Hi,

Does an ID based filtering on solr will perform poor than DB?

<field name"id" type"string" indexed="true" stored="true">

   - http://localhost:8983/solr/select?q=*&fq=id:153

   *OR*

   - select * from TABLE where id=153


With Regards
Aman Tandon

Re: Database vs Solr : ID based filtering

Posted by Aman Tandon <am...@gmail.com>.
>
> so you’ll end up forever invalidating your cache.


What if we have 1 million ids assigned to the different user and each user
daily performs the query on solr. Then will it be there forever?

With Regards
Aman Tandon

On Fri, Mar 27, 2015 at 1:50 PM, Upayavira <uv...@odoko.co.uk> wrote:

> The below won’t perform well. You’ve used a filter query, which will be
> cached, so you’ll end up forever invalidating your cache.
>
> Better would be http://localhost:8983/solr/select?q=id:153
>
> Perhaps better still would be http://localhost:8983/solr/get?id=153
>
> The latter is a “real time get” which will return a document that hasn’t
> even been soft-committed yet.
>
> As to which performs better, I’d encourage you to set up a simple
> experiment, and try it out.
>
> Upayavira
>
> On Fri, Mar 27, 2015, at 06:56 AM, Aman Tandon wrote:
> > Hi,
> >
> > Does an ID based filtering on solr will perform poor than DB?
> >
> > <field name"id" type"string" indexed="true" stored="true">
> >
> >    - http://localhost:8983/solr/select?q=*&fq=id:153
> >
> >    *OR*
> >
> >    - select * from TABLE where id=153
> >
> >
> > With Regards
> > Aman Tandon
>

Re: Database vs Solr : ID based filtering

Posted by Upayavira <uv...@odoko.co.uk>.
The below won’t perform well. You’ve used a filter query, which will be
cached, so you’ll end up forever invalidating your cache.

Better would be http://localhost:8983/solr/select?q=id:153

Perhaps better still would be http://localhost:8983/solr/get?id=153

The latter is a “real time get” which will return a document that hasn’t
even been soft-committed yet.

As to which performs better, I’d encourage you to set up a simple
experiment, and try it out.

Upayavira

On Fri, Mar 27, 2015, at 06:56 AM, Aman Tandon wrote:
> Hi,
> 
> Does an ID based filtering on solr will perform poor than DB?
> 
> <field name"id" type"string" indexed="true" stored="true">
> 
>    - http://localhost:8983/solr/select?q=*&fq=id:153
> 
>    *OR*
> 
>    - select * from TABLE where id=153
> 
> 
> With Regards
> Aman Tandon

Re: Database vs Solr : ID based filtering

Posted by Aman Tandon <am...@gmail.com>.
Thanks Mikhail for the explanation.

With Regards
Aman Tandon

On Fri, Mar 27, 2015 at 3:40 PM, Mikhail Khludnev <
mkhludnev@griddynamics.com> wrote:

> for the single where clause RDBMS with index performs comparable same as
> inverted index. Inverted index wins on multiple 'where' clauses, where it
> doesn't need composite indices; multivalue field is also its' intrinsic
> advantage. More details at
> http://www.slideshare.net/lucenerevolution/what-is-inaluceneagrandfinal
>
>
> On Fri, Mar 27, 2015 at 9:56 AM, Aman Tandon <am...@gmail.com>
> wrote:
>
> > Hi,
> >
> > Does an ID based filtering on solr will perform poor than DB?
> >
> > <field name"id" type"string" indexed="true" stored="true">
> >
> >    - http://localhost:8983/solr/select?q=*&fq=id:153
> >
> >    *OR*
> >
> >    - select * from TABLE where id=153
> >
> >
> > With Regards
> > Aman Tandon
> >
>
>
>
> --
> Sincerely yours
> Mikhail Khludnev
> Principal Engineer,
> Grid Dynamics
>
> <http://www.griddynamics.com>
> <mk...@griddynamics.com>
>

Re: Database vs Solr : ID based filtering

Posted by Mikhail Khludnev <mk...@griddynamics.com>.
for the single where clause RDBMS with index performs comparable same as
inverted index. Inverted index wins on multiple 'where' clauses, where it
doesn't need composite indices; multivalue field is also its' intrinsic
advantage. More details at
http://www.slideshare.net/lucenerevolution/what-is-inaluceneagrandfinal


On Fri, Mar 27, 2015 at 9:56 AM, Aman Tandon <am...@gmail.com>
wrote:

> Hi,
>
> Does an ID based filtering on solr will perform poor than DB?
>
> <field name"id" type"string" indexed="true" stored="true">
>
>    - http://localhost:8983/solr/select?q=*&fq=id:153
>
>    *OR*
>
>    - select * from TABLE where id=153
>
>
> With Regards
> Aman Tandon
>



-- 
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics

<http://www.griddynamics.com>
<mk...@griddynamics.com>