jrgemignani opened a new pull request, #2302:
URL: https://github.com/apache/age/pull/2302

   NOTE: This PR was created using AI tools and a human.
   
   Leverage deterministic key ordering from uniqueify_agtype_object() to access 
vertex/edge fields in O(1) instead of O(log n) binary search.
   
   Fields are sorted by key length, giving fixed positions:
   - Vertex: id(0), label(1), properties(2)
   - Edge: id(0), label(1), end_id(2), start_id(3), properties(4)
   
   Changes:
   - Add field index constants and accessor macros to agtype.h
   - Update age_id(), age_start_id(), age_end_id(), age_label(), 
age_properties() to use direct field access
   - Add fill_agtype_value_no_copy() for read-only scalar extraction without 
memory allocation
   - Add compare_agtype_scalar_containers() fast path for scalar comparison
   - Update hash_agtype_value(), equals_agtype_scalar_value(), and 
compare_agtype_scalar_values() to use direct field access macros
   - Add fast path in get_one_agtype_from_variadic_args() bypassing 
extract_variadic_args() for single argument case
   - Add comprehensive regression test (30 tests)
   
   Performance impact: Improves ORDER BY, hash joins, aggregations, and Cypher 
functions (id, start_id, end_id, label, properties) on vertices and edges.
   
   All previous regression tests were not impacted.
   Additional regression test added to enhance coverage.
   
   modified:   Makefile
   new file:   regress/expected/direct_field_access.out
   new file:   regress/sql/direct_field_access.sql
   modified:   src/backend/utils/adt/agtype.c
   modified:   src/backend/utils/adt/agtype_util.c
   modified:   src/include/utils/agtype.h


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to