小编Ell*_*nce的帖子

为什么 ORDER BY NULLS LAST 会影响主键上的查询计划?

使用 PostgreSQL 11,我有下表,大约有 4.5 亿行:

postgres=> \d+ sales
                                                             Table "public.sales"
              Column               |            Type             |             Modifiers              | Storage  | Stats target | Description
-----------------------------------+-----------------------------+------------------------------------+----------+--------------+-------------
 created_terminal_id               | integer                     | not null                           | plain    |              |
 company_id                        | integer                     | not null                           | plain    |              |
 customer_id                       | integer                     |                                    | plain    |              |
 sale_no                           | character varying(20)       | not null                           | extended |              |
 sale_type                         | smallint                    | not null                           | plain    |              |
 source_type                       | smallint                    | not null                           | plain …
Run Code Online (Sandbox Code Playgroud)

postgresql index null order-by execution-plan

6
推荐指数
1
解决办法
442
查看次数

标签 统计

execution-plan ×1

index ×1

null ×1

order-by ×1

postgresql ×1