Slow significantly when changing the limit return records from 1000 to 2000


#1

Why is the query very slow (more than 33 seconds) when limiting the return result within 2000 records, while very quick (winthin 1 second) when limiting the return result within 1000 records)?


#2

Hi @Tracy

I’d say it depends on the underlying record set, eg. if the first 1000 records match the condition, the next 100.000 don’t, and then next 1000 do, the query executor will have to scan only 1000 records in the first case and 102,000 for the second one.

If you have a chance to post a sample query and dataset probably I can give you some advice to make it more efficient

Thanks

Luigi


#3

About this problem, I wany to add that when using oracle to do this, it stably remains 13 seconds… So I think 33 seconds shouldn’t be the performance of orientdb…
My partner has posted the the sample query and dataset on github seven days ago, but hasn’t got any reply yet… I sincerely hope to get your reply on github soon.


#4

Hi @Tracy

I just answered on GitHub https://github.com/orientechnologies/orientdb/issues/8703
With next release it should be much faster

Thanks

Luigi