I am trying to execute the following query to execute with reasonable performance:
UPDATE order_item_imprint SET item_new_id = oi.item_new_id
FROM order_item oi
INNER JOIN order_item_imprint oii ON oi.item_number = oii.item_id
Currently, it does not complete within 8 days, so we killed him. The request explanation is as follows:

Merge Join (cost=59038021.60..33137238641.84 rows=1432184234121 width=1392)
Merge Cond: ((oi.item_number)::text = (oii.item_id)::text)
-> Nested Loop (cost=0.00..10995925524.15 rows=309949417305 width=1398)
-> Index Scan using unique_order_item_item_number on order_item oi (cost=0.00..608773.05 rows=258995 width=14)
-> Seq Scan on order_item_imprint (cost=0.00..30486.39 rows=1196739 width=1384)
-> Materialize (cost=184026.24..198985.48 rows=1196739 width=6)
-> Sort (cost=184026.24..187018.09 rows=1196739 width=6)
Sort Key: oii.item_id
-> Seq Scan on order_item_imprint oii (cost=0.00..30486.39 rows=1196739 width=6)
I have indexes for both tables, and I ensured that the comparison fields have the same type and size. Now I'm trying to change the configuration of the postgresql server, I hope it helps, but I'm not sure what it will be.
The order_item_imprint table has a size of about 1.1 million with a disk space of 145 MB, and the order_item table is approximately the third size.
The main goal - I need to be able to run this along with several other requests within a few hours of the maintenance window.
.