The invention discloses a method and a
system for realizing a two-dimensional set
data type based on a
database extension head structure. The method comprises the following steps: constructing a recursively nested EAH hierarchical varlena storage architecture, storing a nested set EAH head in a dvalue data area of a root EAH, and storing specific data elements in a
tail layer EAH; the nested EAH
zero copy assignment is realized through the eohcontext memory
context transfer; and finishing persistence and access by adopting a top-down
serialization / deserialization mechanism. According to the method, the two-dimensional set type is originally supported on the
kernel level, and compared with a traditional one-dimensional array, the assignment efficiency and the storage performance of a multi-dimensional
data structure are remarkably improved, the query implementation complexity of a complex
data model is reduced, and the direct expression ability of a
database to two-dimensional and higher-dimensional data is enhanced.