Giter Club home page Giter Club logo

user-query-optimizer's Introduction

Introduction

This API will help you optimize your sql queries for better performance.

How to use

Create an optimizer object specific to a single (database, schema) pair e.g. optimizer = get_optimizer("presto", schema)

Get optimization hints using optimize_query(query) e.g. presto_op.optimize_query(query)

Initial Optimization Checks

  • Using approximate algorithms (approx_distinct() instead of COUNT(DISTINCT ...))
  • Selecting the columns the user wants explicitly, rather than using (SELECT *)
  • Filtering on partitioned columns
  • Try to extract nested subqueries using a WITH clause.
  • Suggest filtering on most effective columns, by parquet-file ordering
  • Eliminate filtering overhead for partitioned columns

Other Stuff

  • Replace UNION with UNION ALL if duplicates do not need to be removed
  • Aggregate a series of LIKE clauses into one regexp_like expression
  • Push down a complex join condition into a sub query
  • Specify GROUP BY targets with numbers for expressions

Testing

To run unit tests, run py.test (or py.test -s to see stdout) in the tests directory.

user-query-optimizer's People

Contributors

fbertsch avatar swathiiyer2 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

user-query-optimizer's Issues

Wiki changes

FYI: The following changes were made to this repository's wiki:

These were made as the result of a recent automated defacement of publically writeable wikis.

CODE_OF_CONDUCT.md file missing

As of January 1 2019, Mozilla requires that all GitHub projects include this CODE_OF_CONDUCT.md file in the project root. The file has two parts:

  1. Required Text - All text under the headings Community Participation Guidelines and How to Report, are required, and should not be altered.
  2. Optional Text - The Project Specific Etiquette heading provides a space to speak more specifically about ways people can work effectively and inclusively together. Some examples of those can be found on the Firefox Debugger project, and Common Voice. (The optional part is commented out in the raw template file, and will not be visible until you modify and uncomment that part.)

If you have any questions about this file, or Code of Conduct policies and procedures, please see Mozilla-GitHub-Standards or email [email protected].

(Message COC001)

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.