ibardarov-fms commented on issue #28458: URL: https://github.com/apache/airflow/issues/28458#issuecomment-1357879311
Here it is
```
airflow_us_east_1=> \d+ task_instance
Table
"public.task_instance"
Column | Type | Collation | Nullable |
Default | Storage | Compression | Stats target | Description
----------------------+-----------------------------+-----------+----------+---------------+----------+-------------+--------------+-------------
task_id | character varying(250) | | not null |
| extended | | |
dag_id | character varying(250) | | not null |
| extended | | |
run_id | character varying(250) | | not null |
| extended | | |
start_date | timestamp with time zone | | |
| plain | | |
end_date | timestamp with time zone | | |
| plain | | |
duration | double precision | | |
| plain | | |
state | character varying(20) | | |
| extended | | |
try_number | integer | | |
| plain | | |
hostname | character varying(1000) | | |
| extended | | |
unixname | character varying(1000) | | |
| extended | | |
job_id | integer | | |
| plain | | |
pool | character varying(256) | | not null |
| extended | | |
queue | character varying(256) | | |
| extended | | |
priority_weight | integer | | |
| plain | | |
operator | character varying(1000) | | |
| extended | | |
queued_dttm | timestamp with time zone | | |
| plain | | |
pid | integer | | |
| plain | | |
max_tries | integer | | |
'-1'::integer | plain | | |
executor_config | bytea | | |
| extended | | |
pool_slots | integer | | not null |
| plain | | |
queued_by_job_id | integer | | |
| plain | | |
external_executor_id | character varying(250) | | |
| extended | | |
trigger_id | integer | | |
| plain | | |
trigger_timeout | timestamp without time zone | | |
| plain | | |
next_method | character varying(1000) | | |
| extended | | |
next_kwargs | json | | |
| extended | | |
map_index | integer | | not null |
'-1'::integer | plain | | |
updated_at | timestamp with time zone | | |
| plain | | |
```
After I added the migration was successful, but I don't know whether I have
added the correct index.
```
CREATE UNIQUE INDEX task_instance_unique_index ON task_instance (dag_id,
task_id, run_id, map_index);
```
Now it looks
```
airflow_us_east_1=> \d+ task_instance
Table
"public.task_instance"
Column | Type | Collation | Nullable |
Default | Storage | Compression | Stats target | Description
----------------------+-----------------------------+-----------+----------+---------------+----------+-------------+--------------+-------------
task_id | character varying(250) | | not null |
| extended | | |
dag_id | character varying(250) | | not null |
| extended | | |
run_id | character varying(250) | | not null |
| extended | | |
start_date | timestamp with time zone | | |
| plain | | |
end_date | timestamp with time zone | | |
| plain | | |
duration | double precision | | |
| plain | | |
state | character varying(20) | | |
| extended | | |
try_number | integer | | |
| plain | | |
hostname | character varying(1000) | | |
| extended | | |
unixname | character varying(1000) | | |
| extended | | |
job_id | integer | | |
| plain | | |
pool | character varying(256) | | not null |
| extended | | |
queue | character varying(256) | | |
| extended | | |
priority_weight | integer | | |
| plain | | |
operator | character varying(1000) | | |
| extended | | |
queued_dttm | timestamp with time zone | | |
| plain | | |
pid | integer | | |
| plain | | |
max_tries | integer | | |
'-1'::integer | plain | | |
executor_config | bytea | | |
| extended | | |
pool_slots | integer | | not null |
| plain | | |
queued_by_job_id | integer | | |
| plain | | |
external_executor_id | character varying(250) | | |
| extended | | |
trigger_id | integer | | |
| plain | | |
trigger_timeout | timestamp without time zone | | |
| plain | | |
next_method | character varying(1000) | | |
| extended | | |
next_kwargs | json | | |
| extended | | |
map_index | integer | | not null |
'-1'::integer | plain | | |
updated_at | timestamp with time zone | | |
| plain | | |
Indexes:
"task_instance_unique_index" UNIQUE, btree (dag_id, task_id, run_id,
map_index)
Referenced by:
TABLE "task_instance_note" CONSTRAINT "task_instance_note_ti_fkey"
FOREIGN KEY (dag_id, task_id, run_id, map_index) REFERENCES
task_instance(dag_id, task_id, run_id, map_index) ON DELETE CASCADE
Access method: heap
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
