PostgreSQL `analyse` 与 `analyze`

PostgreSQL `analyse` vs `analyze`

explain analyse select true;
╔════════════════════════════════════════════════════════════════════════════════════╗
║                                     QUERY PLAN                                     ║
╠════════════════════════════════════════════════════════════════════════════════════╣
║ Result  (cost=0.00..0.01 rows=1 width=0) (actual time=0.016..0.016 rows=1 loops=1) ║
║ Planning time: 0.073 ms                                                            ║
║ Execution time: 0.109 ms                                                           ║
╚════════════════════════════════════════════════════════════════════════════════════╝

explain analyze select true;
╔════════════════════════════════════════════════════════════════════════════════════╗
║                                     QUERY PLAN                                     ║
╠════════════════════════════════════════════════════════════════════════════════════╣
║ Result  (cost=0.00..0.01 rows=1 width=0) (actual time=0.004..0.005 rows=1 loops=1) ║
║ Planning time: 0.030 ms                                                            ║
║ Execution time: 0.036 ms                                                           ║
╚════════════════════════════════════════════════════════════════════════════════════╝

它是功能还是记录的功能(analyse = analyze)?

如前所述,它仅支持英式和美式英语。功能上没有区别。甚至 source code 也提到了英式拼写。

时间上也没有区别。如果你 运行 那一百万次,你将看不出任何合理的时间差异。 运行 它们一次可能会显示出一些差异,但实际上一个并不比另一个快。

您也可以查看parser source code。两者都被解析为完全相同的:

analyze_keyword:
        ANALYZE                                 {}
        | ANALYSE /* British */                 {}