GithubHelp home page GithubHelp logo

indexes about sirdb HOT 3 CLOSED

o0101 avatar o0101 commented on May 11, 2024
indexes

from sirdb.

Comments (3)

o0101 avatar o0101 commented on May 11, 2024

probably at sd level, since type validation of inputs happens here.

eventually me might be able to shift more and more DB related stuff to stubdb...but for now it's wrapped up here.

from sirdb.

o0101 avatar o0101 commented on May 11, 2024

for now it's wrapped up here.

which is fine

from sirdb.

o0101 avatar o0101 commented on May 11, 2024

Stubdb can do indexes.

So when we create a table we can specify an index:[] option, that lists properties that are to be indexed.

Then everytime we get a write action (newItem/setItem) what happens is this, the index directory is found

/<table_name>/_indexes/<property_name>

and the value of the property to be indexes is hashed, to give <value_hash> and the file:

/<table_name>/_indexes/<property_name>/<value_hash>.json

is found or created. And the record id is added to the index record for that value. If there's a collision, the record also adds the collided value.

An index record looks like this:

{
   [base64value]: [<record_ids>],
   [base64value]: [<record_ids>],
}

so any collisions are handled like that.

Then in order to retrieve results for an index, we simply hash the value and get the index record, and we have the results right there.

from sirdb.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.