Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PGSQL] Optimize method PostgresMailboxMessageDAO#listDistinctUserFlags #5346

Open
vttranlina opened this issue Nov 26, 2024 · 1 comment
Open

Comments

@vttranlina
Copy link
Member

The unnest function supported by PostgreSQL is the reason the query for user flags is heavy.

select distinct unnest(user_flags)
from message_mailbox
where mailbox_id = cast($1 as uuid)

image

Detail: https://github.com/vttranlina/vttranlina.github.io/blob/main/gatling_20241126/before/pg_stat_statements_before.csv

I suggest move "unnest" logic to james code application layer and verifying its impact.

@chibenwa
Copy link
Member

chibenwa commented Nov 26, 2024

Less convinced about this one: choose your evil...

Unsure that sending zillions of rows over the network be more efficient...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants