[Neo4j] Node loading question

David Montag david.montag at neotechnology.com
Mon Aug 16 12:08:52 CEST 2010


Rick,

After some further investigation Johan informed me that the property loading
is actually smarter than I first told you. When you first access a node's or
relationship's properties, all properties that fit into 8 bytes will have
their data loaded immediately, i.e. booleans, ints, longs, etc. String and
array data is however only loaded on demand for each property.

Example:

Node with properties:
  int count = 4
  String name = "foo"
  float ratio = 1.2
  int[] history = { 4, 3, 2, 1 }

node.getProperty( "countKey" ); // all properties are loaded, but only data
for count and ratio
node.getProperty( "nameKey" ); // now name has been loaded and cached
node.getProperty( "historyKey" ); // now history has been loaded and cached

Hope this clears it up.

David

On Mon, Aug 16, 2010 at 12:30 AM, David Montag <
david.montag at neotechnology.com> wrote:

> Hi Rick,
>
> I believe that once an operation touches properties for the first time for
> a node or relationship, all properties are loaded from disk. They are then
> cached in memory. What are you storing in the properties? Not sure I
> understand the optimization you're trying to make - maybe you could explain
> it a bit more?
>
> David
>
>
> On Sun, Aug 15, 2010 at 6:29 PM, Rick Bullotta <
> rick.bullotta at burningskysoftware.com> wrote:
>
>> When a node is accessed, are all of its properties loaded or are they
>> "lazily loaded" as needed?
>>
>>
>>
>> I'm trying to decide whether to include a subset (but duplicated)
>> properties
>> on relationships to avoid loading the entire node if that is a concern.
>>
>>
>>
>> Thanks,
>>
>>
>>
>> Rick
>>
>>
>>
>> _______________________________________________
>> Neo4j mailing list
>> User at lists.neo4j.org
>> https://lists.neo4j.org/mailman/listinfo/user
>>
>
>


More information about the User mailing list