Discussion:
Lucene query with sorting. Performance problem
Etienne Crinier
2014-09-26 09:30:33 UTC
Permalink
Hi,

I have a 'fulltext lucene' index to do a quick search on multiple fields.
It is working properly.
Now i would like to sort these results through a numeric field. Therefore,
I created a 'notunique' index to this field.
You can find below my request :
*select from Tracks [Title, ArtistName, AlbumName] LUCENE 'daft+punk' order
by relevance desc*

Without the "order by" method performance is good: explainwithoutorderby.jpg

Now with "order by": explainwithoutorderby.jpg


You can see the order by index unused. Performance decreases dramatically.

Do you have any idea on how to solve this issue?
--
---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-database+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
Enrico Risa
2014-09-26 09:48:54 UTC
Permalink
Hi Etienne

can you try to remove the not unique index
and paste here the explain of

*select from Tracks [Title, ArtistName, AlbumName] LUCENE 'daft+punk' order
by relevance desc*


Thanks

Enrico
Post by Etienne Crinier
Hi,
I have a 'fulltext lucene' index to do a quick search on multiple fields.
It is working properly.
Now i would like to sort these results through a numeric field. Therefore,
I created a 'notunique' index to this field.
*select from Tracks [Title, ArtistName, AlbumName] LUCENE 'daft+punk'
order by relevance desc*
explainwithoutorderby.jpg
Now with "order by": explainwithoutorderby.jpg
You can see the order by index unused. Performance decreases dramatically.
Do you have any idea on how to solve this issue?
--
---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-database+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
Etienne Crinier
2014-09-26 12:29:00 UTC
Permalink
Hi,

Thank you for your answer. In attachment, the result of explain without
index

Thanks
Post by Enrico Risa
Hi Etienne
can you try to remove the not unique index
and paste here the explain of
*select from Tracks [Title, ArtistName, AlbumName] LUCENE 'daft+punk'
order by relevance desc*
Thanks
Enrico
Post by Etienne Crinier
Hi,
I have a 'fulltext lucene' index to do a quick search on multiple fields.
It is working properly.
Now i would like to sort these results through a numeric field.
Therefore, I created a 'notunique' index to this field.
*select from Tracks [Title, ArtistName, AlbumName] LUCENE 'daft+punk'
order by relevance desc*
explainwithoutorderby.jpg
Now with "order by": explainwithoutorderby.jpg
You can see the order by index unused. Performance decreases dramatically.
Do you have any idea on how to solve this issue?
--
---
You received this message because you are subscribed to the Google Groups
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-database+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
Mohammad Hossein Ganjyar
2018-03-31 21:45:35 UTC
Permalink
I have this problem with orientdb v2.2.31. I have vertex Users with
properties id (no index), name (lucene index), family(lucene index).
My quesry is :
SELECT @rid, name , family FROM profiles
order by name asc
limit 10
This query is very slow (exc in ~17 seconds).
Do you best idea?
thanks
Post by Enrico Risa
Hi Etienne
can you try to remove the not unique index
and paste here the explain of
*select from Tracks [Title, ArtistName, AlbumName] LUCENE 'daft+punk'
order by relevance desc*
Thanks
Enrico
Post by Etienne Crinier
Hi,
I have a 'fulltext lucene' index to do a quick search on multiple fields.
It is working properly.
Now i would like to sort these results through a numeric field.
Therefore, I created a 'notunique' index to this field.
*select from Tracks [Title, ArtistName, AlbumName] LUCENE 'daft+punk'
order by relevance desc*
explainwithoutorderby.jpg
Now with "order by": explainwithoutorderby.jpg
You can see the order by index unused. Performance decreases dramatically.
Do you have any idea on how to solve this issue?
--
---
You received this message because you are subscribed to the Google Groups
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-database+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Luigi Dell'Aquila
2018-04-06 15:47:26 UTC
Permalink
Hi Mohammad,

Lucene indexes do not provide ordering (or better, they return results
based on their score, but it's not what you need).
What you can do here is define an additional NOTUNIQUE index on "name",
this will do the job

Thanks

Luigi

2018-03-31 23:45 GMT+02:00 Mohammad Hossein Ganjyar <
Post by Mohammad Hossein Ganjyar
I have this problem with orientdb v2.2.31. I have vertex Users with
properties id (no index), name (lucene index), family(lucene index).
order by name asc
limit 10
This query is very slow (exc in ~17 seconds).
Do you best idea?
thanks
Post by Enrico Risa
Hi Etienne
can you try to remove the not unique index
and paste here the explain of
*select from Tracks [Title, ArtistName, AlbumName] LUCENE 'daft+punk'
order by relevance desc*
Thanks
Enrico
Post by Etienne Crinier
Hi,
I have a 'fulltext lucene' index to do a quick search on multiple
fields. It is working properly.
Now i would like to sort these results through a numeric field.
Therefore, I created a 'notunique' index to this field.
*select from Tracks [Title, ArtistName, AlbumName] LUCENE 'daft+punk'
order by relevance desc*
explainwithoutorderby.jpg
Now with "order by": explainwithoutorderby.jpg
You can see the order by index unused. Performance decreases
dramatically.
Do you have any idea on how to solve this issue?
--
---
You received this message because you are subscribed to the Google
Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-database+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Etienne Crinier
2014-09-29 11:46:36 UTC
Permalink
Hi,

I upgraded my orientdb version to 2.0-M1 and lucene plugin and that's
working fine and fast.
Thanks
Post by Etienne Crinier
Hi,
I have a 'fulltext lucene' index to do a quick search on multiple fields.
It is working properly.
Now i would like to sort these results through a numeric field. Therefore,
I created a 'notunique' index to this field.
*select from Tracks [Title, ArtistName, AlbumName] LUCENE 'daft+punk'
order by relevance desc*
explainwithoutorderby.jpg
Now with "order by": explainwithoutorderby.jpg
You can see the order by index unused. Performance decreases dramatically.
Do you have any idea on how to solve this issue?
--
---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-database+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
'Curtis Mosters' via OrientDB
2014-09-29 15:05:37 UTC
Permalink
@Etienne: what happens if you search for "?

Does it brake your system too? Or is it fine for you?
Post by Etienne Crinier
Hi,
I upgraded my orientdb version to 2.0-M1 and lucene plugin and that's
working fine and fast.
Thanks
Post by Etienne Crinier
Hi,
I have a 'fulltext lucene' index to do a quick search on multiple fields.
It is working properly.
Now i would like to sort these results through a numeric field.
Therefore, I created a 'notunique' index to this field.
*select from Tracks [Title, ArtistName, AlbumName] LUCENE 'daft+punk'
order by relevance desc*
explainwithoutorderby.jpg
Now with "order by": explainwithoutorderby.jpg
You can see the order by index unused. Performance decreases dramatically.
Do you have any idea on how to solve this issue?
--
---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-database+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
Loading...