Updated on 2025-05-29 GMT+08:00

GS_SPM_PLAN_HISTORY_DETAIL

GS_SPM_PLAN_HISTORY_DETAIL is used to view change history information in the database. The user with the SYSADMIN permission and the initial user can access this view.

Table 1 GS_SPM_PLAN_HISTORY_DETAIL columns

Name

Type

Description

sql_hash

bigint

Unique ID of the SQL statement in the SPM.

plan_hash

bigint

Unique ID of a plan in the current SQL statement.

plan_hash_previous

bigint

Unique ID of the previous plan. If there is no previous plan, the value is 0.

unique_sql_id

bigint

Unique ID of an SQL statement in the database.

outline

text

Outline text, which can be used to fix a group of hints of the current plan.

status

text

Plan status. The options are as follows:

  • UNACC: The plan is not accepted.
  • ACC: The plan has been accepted.
  • FIXED: indicates a special ACC plan. The matching priority of this plan is higher than that of other ACC plans.

gplan

boolean

Specifies whether the plan corresponding to the current outline is a gplan.

cost

double precision

Total plan cost.

sql_text

text

SQL text string.

param_num

integer

Number of SQL parameters.

source

text

Baseline source.

userid

oid

OID of a user.

baseline_creation_time

timestamp with time zone

Time when the baseline is created.

history_creation_time

timestamp with time zone

Time when the change history is created.

modification_time

timestamp with time zone

Time when the baseline is modified.