Patent attributes
Database schemas, systems, and methods are described herein which enhance database operations when responding to streaming (subscribed) queries regarding records stored in the database. A database schema may include a data table storing a plurality of records each having a plurality of data fields. The schema may also include a query table, and a query index table or tree, or other data structure. The data table stores the current state of each record as defined by its associated data fields. The query table stores all queries mapped to the one or more clients that have subscribed to each query. The query index table, tree, or other data structure indexes the subscribed queries based on a data field common to or associated with the indexed queries. Subsequently, when records and data fields are updated (mutated) in the database, the query index data structure can be used to quickly assess which subscribed clients need to be sent updates with mutated data, so that only the clients who have subscribed to receive updates based on a particular data field do so and the cost of identifying those clients is greatly reduced.