Table statistics are essential for optimal query plans - Deepstash
Table statistics are essential for optimal query plans

Table statistics are essential for optimal query plans

The query planner looks at available indexes, cost settings, strategy settings, and distribution of data, in order to plan the most efficient way to execute a query.

Stats about the distribution of data are stored in the pg_statistic table and presented in a more readable form in the pg_stats view. They are generated based on ~20% of the table data (less for large tables) and are constantly updated by the autovacuum daemon. You can also manually update them using ANALYZE or VACUUM ANALYZE, the later which is strongly recommended after inserting or deleting a large number of rows.

9

20 reads

CURATED FROM

IDEAS CURATED BY

ocpodariu

Alt account of @ocp. I use it to stash ideas about software engineering

Read & Learn

20x Faster

without
deepstash

with
deepstash

with

deepstash

Personalized microlearning

100+ Learning Journeys

Access to 200,000+ ideas

Access to the mobile app

Unlimited idea saving

Unlimited history

Unlimited listening to ideas

Downloading & offline access

Supercharge your mind with one idea per day

Enter your email and spend 1 minute every day to learn something new.

Email

I agree to receive email updates