Add tag_name column to dast_profiles_tags table and backfill

What does this MR do and why?

Add tag_name column to dast_profiles_tags table and bacfill that table

This MR is modeled after Backfill tag_name on ci_runner_taggings (!205101 - merged) • Pedro Pombeiro (OOO from Oct 12th-23th) • 18.5, as suggested here: #582781 (comment 2929824996)

Note: The dast_profiles_tags table does not have nearly as many records as the ci_runner_taggings table, but I kept the same batching strategy.

Changelog: added EE: true

References

#582781

Query plans:

Raw SQL
UPDATE 
	"dast_profiles_tags" 
SET 
	"tag_name" = 'docker'
WHERE 
	"dast_profiles_tags"."id" BETWEEN 0 AND 99
	AND "dast_profiles_tags"."id" >= 8
       	AND "dast_profiles_tags"."tag_id" = 7
	AND "dast_profiles_tags"."tag_name" IS NULL
Plan

See https://postgres.ai/console/gitlab/gitlab-production-sec/sessions/50092/commands/148747 .

 ModifyTable on public.dast_profiles_tags  (cost=0.28..3.30 rows=0 width=0) (actual time=0.062..0.063 rows=0 loops=1)
   Buffers: shared hit=3 read=2
   ->  Index Scan using index_dast_profiles_tags_on_tag_id on public.dast_profiles_tags  (cost=0.28..3.30 rows=1 width=38) (actual time=0.061..0.061 rows=0 loops=1)
         Index Cond: (dast_profiles_tags.tag_id = 7)
         Filter: ((dast_profiles_tags.tag_name IS NULL) AND (dast_profiles_tags.id >= 0) AND (dast_profiles_tags.id <= 99) AND (dast_profiles_tags.id >= 8))
         Rows Removed by Filter: 0
         Buffers: shared hit=3 read=2
Settings: effective_cache_size = '338688MB', jit = 'off', random_page_cost = '1.5', work_mem = '100MB', seq_page_cost = '4'

​

Other artifacts are provided below
Summary:
  
Time: 0.684 ms  
  - planning: 0.563 ms  
  - execution: 0.121 ms  
    - I/O read: N/A  
    - I/O write: N/A  
  
Shared buffers:  
  - hits: 3 (~24.00 KiB) from the buffer pool  
  - reads: 2 (~16.00 KiB) from the OS file cache, including disk I/O  
  - dirtied: 0  
  - writes: 0  
  

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by rossfuhrman

Merge request reports

Loading
Loading