What does analyzedb do?
analyzedb makes sure that your database has up-to-date information about your data. It does this by running the ANALYZE command on all tables in a specified part of your database.
Why is it important?
Good statistics are crucial for the database to understand your data. They help the database figure out the best way to execute your queries efficiently.
How to use analyzedb:
You can use analyzedb to analyze a specific part of your database. For example, let's say you have a database named "sales_db" and you want to analyze all the tables in the "public" schema.
Example: analyzedb -d sales_db public
analyzedb -d <dbname>
{ -s <schema> |
{ -t <schema>.<table>
[ -i <col1>[, <col2>, ...] |
-x <col1>[, <col2>, ...] ] } |
{ -f | --file} <config-file> }
[ -l | --list ]
[ --gen_profile_only ]
[ -p <parallel-level> ]
[ --full ]
[ --skip_root_stats ]
[ -v | --verbose ]
[ --debug ]
[ -a ]
analyzedb { --clean_last | --clean_all }
analyzedb --version
analyzedb { -? | -h | --help }