Advertisement
ph0en1x013141592

INSERT QUERY PLAN

Jan 8th, 2025
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.39 KB | None | 0 0
  1. EXPLAIN ANALYSE SELECT
  2. DISTINCT ON
  3. (A.uniquekey) A.codglacct,
  4. A.refusrno,
  5. A.key_priority_radcs,
  6. A.recon_created_date,
  7. A.dattxnposting,
  8. A.status,
  9. A.uniquekey,
  10. A.coddrcr,
  11. A.cbsacqiss,
  12. A.codacctno,
  13. A.amttxnlcy,
  14. A.acnotrim,
  15. A.priority_no,
  16. A.rrn,
  17. '2025-01-07 19:50:41' AS recon_updated_date,
  18. CASE
  19. WHEN C.key_priority_rtdps IS NOT NULL THEN '2025-01-07 19:50:41'
  20. ELSE NULL
  21. END::TIMESTAMP AS recon_date_1_to_2,
  22. CASE
  23. WHEN D.key_priority_ratrs IS NOT NULL THEN '2025-01-07 19:50:41'
  24. ELSE NULL
  25. END::TIMESTAMP AS recon_date_1_to_3,
  26. CASE
  27. WHEN (C.key_priority_rtdps IS NOT NULL
  28. AND D.key_priority_ratrs IS NOT NULL) THEN '2025-01-07 19:50:41'
  29. ELSE NULL
  30. END::TIMESTAMP AS reconciliation_date_time
  31. FROM
  32. cbsupi.source_cbsupi_tmp_details A
  33. LEFT JOIN switchupi.source_switchupi_tmp_details C ON
  34. (A.key_priority_radcs = C.key_priority_rtdps)
  35. LEFT JOIN npciupi.source_npciupi_tmp_details D ON
  36. (A.key_priority_radcs = D.key_priority_ratrs)
  37. WHERE
  38. A.is_processed IS NULL;
  39.  
  40.  
  41.  
  42.  
  43. "QUERY PLAN"
  44. Unique (cost=10318614.20..18255562.30 rows=62910704 width=806) (actual time=129397.797..262774.560 rows=62910000 loops=1)
  45. -> Gather Merge (cost=10318614.20..18098285.54 rows=62910704 width=806) (actual time=129397.343..236727.386 rows=62910000 loops=1)
  46. Workers Planned: 8
  47. Workers Launched: 8
  48. -> Sort (cost=10318613.95..10338273.55 rows=7863838 width=806) (actual time=128122.113..138771.918 rows=6990000 loops=9)
  49. Sort Key: a.uniquekey
  50. Sort Method: external merge Disk: 1347200kB
  51. Worker 0: Sort Method: external merge Disk: 1282520kB
  52. Worker 1: Sort Method: external merge Disk: 1257264kB
  53. Worker 2: Sort Method: external merge Disk: 1297056kB
  54. Worker 3: Sort Method: external merge Disk: 630408kB
  55. Worker 4: Sort Method: external merge Disk: 1296160kB
  56. Worker 5: Sort Method: external merge Disk: 1259704kB
  57. Worker 6: Sort Method: external merge Disk: 1283304kB
  58. Worker 7: Sort Method: external merge Disk: 1339736kB
  59. -> Parallel Hash Left Join (cost=1557448.90..7780659.45 rows=7863838 width=806) (actual time=83538.832..100539.640 rows=6990000 loops=9)
  60. Hash Cond: (a.key_priority_radcs = d.key_priority_ratrs)
  61. -> Parallel Hash Left Join (cost=760312.96..5198493.41 rows=7863838 width=766) (actual time=48900.312..61849.807 rows=6990000 loops=9)
  62. Hash Cond: (a.key_priority_radcs = c.key_priority_rtdps)
  63. -> Parallel Seq Scan on source_cbsupi_tmp_details a (cost=0.00..2813886.38 rows=7863838 width=750) (actual time=0.206..27053.837 rows=6990000 loops=9)
  64. Filter: (is_processed IS NULL)
  65. -> Parallel Hash (cost=629943.08..629943.08 rows=7499910 width=16) (actual time=11669.051..11669.657 rows=6666667 loops=9)
  66. Buckets: 8388608 Batches: 16 Memory Usage: 241792kB
  67. -> Parallel Index Only Scan using source_switchupi_tmp_details_key_priority_rtdps_idx on source_switchupi_tmp_details c (cost=0.56..629943.08 rows=7499910 width=16) (actual time=1.962..9533.735 rows=6666667 loops=9)
  68. Heap Fetches: 0
  69. -> Parallel Hash (cost=660443.34..660443.34 rows=7863648 width=16) (actual time=13277.728..13278.002 rows=6990000 loops=9)
  70. Buckets: 8388608 Batches: 16 Memory Usage: 250304kB
  71. -> Parallel Index Only Scan using source_npciupi_tmp_details_key_priority_ratrs_idx on source_npciupi_tmp_details d (cost=0.56..660443.34 rows=7863648 width=16) (actual time=1.068..10753.917 rows=6990000 loops=9)
  72. Heap Fetches: 0
  73. Planning Time: 125.405 ms
  74. JIT:
  75. Functions: 146
  76. " Options: Inlining true, Optimization true, Expressions true, Deforming true"
  77. " Timing: Generation 79.062 ms, Inlining 962.843 ms, Optimization 1375.806 ms, Emission 1317.260 ms, Total 3734.970 ms"
  78. Execution Time: 265772.727 ms
  79.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement