public inbox for [email protected]  
help / color / mirror / Atom feed
From: Durgamahesh Manne <[email protected]>
To: [email protected]
To: [email protected]
To: Christoph Berg <[email protected]>
To: [email protected]
To: semab tariq <[email protected]>
To: PostgreSQL mailing lists <[email protected]>
Subject: Performance degrade on insert on conflict do nothing
Date: Wed, 11 Sep 2024 10:35:16 +0530
Message-ID: <CAJCZkoLwXzjRfoE_b1YiS2cEC=B6N8vd3+6hWaPxD-LY1YCJZQ@mail.gmail.com> (raw)

Hi
    insert into
dictionary(lang,tid,sportid,brandid,translatedtext,objecttype,basetid)
values ($1,$2,$3,$4,$5,$6,$7) on conflict do nothing
 *8vcpus and 32gb ram
   Number of calls per sec 1600 at this time 42% of cpu utilized
                 Max in ms 33.62 per call
                 Avg in ms  0.17 per call
                                                   Table
"dictionary.dictionary"
     Column     |           Type           | Collation | Nullable | Default
 | Storage  | Compression | Stats target | Description
----------------+--------------------------+-----------+----------+----------+----------+-------------+--------------+-------------
 lang           | text                     |           | not null |
 | extended |             |              |
 tid            | text                     |           | not null |
 | extended |             |              |
 basetid        | text                     |           | not null |
 | extended |             |              |
 sportid        | text                     |           |          |
 | extended |             |              |
 brandid        | text                     |           | not null |
 | extended |             |              |
 translatedtext | text                     |           |          |
 | extended |             |              |
 objecttype     | text                     |           |          |
 | extended |             |              |
 createdat      | timestamp with time zone |           | not null | now()
 | plain    |             |              |
 modified       | timestamp with time zone |           | not null | now()
 | plain    |             |              |
 modifiedby     | text                     |           | not null |
''::text | extended |             |              |
 version        | integer                  |           | not null | 0
 | plain    |             |              |
Indexes:
    "pk_dictionary" PRIMARY KEY, btree (lang, tid)
    "idx_dictionary_basetid" btree (basetid)
    "idx_dictionary_brandid" btree (brandid)
    "idx_dictionary_objecttype" btree (objecttype)
    "idx_dictionary_sportid" btree (sportid)
Triggers:
    i_dictionary_createdat BEFORE INSERT ON dictionary FOR EACH ROW EXECUTE
FUNCTION update_createdat_col()
    i_dictionary_modified BEFORE INSERT OR UPDATE ON dictionary FOR EACH
ROW EXECUTE FUNCTION update_modified_col()
Access method: heap
How do we improve this query performance without taking more cpu?

Regards,
Durga Mahesh


reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Performance degrade on insert on conflict do nothing
  In-Reply-To: <CAJCZkoLwXzjRfoE_b1YiS2cEC=B6N8vd3+6hWaPxD-LY1YCJZQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox