Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: add virtual table pushdown infrastructure, and add to several spots #47316

Merged
merged 3 commits into from
Apr 25, 2020

Commits on Apr 25, 2020

  1. Configuration menu
    Copy the full SHA
    1ee9987 View commit details
    Browse the repository at this point in the history
  2. sql: add virtual table pushdown; some examples

    This commit adds virtual table "indexes", a concept that allows virtual
    tables to specify columns that can be accelerated given an equality
    constraint using custom code.
    
    For example, the information_schema.tables table contains one entry per
    table in the database. Before this commit, retrieving the row for a
    table 'foo' would require fetching the descriptors for all tables and
    filtering for the one that had name 'foo'. Now, if there's a constraint
    on the table name, an "index" is used that converts the name into a
    descriptor with a single lookup.
    
    This commit also adds virtual indexes to a few commonly-used virtual
    tables. There is much, much more that could be done - the ones that are
    added here are just examples.
    
    Release note (performance improvement): filtered scans over virtual
    tables have improved performance in common cases.
    jordanlewis committed Apr 25, 2020
    Configuration menu
    Copy the full SHA
    2f7bc1c View commit details
    Browse the repository at this point in the history
  3. sql: SHOW CREATE takes advantage of virtual index

    This commit updates the implementation of SHOW CREATE so that it doesn't
    have to filter every single table in the database. It does 2 things:
    
    1. Stop outputting zone configs in crdb_internal.create_statements
    2. Start outputting partitioning status in the above instead
    3. Get zone configs from the SQL query in SHOW CREATE with a subquery
       from the zone configs table and join together in SQL
    
    This strategy makes it possible to give
    crdb_internal.create_statements a virtual index.
    
    Now SHOW CREATE is really fast!
    
    Release note (performance improvement): SHOW CREATE is much more
    efficient
    jordanlewis committed Apr 25, 2020
    Configuration menu
    Copy the full SHA
    c44619c View commit details
    Browse the repository at this point in the history