The following query returns a set of `@rid` and completes in about `0.012sec`
SELECT in FROM SomeEdge WHERE out IN #27:819Now if I were to select from another Vertex using those `@rid`s in there literal form, this would take a very long time and I get a timeout (above 4seconds). I'm presuming its scanning over all the entries
SELECT FROM SomeVertex WHERE @rid in [#23:83354, #23:366, #23:99933, #23:80708, #23:70291]Interestingly enough if I were to use a single `@rid` rather than a set it would be fast. So I'm assuming the query optimizer has the scope to go a little further and also optimize multiple results
SELECT FROM SomeVertex WHERE @rid in [#23:83354]But not to worry because I can make this faster by adding an index to `SomeVertex.@rid` so now this is fast again
CREATE INDEX foo on SomeVertex (@rid) unique
SELECT FROM SomeVertex WHERE @rid in [#23:83354,#23:366,#23:99933,#23:80708,#23:70291]But if I compose the 2 queries, I'd expect this to be fast, but it's still slow and causes timeout (above 4 seconds)
SELECT FROM SomeVertex WHERE @rid in (SELECT in FROM SomeEdge WHERE out IN #27:819)I'm assuming I could write this in another way, but I'm more interested in why this is slow. Is this a bug or if not are there any details on how/why this is slow?
--
---
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-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Luca,
So I had problems with this approach if I needed to select on a larger collection rather that a single rid. So something along the lines of
select from (select expand(in()) from User where status = 'active') where foo = "bar" LIMIT 10
I ran into problems I'm assuming I'm not quite think in the correct way. Also I know I could put a limit on in inner query also but that would mean that I could potentially end up with less than the required number of results.
Hope that makes sense
Thanks for the help,
Jamie
You received this message because you are subscribed to a topic in the Google Groups "OrientDB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orient-database/-U6IZNLAtSQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orient-databa...@googlegroups.com.
select from (select expand(in()) from User where status = 'active') where foo = "bar" LIMIT 10
Luca,
So I'll try and give you a full test case early next week. But basically what I'm having trouble with is that its fine to put a index on the sub query and that will make that part faster. But if the sub query were to return 3000 rows the outer part of the query (where foo = "bar") will never use the index on 'foo', and becomes very slow +1second.
I'll give you a full test case next week, however given an index on 'foo' and 'status' should that query be fast? Or am I misunderstanding something?
Thanks,
Jamie