Skip to content

Add new indices for expensive Biomes queries #9

Description

@alvrs

Index to allow querying the Biomes ObjectType table (and any other query that checks based on the uint8 static data)

ObjectType: {
  schema: { entityId: "bytes32", objectTypeId: "uint8" },
  key: ["entityId"],
},
psql -d dozer -c "CREATE INDEX records_first_byte ON records(address, table_id, b2n(sdec(static_data, 0, 1))) INCLUDE (key) WHERE NOT expired AND NOT deleted;"

→ Size of this index is about 7.5GB

Index to allow querying ranges from the Biomes Position table (and any other query that checks based on three int32 values)

Position: {
  schema: { entityId: "bytes32", x: "int16", y: "int16", z: "int16" },
  key: ["entityId"],
},
psql -d dozer -c "CREATE INDEX records_static_int16_xyz ON records(address, table_id, b2sn(sdec(static_data, 0, 2)), b2sn(sdec(static_data, 2, 2)), b2sn(sdec(static_data, 4, 2))) INCLUDE (key) WHERE NOT expired AND NOT deleted;"

→ Size of this index is about 7.8GB with 8.5 million relevant records

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions