Skip to main content

Postgresql Set Statistics

Project description

query-plan-optimizer

Postgresql Statistics are vital for a good query plan. This library finds tables with large number of live tuples and tries to find related models with foreign key to the model and sets statistics for the field on destination model.

Installation

$ pip install psql-stat-optimizer

add psql_optimizer to your INSTALLED_APPS

usage:

Using full optimize command:

$ ./manage.py optimize_statistics

Valid Parameters:

  • set_all: if passed as True it sets for all founded models automatically
  • analyze_all: if passed as True it analyzes all models after their statistics is changed
  • live_tup_count: the minimum number of n_live_tup to consider as a big table. default is 100000
  • statistics: the statistics value you want to set to. default is 10000

Using statistics command:

$ ./manage.py set_statistics

Parameters:

  • model: the target model name
  • column: the target column
  • statistics: the target statistics

TODO:

  • remove time.sleep which is used for printing
  • add command for analyze a table manually

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

psql_stat_optimizer-0.0.44-py3-none-any.whl (7.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page