×

Systems and methods for implementing and maintaining sampled tables in a database system

  • US 9,953,054 B2
  • Filed: 04/21/2014
  • Issued: 04/24/2018
  • Est. Priority Date: 04/22/2013
  • Status: Active Grant
First Claim
Patent Images

1. A system to execute within a host organization, wherein the system comprises:

  • a processor and a memory to execute instructions at the system;

    a query optimizer to optimize database queries;

    a database system having a plurality of database tables, each of the plurality of database tables to store database records, wherein each of the plurality of database tables embodies a trigger component, stored within the respective database table;

    wherein the trigger component embodied within each respective database table is to initiate a hash function of the primary key for the respective database table upon a database insert transaction of a new database record being inserted into the respective database table;

    a sample table within the query optimizer and maintained by the query optimizer separate from the plurality of database tables of the database system, wherein the sample table is to store a sample record corresponding to any database record being inserted into the respective database table of the database system which satisfies the sampling condition based on the hash function pursuant to the trigger component;

    wherein the trigger component of each respective database table continuously maintains sampled records in the sample table upon any insert, change, or deletion to records within the respective database table satisfying the sampling condition based on the hash function;

    wherein the hash function trigger is further configured to initiate the hash function upon any database record delete transaction for the table within which the respective hash function trigger resides and, responsive to a database record delete transaction, the hash function performs a hash of the primary key for a database record being deleted pursuant to the database record delete transaction to determine whether the database record being deleted satisfies the sampling condition indicating a sample record within the sample table must also be deleted or marked for deletion;

    a primary key index providing an index of the primary keys of the sample records stored in the sample table;

    a query interface to receive a query for the database system, wherein the queries to the database system are processed through the query interface and wherein the trigger component to initiate the hash function on database insert transactions resides within the query interface;

    wherein the query optimizer is to optimize the received query by applying a plurality of filters to the sample table and selecting one of the plurality of filters based on which one of the plurality of filters corresponds to a greatest reduction in a number of records returned from the sample table, and wherein the query interface is to pass the trigger component to the query optimizer to perform the hash function for each database record being inserted into the database system to determine whether the database record being inserted satisfies a sampling condition; and

    the query interface to execute the optimized query against the database system, wherein the optimized query applies the selected one of the plurality of filters to the database system in fulfillment of executing the received query.

View all claims
  • 1 Assignment
Timeline View
Assignment View
    ×
    ×