Uploaded image for project: 'Project Quay'
  1. Project Quay
  2. PROJQUAY-10280

Create a database index to improve CPU performance

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • None
    • None
    • Security & Compliance
    • False
    • Hide

      None

      Show
      None
    • False
    • Not Selected

      SELECT 
          "t1"."id", "t1"."repository_id", "t1"."digest", "t1"."media_type_id", 
          "t1"."manifest_bytes", "t1"."config_media_type", "t1"."layers_compressed_size", 
          "t1"."subject", "t1"."subject_backfilled", "t1"."artifact_type", 
          "t1"."artifact_type_backfilled" 
      FROM "manifest" AS "t1" 
      INNER JOIN "manifest" AS "t2" ON ("t2"."subject" = "t1"."digest") 
      WHERE ("t1"."id" = 296853380) 
      LIMIT 1 OFFSET 0;
      Limit (cost=1.14..2382875.60 rows=1 width=1006) (actual time=131748.576..131748.578 rows=1 loops=1) -> Nested Loop (cost=1.14..2382875.60 rows=1 width=1006) (actual time=131748.576..131748.577 rows=1 loops=1) -> Index Scan using manifest_pkey on manifest t1 (cost=0.57..8.59 rows=1 width=1006) (actual time=2.097..2.098 rows=1 loops=1) Index Cond: (id = 296853380) -> Index Only Scan using manifest_repository_id_subject on manifest t2 (cost=0.57..2382867.01 rows=1 width=72) (actual time=131746.474..131746.474 rows=1 loops=1) Index Cond: (subject = (t1.digest)::text) Heap Fetches: 0 Planning Time: 28.235 ms Execution Time: 131748.611 ms
      

      This query needs an index over the manifest attribute.

      Ref: https://redhat-internal.slack.com/archives/G7VFPAY7Q/p1768242533096909

              jreyes@redhat.com Jordi Piriz
              jreyes@redhat.com Jordi Piriz
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: