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
user-query-optimizer-0.1.6.tar.gz 12.8 kB Details

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

Release history Release notifications | RSS feed

This release

0.1.6 This release

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

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