Query optimization (#235)

* Optimize version queries and decrease some query complexity

* Run formatter
This commit is contained in:
Geometrically
2021-08-20 16:33:09 -07:00
committed by GitHub
parent 07226c6d21
commit ffd9a34cf5
15 changed files with 1068 additions and 1138 deletions

View File

@@ -162,7 +162,7 @@ impl User {
SELECT u.id, u.github_id, u.name, u.email,
u.avatar_url, u.username, u.bio,
u.created, u.role FROM users u
WHERE u.id IN (SELECT * FROM UNNEST($1::bigint[]))
WHERE u.id = ANY($1)
",
&user_ids_parsed
)
@@ -315,7 +315,7 @@ impl User {
sqlx::query!(
"
DELETE FROM notifications_actions
WHERE notification_id IN (SELECT * FROM UNNEST($1::bigint[]))
WHERE notification_id = ANY($1)
",
&notifications
)
@@ -394,7 +394,7 @@ impl User {
sqlx::query!(
"
DELETE FROM notifications_actions
WHERE notification_id IN (SELECT * FROM UNNEST($1::bigint[]))
WHERE notification_id = ANY($1)
",
&notifications
)