INSERT INTO "comment_like" ("person_id", "comment_id", "post_id", "score") VALUES ($1, $2, $3, $4) ON CONFLICT ("comment_id", "person_id") DO UPDATE SET "person_id" = $5, "comment_id" = $6, "post_id" = $7, "score" = $8 RETURNING "comment_like"."id", "comment_like"."person_id", "comment_like"."comment_id", "comment_like"."post_id", "comment_like"."score", "comment_like"."published"

The server is showing relatively high execution time for this INSERT statement, like 0.4 seconds mean time. Is this form of blended INSERT with UPDATE and RETURNING slower than doing a direct insert? (was misreading data, these are milliseconds, not seconds)

Every time a remote federation Upvote on a comment comes in to Lemmy, it executes this statement.

  • RoundSparrowOP
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    Damn it - I made a mistake

    Ok, re-reading the documentation again, I made a major error interpreting these results.

    mean_exec_time double precision: Mean time spent executing the statement, in milliseconds

    All my statements about INSERT on Likes taking 1/3 of a second are wrong, it’s less than 1 millisecond. Although it sure doesn’t feel that fast when you are interactively using Lemmy 0.18 and pressing the Like button, it seems rather sluggish. I’ve almost never seen fractions of a milliseconds, but here it is.