Maybe catch it in a feature request on github!
The correct way to do this is to support use cases explicitly, i.e. you
should be able to set a name on a transaction, and that name will be
used to determine things like this, since "most used properties" is
entirely dependent on use case.
I've have implemented this scheme in a previous product I worked on, and
it really really helps performance.
/Rickard
--
Rickard �berg
Developer
Neo Technology
Twitter: @rickardoberg, Skype: rickardoberg
On 4/19/12 17:07 , Peter Neubauer wrote:
Maybe catch it in a feature request on github!
On Apr 19, 2012 11:04 AM, "Mattias Persson" <mat...@neotechnology.com
<mailto:mattias@neotechnology.com>> wrote:
That will load all the properties from the store, if they aren't
already cached... and that's the problem you'd like to avoid, right?
No you cannot do that, but it would be cool to have a small number
of properties loaded together with each node which you configure (or
are discovered) to be the most used properties and only they will be
loaded first. If you requested another property than those then all
the others would be loaded.
The correct way to do this is to support use cases explicitly, i.e. you
should be able to set a name on a transaction, and that name will be
used to determine things like this, since "most used properties" is
entirely dependent on use case.
I've have implemented this scheme in a previous product I worked on, and
it really really helps performance.
/Rickard
--
Rickard Öberg
Developer
Neo Technology
Twitter: @rickardoberg, Skype: rickardoberg
If you can persist "most used property" in the store, that is great, iff
it is associated with a particular use case, rather than a general
statement. Per use case it is reasonably easy to define exactly what
properties are used, and that then becomes the perfect eager loading scheme.
On 4/19/12 17:52 , Mattias Persson wrote:If you can persist "most used property" in the store, that is great, iff it is associated with a particular use case, rather than a general statement. Per use case it is reasonably easy to define exactly what properties are used, and that then becomes the perfect eager loading scheme.
The correct way to do this is to support use cases explicitly, i.e. you
should be able to set a name on a transaction, and that name will be
used to determine things like this, since "most used properties" is
entirely dependent on use case.
I've have implemented this scheme in a previous product I worked on, and
it really really helps performance.
The mismatch between use cases and my idea is that the "most used
property" would be persisted as such in the store, which is what would
have made it fast.
/Rickard
--
Rickard Öberg
Developer
Neo Technology
Twitter: @rickardoberg, Skype: rickardoberg
Just to make sure we mean the same thing, here's an example:
A node has two properties foo and bar. Use case A uses foo only, and use
case B uses bar only. If I do a transaction for A, then I want foo to be
eagerloaded, and if I do case B I want bar to be eagerloaded. I.e. all
properties on the node are "fast" properties, depending on use case. So,
considering this, what would you gain with "separate store"?
/Rickard
--
Rickard Öberg
Developer
Neo Technology
Twitter: @rickardoberg, Skype: rickardoberg
This is good.
> or
> as my initial though, to select a small number of properties to live
> closer to the entity records on disk.
This is bad, because it assumes that there are properties that are "more
important". See previous email on use cases.
If it is possible to load the raw state from disk in full, but only
dehydrate into Java objects on access, that could help. To achieve this
it might be a good idea to have a 2-level cache, where the first level
mirrors what is on disk, in raw format, and the second is what is
associated with a particular transaction, which is Java objects.
> I don't think we're exactly
> talking about the same thing here :)
Nope, hence the clarification.
On 4/20/12 21:31 , Mattias Persson wrote:This is good.
As I see it it's not about eager loading, it's about the store format
which makes it necessary to load all properties for an entity if any is
requested. One solution to that is to fix the store format so that it
can load one at a time (with an tiny index of some sort per entity),
This is bad, because it assumes that there are properties that are "more important". See previous email on use cases.
or
as my initial though, to select a small number of properties to live
closer to the entity records on disk.
If it is possible to load the raw state from disk in full, but only dehydrate into Java objects on access, that could help. To achieve this it might be a good idea to have a 2-level cache, where the first level mirrors what is on disk, in raw format, and the second is what is associated with a particular transaction, which is Java objects.
Nope, hence the clarification.
I don't think we're exactly
talking about the same thing here :)
/Rickard
--
Rickard Öberg
Developer
Neo Technology
Twitter: @rickardoberg, Skype: rickardoberg
That's not entirely true, since the high level cache is not associated
with a *particular tx*, which is what I suggested. The way it is handled
today there is a common cache of hydrated objects, and then a list per
tx of changes for particular nodes. That's different.
On 4/24/12 20:58 , Mattias Persson wrote:That's not entirely true, since the high level cache is not associated with a *particular tx*, which is what I suggested. The way it is handled today there is a common cache of hydrated objects, and then a list per tx of changes for particular nodes. That's different.
If it is possible to load the raw state from disk in full, but only
dehydrate into Java objects on access, that could help. To achieve
this it might be a good idea to have a 2-level cache, where the
first level mirrors what is on disk, in raw format, and the second
is what is associated with a particular transaction, which is Java
objects.
That is what Neo4j has today. The low level cache is memory mapping of
the raw store format, the high level cache is the Java objects.
/Rickard
--
Rickard Öberg
Developer
Neo Technology
Twitter: @rickardoberg, Skype: rickardoberg