Dseguy
ATApache TinkerPop
•Created by Dseguy on 12/28/2023 in #questions
Splitting a query with range()
I have a Gremlin Query that starts simple (one Label), and then branches out to many different paths to collect unrelated informations (aka, I need to follow those paths). I'm considering using range() to break down that query into smaller chunks of, say 1k rows' and avoid processing the whole set of Labels into one. Of course, I'll have to run the query several times, but I expect each run to be faster, better fit in memory. May be I'll escape some fast degradation by keeping the load small enough.
Does that sound like a good idea?
I'm usually concerned such partitioning means that the common part of the query (before the range()) is executed several times, and that limits the speed potential. In the current case, it is merely a hasLabel() + some property collection.
g.V().hasLabel('xxx'). sideEffect().sideEffect().map()
vs
g.V().hasLabel('xxx'). range(x, x + 1000).sideEffect().sideEffect().map()
9 replies
ATApache TinkerPop
•Created by Dseguy on 9/26/2023 in #questions
within() and case insensitive
I need to check if a property of a node is in a list of values. How can I do that in a case insensitive manner?
has('name',within('vadas','josh')) (+ case_insensitive?)
I can do that naughty step :
filter{ it.get().values('name').toLowerCase() in ['vadas', 'josh']; }
I guess I can also duplicate that 'name' and make another property with the lowercase version of 'name' so within works.
Any other suggestion?
6 replies