[英]what is equivalent of Postgresql to dbms_stats.gather_table_stats in Oracle?
I have some question about Postgres, I have used dbms_stats.gather_table_stats for performance optimization in Oracle. 我对Postgres有一些疑问,我已经使用dbms_stats.gather_table_stats在Oracle中进行性能优化。 I would like to switch our database from Oracle to Postgres, therefore, I want to achieve same feature on Postgres also.
我想将我们的数据库从Oracle切换到Postgres,因此,我也想在Postgres上实现相同的功能。 I searched internet whether there is some equivalent feature existing in Postgres with dbms_stats.gather_table_stats in Oracle.
我在Internet上搜索了Postgres中是否存在与Oracle中的dbms_stats.gather_table_stats等效的功能。 The only I found was EXPLAIN, VACUUM something like that.
我发现的唯一是EXPLAIN,VACUUM之类的东西。 I think these are already existing in Oracle with same name.
我认为这些名称已经存在于Oracle中。 but I can't find proper ones for dbms_stats.gather_table_stats.
但是我找不到适合dbms_stats.gather_table_stats的数据库。 I am spedning a lot time on it, if you guys have some advice, could I get some?
我为此花了很多时间,如果你们有一些建议,我能得到一些建议吗?
The GATHER_TABLE_STATS
procedure of DBMS_STATS
package collects statistics of the specified table in Oracle. DBMS_STATS
程序包的GATHER_TABLE_STATS
过程收集Oracle中指定表的统计信息。
In Postgres, we use ANALYZE for the same purpose. 在Postgres中,出于相同目的,我们使用ANALYZE。
ANALYZE collects statistics about the contents of tables in the database, and stores the results in the pg_statistic system catalog.
ANALYZE收集有关数据库中表内容的统计信息,并将结果存储在pg_statistic系统目录中。 Subsequently, the query planner uses these statistics to help determine the most efficient execution plans for queries.
随后,查询计划者使用这些统计信息来帮助确定最有效的查询执行计划。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.