You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@age.apache.org by "CapnSpek (via GitHub)" <gi...@apache.org> on 2023/07/12 06:45:41 UTC

[GitHub] [age] CapnSpek commented on issue #995: Research functions that extracts label ID

CapnSpek commented on issue #995:
URL: https://github.com/apache/age/issues/995#issuecomment-1631941896

   As of currently, the ids carry 2 types of information.
   1.) The label
   2.) The sequence
   
   I believe irrespective of the type of query, `_extract_label_id` is used whenever a vertex is returned.
   
   I can prove this in the form of an example.
   
   Let's start by creating 2 vertices in the graph with 2 different labels.
   
   So the contents of _ag_label_vertex are
   ![image](https://github.com/apache/age/assets/109627745/07fd2f29-3b0a-4e5b-8716-0787b60a809c)
   
   Next, I'll update the label id of John from "1125899906842625" to "844424930131970".
   So the new contents are: -
   ![image](https://github.com/apache/age/assets/109627745/d0c6be5f-dfe4-4377-a80b-ff4c2b0f4f26)
   
   The contents of person_1 and person_2 respectively are: -
   
   ![image](https://github.com/apache/age/assets/109627745/bf85002f-0efe-4c27-8fa1-ff8457089567)
   
   
   Now, if we perform some simple `MATCH` queries
   Such as
   MATCH (n) RETURN n;
   MATCH (n:person_1) RETURN n;
   MATCH (n:person_2) RETURN n;
   
   You'll see even if we filter by person_2, the label actually is person_1
   
   ![image](https://github.com/apache/age/assets/109627745/964532c0-efef-4b2e-a8f5-b4f21413b612)
   
   Which implies, even in queries where I am filtering by specifying the label "person_2", the search is made on the person_2 table, but the label is decided by extracting the `label_id` through the id only.
   
   It is done by bitshifting the id towards right by (32+16) numbers (macro ENTRY_ID_BITS)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org