Bug 1668371 Comment 5 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

I loaded my local psql db with 20M (2x prod) entries and was able to notice some slowdown (~4s), but nothing prod-like (~5m), then I used django silky to profile calls to the db.

Assuming I was able to reproduce the issue, if we look at the image attached we see the culprits are probably:

count for incomplete files:
`SELECT COUNT(*) AS "__count"
FROM "upload_fileupload"
WHERE "upload_fileupload"."completed_at" IS NULL`

time_avg:
`SELECT AVG(("upload_fileupload"."completed_at" - "upload_fileupload"."created_at")) AS "time_avg"
FROM "upload_fileupload"`

count, size_avg, size_sum:
`SELECT COUNT("upload_fileupload"."id") AS "count",
       AVG("upload_fileupload"."size") AS "size_avg",
       SUM("upload_fileupload"."size") AS "size_sum"
FROM "upload_fileupload"`
For https://symbols.mozilla.org/uploads/files/
I loaded my local psql db with 20M (2x prod) entries and was able to notice some slowdown (~4s), but nothing prod-like (~5m), then I used django silky to profile calls to the db.

Assuming I was able to reproduce the issue, if we look at the image attached we see the culprits are probably:

count for incomplete files:
`SELECT COUNT(*) AS "__count"
FROM "upload_fileupload"
WHERE "upload_fileupload"."completed_at" IS NULL`

time_avg:
`SELECT AVG(("upload_fileupload"."completed_at" - "upload_fileupload"."created_at")) AS "time_avg"
FROM "upload_fileupload"`

count, size_avg, size_sum:
`SELECT COUNT("upload_fileupload"."id") AS "count",
       AVG("upload_fileupload"."size") AS "size_avg",
       SUM("upload_fileupload"."size") AS "size_sum"
FROM "upload_fileupload"`

Back to Bug 1668371 Comment 5