Uploaded image for project: 'Hybrid Cloud Console'
  1. Hybrid Cloud Console
  2. RHCLOUD-44774

Improve drawer api response time

XMLWordPrintable

    • Product / Portfolio Work
    • False
    • Hide

      None

      Show
      None
    • False
    • None
    • Unset
    • None

      Currently, when we generate a drawer notification, we also create a record in db for each user of the targeted org.
      We do that to reflect id a particular user marked a notification as read or not.
      Because of that, the underlining table and indexes are huge.

      Because we create a record for each user of the org, most of those records may be useless regarding how many users may connect to HCC and open the drawer panel.

      We should consider to refactor it to add only one record per drawer notification with the list of recipients and the list of users (jsonb) how marked those as read.

      To index those data, we could use a `btree gin` that could look like:

      CREATE INDEX idx_org_recipients ON drawer_notification USING GIN (org_id, recipients);
      

      Then the search query could look like:

      SELECT * FROM drawer_notification WHERE org_id = 'org123'  AND recipients @> '["bob"]';
      

              rh-ee-gduval Guillaume Duval
              rh-ee-gduval Guillaume Duval
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: