Skip to main content

## 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.

Metadata

Release files for user-query-optimizer 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for user-query-optimizer 0.1.6
File Size Uploaded Provenance Actions
user-query-optimizer-0.1.6.tar.gz 12.8 kB Without provenance Details for user-query-optimizer-0.1.6.tar.gz

Release files / user-query-optimizer-0.1.6.tar.gz

Download URL user-query-optimizer-0.1.6.tar.gz
Size 12.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6fd7f53a9aebaf2004b3955526aa6a39cb07e278e3ba8ba5f45fd06ad984d637
BLAKE2b-256 checksum
How to use checksums
cb0461a5c96599c776b4725af4681583429f1640e0bbb2b000bbb917f6a0083c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/2.7

Security for user-query-optimizer 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page