go-bond / bond

Other
10 stars 3 forks source link

Explore other indexing strategies #66

Closed marino39 closed 1 year ago

marino39 commented 1 year ago

Please explore other potential indexing strategies that we could use in order to faster index and query large amounts of data.

Our suggestions are:

poonai commented 1 year ago

Just noting ideas here:

We have a unique index for every record.

eg:

recordId, userID, NFTID 1, 1, 1 2, 2, 1

We would create two indexes for indexing NFT ID for the above example, because we suffix the primary key as part of the index key while indexing. This could be reduced into one index if we store the primary key as a value.

eg:

index for NFTID_1 -> [1,2]. This reduces the number of records being written to DB and the number of records that need to be retrieved while querying.

marino39 commented 1 year ago

I had a similar idea before. Please see attached file.

Note 4 Aug 2022 index.pdf