A method of sorting and indexing a database comprising a plurality of records (T1-T16) and a plurality of data items (P1-P5), in which each record (T1-T16) comprises an identifier, a first data variable as a path (P2, P3, P5) pointing to a data item (G, B, Y) being the value of said first data variable, and a second data variable as a path (P1, P2, P3) pointing to a data item (R, G, B) being the value of said second data variable; characterised in that the database further comprises a first frequency for each first data variable path type (P2, P3, P5), and a second frequency for each second data variable path type (P1, P2, P3), comprising the following steps: - creating an intermediate array comprising a section (IS1-IS3) for each second data variable path type (P1, P2, P3), which sections (IS1-IS3) comprise identifier storage locations (L1-L9, L10-L12, L13-L16) equal in number to the corresponding second frequency; - storing the identifier of each record (T1-T16) into the section (IS1-IS3) of the intermediate array corresponding to its second data variable path type (P1, P2, P3); - creating a final array comprising sections (FS1-FS3) for each first data variable path type (P2, P3, P5), which sections (FS1-FS3) comprise identifier storage locations (M1-M7, M8-M10, M12-M16) equal in number to the corresponding first frequency; - creating an offset array consisting of storage locations for each first data variable path type (P2, P3, P5), which storage locations are populated with offset values (M1, M8, M11) which point to the first available identifier storage location (M1-M16) in each section (FS1-FS3) of the final array, - repeating for each section (IS1-IS3) of the intermediate array, the steps of: - storing the identifier of each record (T1, T3, T4, T5, T7, T13, T14, T15, T16) appearing in the section of the intermediate array in question (IS1-IS3) into the section (FS1-FS3) of the final array corresponding to its first data variable path type (P2, P3, P5), wherein the offset value (M1, M8, M11) which points to the first available identifier storage location (M1-M16) of a section (FS1-FS3) of the final array is incremented each time the identifier for a record (T1, T3, T4, T5, T7, T13, T14, T15, T16) is stored into that section (FS1-FS3) of the final array; and - identifying offset points (M4, M10, M15) in the final array corresponding to the resulting offset value (M4, M10, M15) of each section (FS1-FS3) of the final array; and, when all sections (IS1-IS3) of the intermediate array have been processed: - creating an offset point index consisting of the offset points (M4, M6, M8, M10, M11, M15, M16) identified in each repetition. - creating an intermediate array comprising a section (IS1-IS3) for each second data variable path type (P1, P2, P3), which sections (IS1-IS3) comprise identifier storage locations (L1-L9, L10-L12, L13-L16) equal in number to the corresponding second frequency; - storing the identifier of each record (T1-T16) into the section (IS1-IS3) of the intermediate array corresponding to its second data variable path type (P1, P2, P3); - creating a final array comprising sections (FS1-FS3) for each first data variable path type (P2, P3, P5), which sections (FS1-FS3) comprise identifier storage locations (M1-M7, M8-M10, M12-M16) equal in number to the corresponding first frequency; - creating an offset array consisting of storage locations for each first data variable path type (P2, P3, P5), which storage locations are populated with offset values (M1, M8, M11) which point to the first available identifier storage location (M1-M16) in each section (FS1-FS3) of the final array, - repeating for each section (IS1-IS3) of the intermediate array, the steps of: - storing the identifier of each record (T1, T3, T4, T5, T7, T13, T14, T15, T16) appearing in the section of the intermediate array in question (IS1-IS3) into the section (FS1-FS3) of the final array corresponding to its first data variable path type (P2, P3, P5), wherein the offset value (M1, M8, M11) which points to the first available identifier storage location (M1-M16) of a section (FS1-FS3) of the final array is incremented each time the identifier for a record (T1, T3, T4, T5, T7, T13, T14, T15, T16) is stored into that section (FS1-FS3) of the final array; and - identifying offset points (M4, M10, M15) in the final array corresponding to the resulting offset value (M4, M10, M15) of each section (FS1-FS3) of the final array; and, when all sections (IS1-IS3) of the intermediate array have been processed: - creating an offset point index consisting of the offset points (M4, M6, M8, M10, M11, M15, M16) identified in each repetition. - storing the identifier of each record (T1, T3, T4, T5, T7, T13, T14, T15, T16) appearing in the section of the intermediate array in question (IS1-IS3) into the section (FS1-FS3) of the final array corresponding to its first data variable path type (P2, P3, P5), wherein the offset value (M1, M8, M11) which points to the first available identifier storage location (M1-M16) of a section (FS1-FS3) of the final array is incremented each time the identifier for a record (T1, T3, T4, T5, T7, T13, T14, T15, T16) is stored into that section (FS1-FS3) of the final array; and - identifying offset points (M4, M10, M15) in the final array corresponding to the resulting offset value (M4, M10, M15) of each section (FS1-FS3) of the final array; - creating an offset point index consisting of the offset points (M4, M6, M8, M10, M11, M15, M16) identified in each repetition.