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

Node.jsやめる(Rustにする?) #11078

Open
syuilo opened this issue Jul 3, 2023 · 94 comments
Open

Node.jsやめる(Rustにする?) #11078

syuilo opened this issue Jul 3, 2023 · 94 comments
Labels
packages/backend Server side specific issue/PR 🐢Performance Efficiency related issue/PR 💚Refactor Rewriting code without changing behavior

Comments

@syuilo
Copy link
Member

syuilo commented Jul 3, 2023

Summary

Node.jsはパフォーマンス上の問題があるため

Goとかでもいいけど

@syuilo syuilo added 🐢Performance Efficiency related issue/PR packages/backend Server side specific issue/PR 💚Refactor Rewriting code without changing behavior labels Jul 3, 2023
@EbiseLutica
Copy link
Member

個人的にはRustよりGoのほうがまだ読み書きしやすいのでGoを推したい

@tamaina
Copy link
Member

tamaina commented Jul 3, 2023

GoはGoogle製なので将来性が心配

@syuilo syuilo changed the title バックエンドを全部Rustにする Node.jsやめる(Rustにする?) Jul 3, 2023
@EbiseLutica
Copy link
Member

なんならBunとかに置き換えるだけでもローコストで早くなったりしないのかな

@MineCake147E
Copy link

Rustもどうやら開発コミュニティでn悶着あるみたいですので、個人的にはC# (ASP.NET Core 7.0)が良いかと思います。

@sim1222
Copy link
Contributor

sim1222 commented Jul 3, 2023

bunのfetchとBun.serveに置き換えると速度がだいぶ向上する気はしますが、Crypto周りのNode互換APIがまだ未実装なのでそこだけなんとかすれば動く気はします(node-forgeなどに頼る?)

@EbiseLutica
Copy link
Member

Node.jsのどの側面がMisskeyを遅くしているのか、そもそも本当にMisskeyが遅い原因がNode.jsなのかなどのプロファイリングをしないと、技術選定の裏付けが難しいかも

@tamaina
Copy link
Member

tamaina commented Jul 3, 2023

Rustにするのは俺がRustを覚える必要があるのでやめて欲しい(などと)

@chocolate-pie
Copy link
Contributor

パフォーマンスのことを考えるとRustを推したいです。Goの方が読みやすいとありますが、Rustが独自のルールを導入しているだけで、慣れてくるとそんなんでも。

@argxentakato
Copy link

Rustにするのは俺がRustを覚える必要があるのでやめて欲しい(などと)

Denoを使えばNode.jsのエコシステムを使い回せるのでお得ではないかと。
速度を求めると結局Rustが出てくるけどな!

どちらにせよ、現在のプロジェクト構造を180°ひっくり返すようなものなので「本当にNode.jsが原因かどうか」を精査する必要はあるかと。

@u1-liquid
Copy link
Contributor

Rustはサーバー用度にはあまり使いたくないかも
本当にNodeを捨てるならGoやC#にするのが妥当かと

単純に一部で処理速度がほしいってことならNodeのままでC++などでaddonを作ったほうがいいかもしれない

@acid-chicken
Copy link
Member

Rust に一票

@acid-chicken
Copy link
Member

単純に一部で処理速度がほしいってことならNodeのままでC++などでaddonを作ったほうがいいかもしれない

ちなみにそれはもう Rust でやってる

@acid-chicken
Copy link
Member

あと別に Go はパフォーマンス思考の言語では全然ないので意味がない

@nyanrus
Copy link

nyanrus commented Jul 3, 2023

Denoを使えばNode.jsのエコシステムを使い回せるのでお得ではないかと。 速度を求めると結局Rustが出てくるけどな!

ついでにパフォーマンスが必要ならwasm, もっと行くならffi(ただしunstable)でOK
純Rustの場合、async runtimeなど独自の実装の学習が必要なので、メインはTypescriptを維持したほうがいいと思います。

@tamaina
Copy link
Member

tamaina commented Jul 3, 2023

必要に応じてRustで作ったNodeのネイティブモジュールを読み込む今の方針でいいと思うんだけどなぁ

@fruitriin
Copy link
Contributor

それよりN+1のほうがボトルネックだと思う
Slow Query Logがすごい

@fruitriin
Copy link
Contributor

Slow Query Log いる?

@fruitriin
Copy link
Contributor

fruitriin commented Jul 3, 2023



userid | dbid | toplevel | queryid | query | plans | total_plan_time | min_plan_time | max_plan_time | mean_plan_time | stddev_plan_time | calls | total_exec_time | min_exec_time | max_exec_time | mean_exec_time | stddev_exec_time | rows | shared_blks_hit | shared_blks_read | shared_blks_dirtied | shared_blks_written | local_blks_hit | local_blks_read | local_blks_dirtied | local_blks_written | temp_blks_read | temp_blks_written | blk_read_time | blk_write_time | temp_blk_read_time | temp_blk_write_time | wal_records | wal_fpi | wal_bytes | jit_functions | jit_generation_time | jit_inlining_count | jit_inlining_time | jit_optimization_count | jit_optimization_time | jit_emission_count | jit_emission_time
-- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | --
16822 | 16426 | TRUE | -5599249229748355469 | SELECT DISTINCT "distinctAlias"."note_id" AS "ids_note_id", "distinctAlias"."note_id" FROM (SELECT "note"."id" AS "note_id", "note"."createdAt" AS "note_createdAt", "note"."replyId" AS "note_replyId", "note"."renoteId" AS "note_renoteId", "note"."threadId" AS "note_threadId", "note"."text" AS "note_text", "note"."name" AS "note_name", "note"."cw" AS "note_cw", "note"."userId" AS "note_userId", "note"."localOnly" AS "note_localOnly", "note"."reactionAcceptance" AS "note_reactionAcceptance", "note"."renoteCount" AS "note_renoteCount", "note"."repliesCount" AS "note_repliesCount", "note"."reactions" AS "note_reactions", "note"."visibility" AS "note_visibility", "note"."uri" AS "note_uri", "note"."url" AS "note_url", "note"."fileIds" AS "note_fileIds", "note"."attachedFileTypes" AS "note_attachedFileTypes", "note"."visibleUserIds" AS "note_visibleUserIds", "note"."mentions" AS "note_mentions", "note"."mentionedRemoteUsers" AS "note_mentionedRemoteUsers", "note"."emojis" AS "note_emojis", "note"."tags" AS "note_tags", "note"."hasPoll" AS "note_hasPoll", "note"."channelId" AS "note_channelId", "note"."userHost" AS "note_userHost", "note"."replyUserId" AS "note_replyUserId", "note"."replyUserHost" AS "note_replyUserHost", "note"."renoteUserId" AS "note_renoteUserId", "note"."renoteUserHost" AS "note_renoteUserHost", "user"."id" AS "user_id", "user"."createdAt" AS "user_createdAt", "user"."updatedAt" AS "user_updatedAt", "user"."lastFetchedAt" AS "user_lastFetchedAt", "user"."lastActiveDate" AS "user_lastActiveDate", "user"."hideOnlineStatus" AS "user_hideOnlineStatus", "user"."username" AS "user_username", "user"."name" AS "user_name", "user"."followersCount" AS "user_followersCount", "user"."followingCount" AS "user_followingCount", "user"."movedToUri" AS "user_movedToUri", "user"."movedAt" AS "user_movedAt", "user"."alsoKnownAs" AS "user_alsoKnownAs", "user"."notesCount" AS "user_notesCount", "user"."avatarId" AS "user_avatarId", "user"."bannerId" AS "user_bannerId", "user"."avatarUrl" AS "user_avatarUrl", "user"."bannerUrl" AS "user_bannerUrl", "user"."avatarBlurhash" AS "user_avatarBlurhash", "user"."bannerBlurhash" AS "user_bannerBlurhash", "user"."tags" AS "user_tags", "user"."isSuspended" AS "user_isSuspended", "user"."isLocked" AS "user_isLocked", "user"."isBot" AS "user_isBot", "user"."isCat" AS "user_isCat", "user"."isRoot" AS "user_isRoot", "user"."isExplorable" AS "user_isExplorable", "user"."isDeleted" AS "user_isDeleted", "user"."emojis" AS "user_emojis", "user"."host" AS "user_host", "user"."inbox" AS "user_inbox", "user"."sharedInbox" AS "user_sharedInbox", "user"."featured" AS "user_featured", "user"."uri" AS "user_uri", "user"."followersUri" AS "user_followersUri", "user"."token" AS "user_token", "reply"."id" AS "reply_id", "reply"."createdAt" AS "reply_createdAt", "reply"."replyId" AS "reply_replyId", "reply"."renoteId" AS "reply_renoteId", "reply"."threadId" AS "reply_threadId", "reply"."text" AS "reply_text", "reply"."name" AS "reply_name", "reply"."cw" AS "reply_cw", "reply"."userId" AS "reply_userId", "reply"."localOnly" AS "reply_localOnly", "reply"."reactionAcceptance" AS "reply_reactionAcceptance", "reply"."renoteCount" AS "reply_renoteCount", "reply"."repliesCount" AS "reply_repliesCount", "reply"."reactions" AS "reply_reactions", "reply"."visibility" AS "reply_visibility", "reply"."uri" AS "reply_uri", "reply"."url" AS "reply_url", "reply"."fileIds" AS "reply_fileIds", "reply"."attachedFileTypes" AS "reply_attachedFileTypes", "reply"."visibleUserIds" AS "reply_visibleUserIds", "reply"."mentions" AS "reply_mentions", "reply"."mentionedRemoteUsers" AS "reply_mentionedRemoteUsers", "reply"."emojis" AS "reply_emojis", "reply"."tags" AS "reply_tags", "reply"."hasPoll" AS "reply_hasPoll", "reply"."channelId" AS "reply_channelId", "reply"."userHost" AS "reply_userHost", "reply"."replyUserId" AS "reply_replyUserId", "reply"."replyUserHost" AS "reply_replyUserHost", "reply"."renoteUserId" AS "reply_renoteUserId", "reply"."renoteUserHost" AS "reply_renoteUserHost", "renote"."id" AS "renote_id", "renote"."createdAt" AS "renote_createdAt", "renote"."replyId" AS "renote_replyId", "renote"."renoteId" AS "renote_renoteId", "renote"."threadId" AS "renote_threadId", "renote"."text" AS "renote_text", "renote"."name" AS "renote_name", "renote"."cw" AS "renote_cw", "renote"."userId" AS "renote_userId", "renote"."localOnly" AS "renote_localOnly", "renote"."reactionAcceptance" AS "renote_reactionAcceptance", "renote"."renoteCount" AS "renote_renoteCount", "renote"."repliesCount" AS "renote_repliesCount", "renote"."reactions" AS "renote_reactions", "renote"."visibility" AS "renote_visibility", "renote"."uri" AS "renote_uri", "renote"."url" AS "renote_url", "renote"."fileIds" AS "renote_fileIds", "renote"."attachedFileTypes" AS "renote_attachedFileTypes", "renote"."visibleUserIds" AS "renote_visibleUserIds", "renote"."mentions" AS "renote_mentions", "renote"."mentionedRemoteUsers" AS "renote_mentionedRemoteUsers", "renote"."emojis" AS "renote_emojis", "renote"."tags" AS "renote_tags", "renote"."hasPoll" AS "renote_hasPoll", "renote"."channelId" AS "renote_channelId", "renote"."userHost" AS "renote_userHost", "renote"."replyUserId" AS "renote_replyUserId", "renote"."replyUserHost" AS "renote_replyUserHost", "renote"."renoteUserId" AS "renote_renoteUserId", "renote"."renoteUserHost" AS "renote_renoteUserHost", "replyUser"."id" AS "replyUser_id", "replyUser"."createdAt" AS "replyUser_createdAt", "replyUser"."updatedAt" AS "replyUser_updatedAt", "replyUser"."lastFetchedAt" AS "replyUser_lastFetchedAt", "replyUser"."lastActiveDate" AS "replyUser_lastActiveDate", "replyUser"."hideOnlineStatus" AS "replyUser_hideOnlineStatus", "replyUser"."username" AS "replyUser_username", "replyUser"."name" AS "replyUser_name", "replyUser"."followersCount" AS "replyUser_followersCount", "replyUser"."followingCount" AS "replyUser_followingCount", "replyUser"."movedToUri" AS "replyUser_movedToUri", "replyUser"."movedAt" AS "replyUser_movedAt", "replyUser"."alsoKnownAs" AS "replyUser_alsoKnownAs", "replyUser"."notesCount" AS "replyUser_notesCount", "replyUser"."avatarId" AS "replyUser_avatarId", "replyUser"."bannerId" AS "replyUser_bannerId", "replyUser"."avatarUrl" AS "replyUser_avatarUrl", "replyUser"."bannerUrl" AS "replyUser_bannerUrl", "replyUser"."avatarBlurhash" AS "replyUser_avatarBlurhash", "replyUser"."bannerBlurhash" AS "replyUser_bannerBlurhash", "replyUser"."tags" AS "replyUser_tags", "replyUser"."isSuspended" AS "replyUser_isSuspended", "replyUser"."isLocked" AS "replyUser_isLocked", "replyUser"."isBot" AS "replyUser_isBot", "replyUser"."isCat" AS "replyUser_isCat", "replyUser"."isRoot" AS "replyUser_isRoot", "replyUser"."isExplorable" AS "replyUser_isExplorable", "replyUser"."isDeleted" AS "replyUser_isDeleted", "replyUser"."emojis" AS "replyUser_emojis", "replyUser"."host" AS "replyUser_host", "replyUser"."inbox" AS "replyUser_inbox", "replyUser"."sharedInbox" AS "replyUser_sharedInbox", "replyUser"."featured" AS "replyUser_featured", "replyUser"."uri" AS "replyUser_uri", "replyUser"."followersUri" AS "replyUser_followersUri", "replyUser"."token" AS "replyUser_token", "renoteUser"."id" AS "renoteUser_id", "renoteUser"."createdAt" AS "renoteUser_createdAt", "renoteUser"."updatedAt" AS "renoteUser_updatedAt", "renoteUser"."lastFetchedAt" AS "renoteUser_lastFetchedAt", "renoteUser"."lastActiveDate" AS "renoteUser_lastActiveDate", "renoteUser"."hideOnlineStatus" AS "renoteUser_hideOnlineStatus", "renoteUser"."username" AS "renoteUser_username", "renoteUser"."name" AS "renoteUser_name", "renoteUser"."followersCount" AS "renoteUser_followersCount", "renoteUser"."followingCount" AS "renoteUser_followingCount", "renoteUser"."movedToUri" AS "renoteUser_movedToUri", "renoteUser"."movedAt" AS "renoteUser_movedAt", "renoteUser"."alsoKnownAs" AS "renoteUser_alsoKnownAs", "renoteUser"."notesCount" AS "renoteUser_notesCount", "renoteUser"."avatarId" AS "renoteUser_avatarId", "renoteUser"."bannerId" AS "renoteUser_bannerId", "renoteUser"."avatarUrl" AS "renoteUser_avatarUrl", "renoteUser"."bannerUrl" AS "renoteUser_bannerUrl", "renoteUser"."avatarBlurhash" AS "renoteUser_avatarBlurhash", "renoteUser"."bannerBlurhash" AS "renoteUser_bannerBlurhash", "renoteUser"."tags" AS "renoteUser_tags", "renoteUser"."isSuspended" AS "renoteUser_isSuspended", "renoteUser"."isLocked" AS "renoteUser_isLocked", "renoteUser"."isBot" AS "renoteUser_isBot", "renoteUser"."isCat" AS "renoteUser_isCat", "renoteUser"."isRoot" AS "renoteUser_isRoot", "renoteUser"."isExplorable" AS "renoteUser_isExplorable", "renoteUser"."isDeleted" AS "renoteUser_isDeleted", "renoteUser"."emojis" AS "renoteUser_emojis", "renoteUser"."host" AS "renoteUser_host", "renoteUser"."inbox" AS "renoteUser_inbox", "renoteUser"."sharedInbox" AS "renoteUser_sharedInbox", "renoteUser"."featured" AS "renoteUser_featured", "renoteUser"."uri" AS "renoteUser_uri", "renoteUser"."followersUri" AS "renoteUser_followersUri", "renoteUser"."token" AS "renoteUser_token" FROM "note" "note" INNER JOIN "user" "user" ON "user"."id"="note"."userId"  LEFT JOIN "note" "reply" ON "reply"."id"="note"."replyId"  LEFT JOIN "note" "renote" ON "renote"."id"="note"."renoteId"  LEFT JOIN "user" "replyUser" ON "replyUser"."id"="reply"."userId"  LEFT JOIN "user" "renoteUser" ON "renoteUser"."id"="renote"."userId" WHERE "note"."id" < $1 AND "note"."userId" = $2 AND ("note"."visibility" = $3 OR "note"."visibility" = $4)) "distinctAlias" ORDER BY "distinctAlias"."note_id" DESC, "note_id" ASC LIMIT $5 | 0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 835 | 195447.5877150000 | 0.048698 | 60334.023031000000 | 234.06896732335300 | 2602.273461907280 | 15726 | 17317624 | 1163440 | 1039 | 69 | 0 | 0 | 0 | 0 | 0 | 0 | 0.0 | 0.0 | 0.0 | 0.0 | 1098 | 918 | 6695730 | 0 | 0.0 | 0 | 0.0 | 0 | 0.0 | 0 | 0.0
16822 | 16426 | TRUE | 6047802554448485168 | SELECT DISTINCT "distinctAlias"."note_id" AS "ids_note_id", "distinctAlias"."note_id" FROM (SELECT "note"."id" AS "note_id", "note"."createdAt" AS "note_createdAt", "note"."replyId" AS "note_replyId", "note"."renoteId" AS "note_renoteId", "note"."threadId" AS "note_threadId", "note"."text" AS "note_text", "note"."name" AS "note_name", "note"."cw" AS "note_cw", "note"."userId" AS "note_userId", "note"."localOnly" AS "note_localOnly", "note"."reactionAcceptance" AS "note_reactionAcceptance", "note"."renoteCount" AS "note_renoteCount", "note"."repliesCount" AS "note_repliesCount", "note"."reactions" AS "note_reactions", "note"."visibility" AS "note_visibility", "note"."uri" AS "note_uri", "note"."url" AS "note_url", "note"."fileIds" AS "note_fileIds", "note"."attachedFileTypes" AS "note_attachedFileTypes", "note"."visibleUserIds" AS "note_visibleUserIds", "note"."mentions" AS "note_mentions", "note"."mentionedRemoteUsers" AS "note_mentionedRemoteUsers", "note"."emojis" AS "note_emojis", "note"."tags" AS "note_tags", "note"."hasPoll" AS "note_hasPoll", "note"."channelId" AS "note_channelId", "note"."userHost" AS "note_userHost", "note"."replyUserId" AS "note_replyUserId", "note"."replyUserHost" AS "note_replyUserHost", "note"."renoteUserId" AS "note_renoteUserId", "note"."renoteUserHost" AS "note_renoteUserHost", "user"."id" AS "user_id", "user"."createdAt" AS "user_createdAt", "user"."updatedAt" AS "user_updatedAt", "user"."lastFetchedAt" AS "user_lastFetchedAt", "user"."lastActiveDate" AS "user_lastActiveDate", "user"."hideOnlineStatus" AS "user_hideOnlineStatus", "user"."username" AS "user_username", "user"."name" AS "user_name", "user"."followersCount" AS "user_followersCount", "user"."followingCount" AS "user_followingCount", "user"."movedToUri" AS "user_movedToUri", "user"."movedAt" AS "user_movedAt", "user"."alsoKnownAs" AS "user_alsoKnownAs", "user"."notesCount" AS "user_notesCount", "user"."avatarId" AS "user_avatarId", "user"."bannerId" AS "user_bannerId", "user"."avatarUrl" AS "user_avatarUrl", "user"."bannerUrl" AS "user_bannerUrl", "user"."avatarBlurhash" AS "user_avatarBlurhash", "user"."bannerBlurhash" AS "user_bannerBlurhash", "user"."tags" AS "user_tags", "user"."isSuspended" AS "user_isSuspended", "user"."isLocked" AS "user_isLocked", "user"."isBot" AS "user_isBot", "user"."isCat" AS "user_isCat", "user"."isRoot" AS "user_isRoot", "user"."isExplorable" AS "user_isExplorable", "user"."isDeleted" AS "user_isDeleted", "user"."emojis" AS "user_emojis", "user"."host" AS "user_host", "user"."inbox" AS "user_inbox", "user"."sharedInbox" AS "user_sharedInbox", "user"."featured" AS "user_featured", "user"."uri" AS "user_uri", "user"."followersUri" AS "user_followersUri", "user"."token" AS "user_token", "reply"."id" AS "reply_id", "reply"."createdAt" AS "reply_createdAt", "reply"."replyId" AS "reply_replyId", "reply"."renoteId" AS "reply_renoteId", "reply"."threadId" AS "reply_threadId", "reply"."text" AS "reply_text", "reply"."name" AS "reply_name", "reply"."cw" AS "reply_cw", "reply"."userId" AS "reply_userId", "reply"."localOnly" AS "reply_localOnly", "reply"."reactionAcceptance" AS "reply_reactionAcceptance", "reply"."renoteCount" AS "reply_renoteCount", "reply"."repliesCount" AS "reply_repliesCount", "reply"."reactions" AS "reply_reactions", "reply"."visibility" AS "reply_visibility", "reply"."uri" AS "reply_uri", "reply"."url" AS "reply_url", "reply"."fileIds" AS "reply_fileIds", "reply"."attachedFileTypes" AS "reply_attachedFileTypes", "reply"."visibleUserIds" AS "reply_visibleUserIds", "reply"."mentions" AS "reply_mentions", "reply"."mentionedRemoteUsers" AS "reply_mentionedRemoteUsers", "reply"."emojis" AS "reply_emojis", "reply"."tags" AS "reply_tags", "reply"."hasPoll" AS "reply_hasPoll", "reply"."channelId" AS "reply_channelId", "reply"."userHost" AS "reply_userHost", "reply"."replyUserId" AS "reply_replyUserId", "reply"."replyUserHost" AS "reply_replyUserHost", "reply"."renoteUserId" AS "reply_renoteUserId", "reply"."renoteUserHost" AS "reply_renoteUserHost", "renote"."id" AS "renote_id", "renote"."createdAt" AS "renote_createdAt", "renote"."replyId" AS "renote_replyId", "renote"."renoteId" AS "renote_renoteId", "renote"."threadId" AS "renote_threadId", "renote"."text" AS "renote_text", "renote"."name" AS "renote_name", "renote"."cw" AS "renote_cw", "renote"."userId" AS "renote_userId", "renote"."localOnly" AS "renote_localOnly", "renote"."reactionAcceptance" AS "renote_reactionAcceptance", "renote"."renoteCount" AS "renote_renoteCount", "renote"."repliesCount" AS "renote_repliesCount", "renote"."reactions" AS "renote_reactions", "renote"."visibility" AS "renote_visibility", "renote"."uri" AS "renote_uri", "renote"."url" AS "renote_url", "renote"."fileIds" AS "renote_fileIds", "renote"."attachedFileTypes" AS "renote_attachedFileTypes", "renote"."visibleUserIds" AS "renote_visibleUserIds", "renote"."mentions" AS "renote_mentions", "renote"."mentionedRemoteUsers" AS "renote_mentionedRemoteUsers", "renote"."emojis" AS "renote_emojis", "renote"."tags" AS "renote_tags", "renote"."hasPoll" AS "renote_hasPoll", "renote"."channelId" AS "renote_channelId", "renote"."userHost" AS "renote_userHost", "renote"."replyUserId" AS "renote_replyUserId", "renote"."replyUserHost" AS "renote_replyUserHost", "renote"."renoteUserId" AS "renote_renoteUserId", "renote"."renoteUserHost" AS "renote_renoteUserHost", "replyUser"."id" AS "replyUser_id", "replyUser"."createdAt" AS "replyUser_createdAt", "replyUser"."updatedAt" AS "replyUser_updatedAt", "replyUser"."lastFetchedAt" AS "replyUser_lastFetchedAt", "replyUser"."lastActiveDate" AS "replyUser_lastActiveDate", "replyUser"."hideOnlineStatus" AS "replyUser_hideOnlineStatus", "replyUser"."username" AS "replyUser_username", "replyUser"."name" AS "replyUser_name", "replyUser"."followersCount" AS "replyUser_followersCount", "replyUser"."followingCount" AS "replyUser_followingCount", "replyUser"."movedToUri" AS "replyUser_movedToUri", "replyUser"."movedAt" AS "replyUser_movedAt", "replyUser"."alsoKnownAs" AS "replyUser_alsoKnownAs", "replyUser"."notesCount" AS "replyUser_notesCount", "replyUser"."avatarId" AS "replyUser_avatarId", "replyUser"."bannerId" AS "replyUser_bannerId", "replyUser"."avatarUrl" AS "replyUser_avatarUrl", "replyUser"."bannerUrl" AS "replyUser_bannerUrl", "replyUser"."avatarBlurhash" AS "replyUser_avatarBlurhash", "replyUser"."bannerBlurhash" AS "replyUser_bannerBlurhash", "replyUser"."tags" AS "replyUser_tags", "replyUser"."isSuspended" AS "replyUser_isSuspended", "replyUser"."isLocked" AS "replyUser_isLocked", "replyUser"."isBot" AS "replyUser_isBot", "replyUser"."isCat" AS "replyUser_isCat", "replyUser"."isRoot" AS "replyUser_isRoot", "replyUser"."isExplorable" AS "replyUser_isExplorable", "replyUser"."isDeleted" AS "replyUser_isDeleted", "replyUser"."emojis" AS "replyUser_emojis", "replyUser"."host" AS "replyUser_host", "replyUser"."inbox" AS "replyUser_inbox", "replyUser"."sharedInbox" AS "replyUser_sharedInbox", "replyUser"."featured" AS "replyUser_featured", "replyUser"."uri" AS "replyUser_uri", "replyUser"."followersUri" AS "replyUser_followersUri", "replyUser"."token" AS "replyUser_token", "renoteUser"."id" AS "renoteUser_id", "renoteUser"."createdAt" AS "renoteUser_createdAt", "renoteUser"."updatedAt" AS "renoteUser_updatedAt", "renoteUser"."lastFetchedAt" AS "renoteUser_lastFetchedAt", "renoteUser"."lastActiveDate" AS "renoteUser_lastActiveDate", "renoteUser"."hideOnlineStatus" AS "renoteUser_hideOnlineStatus", "renoteUser"."username" AS "renoteUser_username", "renoteUser"."name" AS "renoteUser_name", "renoteUser"."followersCount" AS "renoteUser_followersCount", "renoteUser"."followingCount" AS "renoteUser_followingCount", "renoteUser"."movedToUri" AS "renoteUser_movedToUri", "renoteUser"."movedAt" AS "renoteUser_movedAt", "renoteUser"."alsoKnownAs" AS "renoteUser_alsoKnownAs", "renoteUser"."notesCount" AS "renoteUser_notesCount", "renoteUser"."avatarId" AS "renoteUser_avatarId", "renoteUser"."bannerId" AS "renoteUser_bannerId", "renoteUser"."avatarUrl" AS "renoteUser_avatarUrl", "renoteUser"."bannerUrl" AS "renoteUser_bannerUrl", "renoteUser"."avatarBlurhash" AS "renoteUser_avatarBlurhash", "renoteUser"."bannerBlurhash" AS "renoteUser_bannerBlurhash", "renoteUser"."tags" AS "renoteUser_tags", "renoteUser"."isSuspended" AS "renoteUser_isSuspended", "renoteUser"."isLocked" AS "renoteUser_isLocked", "renoteUser"."isBot" AS "renoteUser_isBot", "renoteUser"."isCat" AS "renoteUser_isCat", "renoteUser"."isRoot" AS "renoteUser_isRoot", "renoteUser"."isExplorable" AS "renoteUser_isExplorable", "renoteUser"."isDeleted" AS "renoteUser_isDeleted", "renoteUser"."emojis" AS "renoteUser_emojis", "renoteUser"."host" AS "renoteUser_host", "renoteUser"."inbox" AS "renoteUser_inbox", "renoteUser"."sharedInbox" AS "renoteUser_sharedInbox", "renoteUser"."featured" AS "renoteUser_featured", "renoteUser"."uri" AS "renoteUser_uri", "renoteUser"."followersUri" AS "renoteUser_followersUri", "renoteUser"."token" AS "renoteUser_token" FROM "note" "note" INNER JOIN "user_list_joining" "userListJoining" ON "userListJoining"."userId" = "note"."userId"  INNER JOIN "user" "user" ON "user"."id"="note"."userId"  LEFT JOIN "note" "reply" ON "reply"."id"="note"."replyId"  LEFT JOIN "note" "renote" ON "renote"."id"="note"."renoteId"  LEFT JOIN "user" "replyUser" ON "replyUser"."id"="reply"."userId"  LEFT JOIN "user" "renoteUser" ON "renoteUser"."id"="renote"."userId" WHERE "userListJoining"."userListId" = $1 AND (("note"."visibility" = $7 OR "note"."visibility" = $8) OR "note"."userId" = $2 OR $3 = ANY("note"."visibleUserIds") OR $4 = ANY("note"."mentions") OR ("note"."visibility" = $9 AND ("note"."userId" IN (SELECT "following"."followeeId" AS "following_followeeId" FROM "following" "following" WHERE "following"."followerId" = $5) OR "note"."replyUserId" = $6)))) "distinctAlias" ORDER BY "distinctAlias"."note_id" DESC, "note_id" ASC LIMIT $10 | 0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 2405 | 1155895.4092980000 | 0.03266 | 47591.22705 | 480.6217918079010 | 1349.8401904937000 | 24362 | 24448039 | 7372857 | 1662 | 5848 | 0 | 0 | 0 | 0 | 0 | 0 | 0.0 | 0.0 | 0.0 | 0.0 | 2518 | 1435 | 10378057 | 0 | 0.0 | 0 | 0.0 | 0 | 0.0 | 0 | 0.0
16822 | 16426 | TRUE | -4295012842788197408 | SELECT DISTINCT "distinctAlias"."reaction_id" AS "ids_reaction_id", "distinctAlias"."reaction_id" FROM (SELECT "reaction"."id" AS "reaction_id", "reaction"."createdAt" AS "reaction_createdAt", "reaction"."userId" AS "reaction_userId", "reaction"."noteId" AS "reaction_noteId", "reaction"."reaction" AS "reaction_reaction", "note"."id" AS "note_id", "note"."createdAt" AS "note_createdAt", "note"."replyId" AS "note_replyId", "note"."renoteId" AS "note_renoteId", "note"."threadId" AS "note_threadId", "note"."text" AS "note_text", "note"."name" AS "note_name", "note"."cw" AS "note_cw", "note"."userId" AS "note_userId", "note"."localOnly" AS "note_localOnly", "note"."reactionAcceptance" AS "note_reactionAcceptance", "note"."renoteCount" AS "note_renoteCount", "note"."repliesCount" AS "note_repliesCount", "note"."reactions" AS "note_reactions", "note"."visibility" AS "note_visibility", "note"."uri" AS "note_uri", "note"."url" AS "note_url", "note"."fileIds" AS "note_fileIds", "note"."attachedFileTypes" AS "note_attachedFileTypes", "note"."visibleUserIds" AS "note_visibleUserIds", "note"."mentions" AS "note_mentions", "note"."mentionedRemoteUsers" AS "note_mentionedRemoteUsers", "note"."emojis" AS "note_emojis", "note"."tags" AS "note_tags", "note"."hasPoll" AS "note_hasPoll", "note"."channelId" AS "note_channelId", "note"."userHost" AS "note_userHost", "note"."replyUserId" AS "note_replyUserId", "note"."replyUserHost" AS "note_replyUserHost", "note"."renoteUserId" AS "note_renoteUserId", "note"."renoteUserHost" AS "note_renoteUserHost" FROM "note_reaction" "reaction" LEFT JOIN "note" "note" ON "note"."id"="reaction"."noteId" WHERE "reaction"."userId" = $1 AND ("note"."visibility" = $2 OR "note"."visibility" = $3)) "distinctAlias" ORDER BY "distinctAlias"."reaction_id" DESC, "reaction_id" ASC LIMIT $4 | 0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 38 | 109068.08901100000 | 1.266135 | 37117.411897 | 2870.212868710530 | 7575.171793860580 | 660 | 36941666 | 794634 | 2714 | 465 | 0 | 0 | 0 | 0 | 0 | 0 | 0.0 | 0.0 | 0.0 | 0.0 | 2560 | 2485 | 18471909 | 0 | 0.0 | 0 | 0.0 | 0 | 0.0 | 0 | 0.0
16822 | 16426 | TRUE | -1765600823722344336 | SELECT DISTINCT "distinctAlias"."note_id" AS "ids_note_id", "distinctAlias"."note_id" FROM (SELECT "note"."id" AS "note_id", "note"."createdAt" AS "note_createdAt", "note"."replyId" AS "note_replyId", "note"."renoteId" AS "note_renoteId", "note"."threadId" AS "note_threadId", "note"."text" AS "note_text", "note"."name" AS "note_name", "note"."cw" AS "note_cw", "note"."userId" AS "note_userId", "note"."localOnly" AS "note_localOnly", "note"."reactionAcceptance" AS "note_reactionAcceptance", "note"."renoteCount" AS "note_renoteCount", "note"."repliesCount" AS "note_repliesCount", "note"."reactions" AS "note_reactions", "note"."visibility" AS "note_visibility", "note"."uri" AS "note_uri", "note"."url" AS "note_url", "note"."fileIds" AS "note_fileIds", "note"."attachedFileTypes" AS "note_attachedFileTypes", "note"."visibleUserIds" AS "note_visibleUserIds", "note"."mentions" AS "note_mentions", "note"."mentionedRemoteUsers" AS "note_mentionedRemoteUsers", "note"."emojis" AS "note_emojis", "note"."tags" AS "note_tags", "note"."hasPoll" AS "note_hasPoll", "note"."channelId" AS "note_channelId", "note"."userHost" AS "note_userHost", "note"."replyUserId" AS "note_replyUserId", "note"."replyUserHost" AS "note_replyUserHost", "note"."renoteUserId" AS "note_renoteUserId", "note"."renoteUserHost" AS "note_renoteUserHost", "user"."id" AS "user_id", "user"."createdAt" AS "user_createdAt", "user"."updatedAt" AS "user_updatedAt", "user"."lastFetchedAt" AS "user_lastFetchedAt", "user"."lastActiveDate" AS "user_lastActiveDate", "user"."hideOnlineStatus" AS "user_hideOnlineStatus", "user"."username" AS "user_username", "user"."name" AS "user_name", "user"."followersCount" AS "user_followersCount", "user"."followingCount" AS "user_followingCount", "user"."movedToUri" AS "user_movedToUri", "user"."movedAt" AS "user_movedAt", "user"."alsoKnownAs" AS "user_alsoKnownAs", "user"."notesCount" AS "user_notesCount", "user"."avatarId" AS "user_avatarId", "user"."bannerId" AS "user_bannerId", "user"."avatarUrl" AS "user_avatarUrl", "user"."bannerUrl" AS "user_bannerUrl", "user"."avatarBlurhash" AS "user_avatarBlurhash", "user"."bannerBlurhash" AS "user_bannerBlurhash", "user"."tags" AS "user_tags", "user"."isSuspended" AS "user_isSuspended", "user"."isLocked" AS "user_isLocked", "user"."isBot" AS "user_isBot", "user"."isCat" AS "user_isCat", "user"."isRoot" AS "user_isRoot", "user"."isExplorable" AS "user_isExplorable", "user"."isDeleted" AS "user_isDeleted", "user"."emojis" AS "user_emojis", "user"."host" AS "user_host", "user"."inbox" AS "user_inbox", "user"."sharedInbox" AS "user_sharedInbox", "user"."featured" AS "user_featured", "user"."uri" AS "user_uri", "user"."followersUri" AS "user_followersUri", "user"."token" AS "user_token", "reply"."id" AS "reply_id", "reply"."createdAt" AS "reply_createdAt", "reply"."replyId" AS "reply_replyId", "reply"."renoteId" AS "reply_renoteId", "reply"."threadId" AS "reply_threadId", "reply"."text" AS "reply_text", "reply"."name" AS "reply_name", "reply"."cw" AS "reply_cw", "reply"."userId" AS "reply_userId", "reply"."localOnly" AS "reply_localOnly", "reply"."reactionAcceptance" AS "reply_reactionAcceptance", "reply"."renoteCount" AS "reply_renoteCount", "reply"."repliesCount" AS "reply_repliesCount", "reply"."reactions" AS "reply_reactions", "reply"."visibility" AS "reply_visibility", "reply"."uri" AS "reply_uri", "reply"."url" AS "reply_url", "reply"."fileIds" AS "reply_fileIds", "reply"."attachedFileTypes" AS "reply_attachedFileTypes", "reply"."visibleUserIds" AS "reply_visibleUserIds", "reply"."mentions" AS "reply_mentions", "reply"."mentionedRemoteUsers" AS "reply_mentionedRemoteUsers", "reply"."emojis" AS "reply_emojis", "reply"."tags" AS "reply_tags", "reply"."hasPoll" AS "reply_hasPoll", "reply"."channelId" AS "reply_channelId", "reply"."userHost" AS "reply_userHost", "reply"."replyUserId" AS "reply_replyUserId", "reply"."replyUserHost" AS "reply_replyUserHost", "reply"."renoteUserId" AS "reply_renoteUserId", "reply"."renoteUserHost" AS "reply_renoteUserHost", "renote"."id" AS "renote_id", "renote"."createdAt" AS "renote_createdAt", "renote"."replyId" AS "renote_replyId", "renote"."renoteId" AS "renote_renoteId", "renote"."threadId" AS "renote_threadId", "renote"."text" AS "renote_text", "renote"."name" AS "renote_name", "renote"."cw" AS "renote_cw", "renote"."userId" AS "renote_userId", "renote"."localOnly" AS "renote_localOnly", "renote"."reactionAcceptance" AS "renote_reactionAcceptance", "renote"."renoteCount" AS "renote_renoteCount", "renote"."repliesCount" AS "renote_repliesCount", "renote"."reactions" AS "renote_reactions", "renote"."visibility" AS "renote_visibility", "renote"."uri" AS "renote_uri", "renote"."url" AS "renote_url", "renote"."fileIds" AS "renote_fileIds", "renote"."attachedFileTypes" AS "renote_attachedFileTypes", "renote"."visibleUserIds" AS "renote_visibleUserIds", "renote"."mentions" AS "renote_mentions", "renote"."mentionedRemoteUsers" AS "renote_mentionedRemoteUsers", "renote"."emojis" AS "renote_emojis", "renote"."tags" AS "renote_tags", "renote"."hasPoll" AS "renote_hasPoll", "renote"."channelId" AS "renote_channelId", "renote"."userHost" AS "renote_userHost", "renote"."replyUserId" AS "renote_replyUserId", "renote"."replyUserHost" AS "renote_replyUserHost", "renote"."renoteUserId" AS "renote_renoteUserId", "renote"."renoteUserHost" AS "renote_renoteUserHost", "replyUser"."id" AS "replyUser_id", "replyUser"."createdAt" AS "replyUser_createdAt", "replyUser"."updatedAt" AS "replyUser_updatedAt", "replyUser"."lastFetchedAt" AS "replyUser_lastFetchedAt", "replyUser"."lastActiveDate" AS "replyUser_lastActiveDate", "replyUser"."hideOnlineStatus" AS "replyUser_hideOnlineStatus", "replyUser"."username" AS "replyUser_username", "replyUser"."name" AS "replyUser_name", "replyUser"."followersCount" AS "replyUser_followersCount", "replyUser"."followingCount" AS "replyUser_followingCount", "replyUser"."movedToUri" AS "replyUser_movedToUri", "replyUser"."movedAt" AS "replyUser_movedAt", "replyUser"."alsoKnownAs" AS "replyUser_alsoKnownAs", "replyUser"."notesCount" AS "replyUser_notesCount", "replyUser"."avatarId" AS "replyUser_avatarId", "replyUser"."bannerId" AS "replyUser_bannerId", "replyUser"."avatarUrl" AS "replyUser_avatarUrl", "replyUser"."bannerUrl" AS "replyUser_bannerUrl", "replyUser"."avatarBlurhash" AS "replyUser_avatarBlurhash", "replyUser"."bannerBlurhash" AS "replyUser_bannerBlurhash", "replyUser"."tags" AS "replyUser_tags", "replyUser"."isSuspended" AS "replyUser_isSuspended", "replyUser"."isLocked" AS "replyUser_isLocked", "replyUser"."isBot" AS "replyUser_isBot", "replyUser"."isCat" AS "replyUser_isCat", "replyUser"."isRoot" AS "replyUser_isRoot", "replyUser"."isExplorable" AS "replyUser_isExplorable", "replyUser"."isDeleted" AS "replyUser_isDeleted", "replyUser"."emojis" AS "replyUser_emojis", "replyUser"."host" AS "replyUser_host", "replyUser"."inbox" AS "replyUser_inbox", "replyUser"."sharedInbox" AS "replyUser_sharedInbox", "replyUser"."featured" AS "replyUser_featured", "replyUser"."uri" AS "replyUser_uri", "replyUser"."followersUri" AS "replyUser_followersUri", "replyUser"."token" AS "replyUser_token", "renoteUser"."id" AS "renoteUser_id", "renoteUser"."createdAt" AS "renoteUser_createdAt", "renoteUser"."updatedAt" AS "renoteUser_updatedAt", "renoteUser"."lastFetchedAt" AS "renoteUser_lastFetchedAt", "renoteUser"."lastActiveDate" AS "renoteUser_lastActiveDate", "renoteUser"."hideOnlineStatus" AS "renoteUser_hideOnlineStatus", "renoteUser"."username" AS "renoteUser_username", "renoteUser"."name" AS "renoteUser_name", "renoteUser"."followersCount" AS "renoteUser_followersCount", "renoteUser"."followingCount" AS "renoteUser_followingCount", "renoteUser"."movedToUri" AS "renoteUser_movedToUri", "renoteUser"."movedAt" AS "renoteUser_movedAt", "renoteUser"."alsoKnownAs" AS "renoteUser_alsoKnownAs", "renoteUser"."notesCount" AS "renoteUser_notesCount", "renoteUser"."avatarId" AS "renoteUser_avatarId", "renoteUser"."bannerId" AS "renoteUser_bannerId", "renoteUser"."avatarUrl" AS "renoteUser_avatarUrl", "renoteUser"."bannerUrl" AS "renoteUser_bannerUrl", "renoteUser"."avatarBlurhash" AS "renoteUser_avatarBlurhash", "renoteUser"."bannerBlurhash" AS "renoteUser_bannerBlurhash", "renoteUser"."tags" AS "renoteUser_tags", "renoteUser"."isSuspended" AS "renoteUser_isSuspended", "renoteUser"."isLocked" AS "renoteUser_isLocked", "renoteUser"."isBot" AS "renoteUser_isBot", "renoteUser"."isCat" AS "renoteUser_isCat", "renoteUser"."isRoot" AS "renoteUser_isRoot", "renoteUser"."isExplorable" AS "renoteUser_isExplorable", "renoteUser"."isDeleted" AS "renoteUser_isDeleted", "renoteUser"."emojis" AS "renoteUser_emojis", "renoteUser"."host" AS "renoteUser_host", "renoteUser"."inbox" AS "renoteUser_inbox", "renoteUser"."sharedInbox" AS "renoteUser_sharedInbox", "renoteUser"."featured" AS "renoteUser_featured", "renoteUser"."uri" AS "renoteUser_uri", "renoteUser"."followersUri" AS "renoteUser_followersUri", "renoteUser"."token" AS "renoteUser_token" FROM "note" "note" INNER JOIN "user" "user" ON "user"."id"="note"."userId"  LEFT JOIN "note" "reply" ON "reply"."id"="note"."replyId"  LEFT JOIN "note" "renote" ON "renote"."id"="note"."renoteId"  LEFT JOIN "user" "replyUser" ON "replyUser"."id"="reply"."userId"  LEFT JOIN "user" "renoteUser" ON "renoteUser"."id"="renote"."userId" WHERE "note"."id" > $1 AND "note"."userId" = $2 AND ("note"."visibility" = $3 OR "note"."visibility" = $4)) "distinctAlias" ORDER BY "distinctAlias"."note_id" ASC, "note_id" ASC LIMIT $5 | 0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 280 | 86080.47453400000 | 0.026333 | 28175.532895 | 307.4302661928570 | 2489.899267513270 | 934 | 8923005 | 608268 | 2080 | 351 | 0 | 0 | 0 | 0 | 0 | 0 | 0.0 | 0.0 | 0.0 | 0.0 | 2155 | 1993 | 14337277 | 0 | 0.0 | 0 | 0.0 | 0 | 0.0 | 0 | 0.0
16822 | 16426 | TRUE | 1654036986644845719 | SELECT COUNT($1) AS "cnt" FROM "note" "Note" WHERE (NOT("Note"."userHost" IS NULL)) | 0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1 | 25877.970488 | 25877.970488 | 25877.970488 | 25877.970488 | 0.0 | 1 | 1151161 | 696734 | 2430 | 609 | 0 | 0 | 0 | 0 | 0 | 0 | 0.0 | 0.0 | 0.0 | 0.0 | 2287 | 2272 | 14826898 | 5 | 0.496294 | 0 | 0.0 | 1 | 0.462121 | 1 | 18.538977
16822 | 16426 | TRUE | -7540922400907630251 | SELECT DISTINCT "distinctAlias"."reaction_id" AS "ids_reaction_id", "distinctAlias"."reaction_id" FROM (SELECT "reaction"."id" AS "reaction_id", "reaction"."createdAt" AS "reaction_createdAt", "reaction"."userId" AS "reaction_userId", "reaction"."noteId" AS "reaction_noteId", "reaction"."reaction" AS "reaction_reaction", "note"."id" AS "note_id", "note"."createdAt" AS "note_createdAt", "note"."replyId" AS "note_replyId", "note"."renoteId" AS "note_renoteId", "note"."threadId" AS "note_threadId", "note"."text" AS "note_text", "note"."name" AS "note_name", "note"."cw" AS "note_cw", "note"."userId" AS "note_userId", "note"."localOnly" AS "note_localOnly", "note"."reactionAcceptance" AS "note_reactionAcceptance", "note"."renoteCount" AS "note_renoteCount", "note"."repliesCount" AS "note_repliesCount", "note"."reactions" AS "note_reactions", "note"."visibility" AS "note_visibility", "note"."uri" AS "note_uri", "note"."url" AS "note_url", "note"."fileIds" AS "note_fileIds", "note"."attachedFileTypes" AS "note_attachedFileTypes", "note"."visibleUserIds" AS "note_visibleUserIds", "note"."mentions" AS "note_mentions", "note"."mentionedRemoteUsers" AS "note_mentionedRemoteUsers", "note"."emojis" AS "note_emojis", "note"."tags" AS "note_tags", "note"."hasPoll" AS "note_hasPoll", "note"."channelId" AS "note_channelId", "note"."userHost" AS "note_userHost", "note"."replyUserId" AS "note_replyUserId", "note"."replyUserHost" AS "note_replyUserHost", "note"."renoteUserId" AS "note_renoteUserId", "note"."renoteUserHost" AS "note_renoteUserHost" FROM "note_reaction" "reaction" LEFT JOIN "note" "note" ON "note"."id"="reaction"."noteId" WHERE "reaction"."userId" = $1 AND (("note"."visibility" = $7 OR "note"."visibility" = $8) OR "note"."userId" = $2 OR $3 = ANY("note"."visibleUserIds") OR $4 = ANY("note"."mentions") OR ("note"."visibility" = $9 AND ("note"."userId" IN (SELECT "following"."followeeId" AS "following_followeeId" FROM "following" "following" WHERE "following"."followerId" = $5) OR "note"."replyUserId" = $6)))) "distinctAlias" ORDER BY "distinctAlias"."reaction_id" DESC, "reaction_id" ASC LIMIT $10 | 0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 130 | 616736.6207930000 | 0.5771040000000000 | 18576.845245 | 4744.127852253850 | 7238.885784631330 | 1948 | 283590723 | 5302448 | 3427 | 3126 | 0 | 0 | 0 | 0 | 0 | 0 | 0.0 | 0.0 | 0.0 | 0.0 | 2935 | 1861 | 13533311 | 0 | 0.0 | 0 | 0.0 | 0 | 0.0 | 0 | 0.0
16822 | 16426 | TRUE | -2691487539323277329 | SELECT "NoteUnread"."id" AS "NoteUnread_id", "NoteUnread"."userId" AS "NoteUnread_userId", "NoteUnread"."noteId" AS "NoteUnread_noteId", "NoteUnread"."isMentioned" AS "NoteUnread_isMentioned", "NoteUnread"."isSpecified" AS "NoteUnread_isSpecified", "NoteUnread"."noteUserId" AS "NoteUnread_noteUserId", "NoteUnread"."noteChannelId" AS "NoteUnread_noteChannelId" FROM "note_unread" "NoteUnread" WHERE ("NoteUnread"."noteChannelId" = $1 AND "NoteUnread"."userId" = $2) LIMIT $3 | 0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 158135 | 10848611.660474000 | 0.007074 | 15160.238492 | 68.60348221755920 | 657.2720886558900 | 49756 | 67887204 | 38799457 | 118785 | 34243 | 0 | 0 | 0 | 0 | 0 | 0 | 0.0 | 0.0 | 0.0 | 0.0 | 158537 | 110504 | 858707672 | 0 | 0.0 | 0 | 0.0 | 0 | 0.0 | 0 | 0.0
16822 | 16426 | TRUE | -6004942123678083980 | SELECT DISTINCT "distinctAlias"."reaction_id" AS "ids_reaction_id", "distinctAlias"."reaction_id" FROM (SELECT "reaction"."id" AS "reaction_id", "reaction"."createdAt" AS "reaction_createdAt", "reaction"."userId" AS "reaction_userId", "reaction"."noteId" AS "reaction_noteId", "reaction"."reaction" AS "reaction_reaction", "note"."id" AS "note_id", "note"."createdAt" AS "note_createdAt", "note"."replyId" AS "note_replyId", "note"."renoteId" AS "note_renoteId", "note"."threadId" AS "note_threadId", "note"."text" AS "note_text", "note"."name" AS "note_name", "note"."cw" AS "note_cw", "note"."userId" AS "note_userId", "note"."localOnly" AS "note_localOnly", "note"."reactionAcceptance" AS "note_reactionAcceptance", "note"."renoteCount" AS "note_renoteCount", "note"."repliesCount" AS "note_repliesCount", "note"."reactions" AS "note_reactions", "note"."visibility" AS "note_visibility", "note"."uri" AS "note_uri", "note"."url" AS "note_url", "note"."fileIds" AS "note_fileIds", "note"."attachedFileTypes" AS "note_attachedFileTypes", "note"."visibleUserIds" AS "note_visibleUserIds", "note"."mentions" AS "note_mentions", "note"."mentionedRemoteUsers" AS "note_mentionedRemoteUsers", "note"."emojis" AS "note_emojis", "note"."tags" AS "note_tags", "note"."hasPoll" AS "note_hasPoll", "note"."channelId" AS "note_channelId", "note"."userHost" AS "note_userHost", "note"."replyUserId" AS "note_replyUserId", "note"."replyUserHost" AS "note_replyUserHost", "note"."renoteUserId" AS "note_renoteUserId", "note"."renoteUserHost" AS "note_renoteUserHost" FROM "note_reaction" "reaction" LEFT JOIN "note" "note" ON "note"."id"="reaction"."noteId" WHERE "reaction"."id" < $1 AND "reaction"."userId" = $2 AND (("note"."visibility" = $8 OR "note"."visibility" = $9) OR "note"."userId" = $3 OR $4 = ANY("note"."visibleUserIds") OR $5 = ANY("note"."mentions") OR ("note"."visibility" = $10 AND ("note"."userId" IN (SELECT "following"."followeeId" AS "following_followeeId" FROM "following" "following" WHERE "following"."followerId" = $6) OR "note"."replyUserId" = $7)))) "distinctAlias" ORDER BY "distinctAlias"."reaction_id" DESC, "reaction_id" ASC LIMIT $11 | 0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 35 | 17222.766013 | 21.509164000000000 | 14722.809564000000 | 492.0790289428570 | 2443.374730779850 | 960 | 6760904 | 182160 | 18 | 48 | 0 | 0 | 0 | 0 | 0 | 0 | 0.0 | 0.0 | 0.0 | 0.0 | 29 | 11 | 89801 | 0 | 0.0 | 0 | 0.0 | 0 | 0.0 | 0 | 0.0
16822 | 16426 | TRUE | -6892100638206848872 | DELETE FROM "user" WHERE "id" IN ($1) | 0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1419 | 64698.88648200010 | 4.457217 | 11767.120392 | 45.59470506131070 | 337.8198344050560 | 1419 | 2082571 | 113871 | 51824 | 65 | 0 | 0 | 0 | 0 | 0 | 0 | 0.0 | 0.0 | 0.0 | 0.0 | 58321 | 51730 | 402572043 | 0 | 0.0 | 0 | 0.0 | 0 | 0.0 | 0 | 0.0
16822 | 16426 | TRUE | 1136360094718252966 | SELECT DISTINCT "distinctAlias"."note_id" AS "ids_note_id", "distinctAlias"."note_id" FROM (SELECT "note"."id" AS "note_id", "note"."createdAt" AS "note_createdAt", "note"."replyId" AS "note_replyId", "note"."renoteId" AS "note_renoteId", "note"."threadId" AS "note_threadId", "note"."text" AS "note_text", "note"."name" AS "note_name", "note"."cw" AS "note_cw", "note"."userId" AS "note_userId", "note"."localOnly" AS "note_localOnly", "note"."reactionAcceptance" AS "note_reactionAcceptance", "note"."renoteCount" AS "note_renoteCount", "note"."repliesCount" AS "note_repliesCount", "note"."reactions" AS "note_reactions", "note"."visibility" AS "note_visibility", "note"."uri" AS "note_uri", "note"."url" AS "note_url", "note"."fileIds" AS "note_fileIds", "note"."attachedFileTypes" AS "note_attachedFileTypes", "note"."visibleUserIds" AS "note_visibleUserIds", "note"."mentions" AS "note_mentions", "note"."mentionedRemoteUsers" AS "note_mentionedRemoteUsers", "note"."emojis" AS "note_emojis", "note"."tags" AS "note_tags", "note"."hasPoll" AS "note_hasPoll", "note"."channelId" AS "note_channelId", "note"."userHost" AS "note_userHost", "note"."replyUserId" AS "note_replyUserId", "note"."replyUserHost" AS "note_replyUserHost", "note"."renoteUserId" AS "note_renoteUserId", "note"."renoteUserHost" AS "note_renoteUserHost", "user"."id" AS "user_id", "user"."createdAt" AS "user_createdAt", "user"."updatedAt" AS "user_updatedAt", "user"."lastFetchedAt" AS "user_lastFetchedAt", "user"."lastActiveDate" AS "user_lastActiveDate", "user"."hideOnlineStatus" AS "user_hideOnlineStatus", "user"."username" AS "user_username", "user"."name" AS "user_name", "user"."followersCount" AS "user_followersCount", "user"."followingCount" AS "user_followingCount", "user"."movedToUri" AS "user_movedToUri", "user"."movedAt" AS "user_movedAt", "user"."alsoKnownAs" AS "user_alsoKnownAs", "user"."notesCount" AS "user_notesCount", "user"."avatarId" AS "user_avatarId", "user"."bannerId" AS "user_bannerId", "user"."avatarUrl" AS "user_avatarUrl", "user"."bannerUrl" AS "user_bannerUrl", "user"."avatarBlurhash" AS "user_avatarBlurhash", "user"."bannerBlurhash" AS "user_bannerBlurhash", "user"."tags" AS "user_tags", "user"."isSuspended" AS "user_isSuspended", "user"."isLocked" AS "user_isLocked", "user"."isBot" AS "user_isBot", "user"."isCat" AS "user_isCat", "user"."isRoot" AS "user_isRoot", "user"."isExplorable" AS "user_isExplorable", "user"."isDeleted" AS "user_isDeleted", "user"."emojis" AS "user_emojis", "user"."host" AS "user_host", "user"."inbox" AS "user_inbox", "user"."sharedInbox" AS "user_sharedInbox", "user"."featured" AS "user_featured", "user"."uri" AS "user_uri", "user"."followersUri" AS "user_followersUri", "user"."token" AS "user_token", "reply"."id" AS "reply_id", "reply"."createdAt" AS "reply_createdAt", "reply"."replyId" AS "reply_replyId", "reply"."renoteId" AS "reply_renoteId", "reply"."threadId" AS "reply_threadId", "reply"."text" AS "reply_text", "reply"."name" AS "reply_name", "reply"."cw" AS "reply_cw", "reply"."userId" AS "reply_userId", "reply"."localOnly" AS "reply_localOnly", "reply"."reactionAcceptance" AS "reply_reactionAcceptance", "reply"."renoteCount" AS "reply_renoteCount", "reply"."repliesCount" AS "reply_repliesCount", "reply"."reactions" AS "reply_reactions", "reply"."visibility" AS "reply_visibility", "reply"."uri" AS "reply_uri", "reply"."url" AS "reply_url", "reply"."fileIds" AS "reply_fileIds", "reply"."attachedFileTypes" AS "reply_attachedFileTypes", "reply"."visibleUserIds" AS "reply_visibleUserIds", "reply"."mentions" AS "reply_mentions", "reply"."mentionedRemoteUsers" AS "reply_mentionedRemoteUsers", "reply"."emojis" AS "reply_emojis", "reply"."tags" AS "reply_tags", "reply"."hasPoll" AS "reply_hasPoll", "reply"."channelId" AS "reply_channelId", "reply"."userHost" AS "reply_userHost", "reply"."replyUserId" AS "reply_replyUserId", "reply"."replyUserHost" AS "reply_replyUserHost", "reply"."renoteUserId" AS "reply_renoteUserId", "reply"."renoteUserHost" AS "reply_renoteUserHost", "renote"."id" AS "renote_id", "renote"."createdAt" AS "renote_createdAt", "renote"."replyId" AS "renote_replyId", "renote"."renoteId" AS "renote_renoteId", "renote"."threadId" AS "renote_threadId", "renote"."text" AS "renote_text", "renote"."name" AS "renote_name", "renote"."cw" AS "renote_cw", "renote"."userId" AS "renote_userId", "renote"."localOnly" AS "renote_localOnly", "renote"."reactionAcceptance" AS "renote_reactionAcceptance", "renote"."renoteCount" AS "renote_renoteCount", "renote"."repliesCount" AS "renote_repliesCount", "renote"."reactions" AS "renote_reactions", "renote"."visibility" AS "renote_visibility", "renote"."uri" AS "renote_uri", "renote"."url" AS "renote_url", "renote"."fileIds" AS "renote_fileIds", "renote"."attachedFileTypes" AS "renote_attachedFileTypes", "renote"."visibleUserIds" AS "renote_visibleUserIds", "renote"."mentions" AS "renote_mentions", "renote"."mentionedRemoteUsers" AS "renote_mentionedRemoteUsers", "renote"."emojis" AS "renote_emojis", "renote"."tags" AS "renote_tags", "renote"."hasPoll" AS "renote_hasPoll", "renote"."channelId" AS "renote_channelId", "renote"."userHost" AS "renote_userHost", "renote"."replyUserId" AS "renote_replyUserId", "renote"."replyUserHost" AS "renote_replyUserHost", "renote"."renoteUserId" AS "renote_renoteUserId", "renote"."renoteUserHost" AS "renote_renoteUserHost", "replyUser"."id" AS "replyUser_id", "replyUser"."createdAt" AS "replyUser_createdAt", "replyUser"."updatedAt" AS "replyUser_updatedAt", "replyUser"."lastFetchedAt" AS "replyUser_lastFetchedAt", "replyUser"."lastActiveDate" AS "replyUser_lastActiveDate", "replyUser"."hideOnlineStatus" AS "replyUser_hideOnlineStatus", "replyUser"."username" AS "replyUser_username", "replyUser"."name" AS "replyUser_name", "replyUser"."followersCount" AS "replyUser_followersCount", "replyUser"."followingCount" AS "replyUser_followingCount", "replyUser"."movedToUri" AS "replyUser_movedToUri", "replyUser"."movedAt" AS "replyUser_movedAt", "replyUser"."alsoKnownAs" AS "replyUser_alsoKnownAs", "replyUser"."notesCount" AS "replyUser_notesCount", "replyUser"."avatarId" AS "replyUser_avatarId", "replyUser"."bannerId" AS "replyUser_bannerId", "replyUser"."avatarUrl" AS "replyUser_avatarUrl", "replyUser"."bannerUrl" AS "replyUser_bannerUrl", "replyUser"."avatarBlurhash" AS "replyUser_avatarBlurhash", "replyUser"."bannerBlurhash" AS "replyUser_bannerBlurhash", "replyUser"."tags" AS "replyUser_tags", "replyUser"."isSuspended" AS "replyUser_isSuspended", "replyUser"."isLocked" AS "replyUser_isLocked", "replyUser"."isBot" AS "replyUser_isBot", "replyUser"."isCat" AS "replyUser_isCat", "replyUser"."isRoot" AS "replyUser_isRoot", "replyUser"."isExplorable" AS "replyUser_isExplorable", "replyUser"."isDeleted" AS "replyUser_isDeleted", "replyUser"."emojis" AS "replyUser_emojis", "replyUser"."host" AS "replyUser_host", "replyUser"."inbox" AS "replyUser_inbox", "replyUser"."sharedInbox" AS "replyUser_sharedInbox", "replyUser"."featured" AS "replyUser_featured", "replyUser"."uri" AS "replyUser_uri", "replyUser"."followersUri" AS "replyUser_followersUri", "replyUser"."token" AS "replyUser_token", "renoteUser"."id" AS "renoteUser_id", "renoteUser"."createdAt" AS "renoteUser_createdAt", "renoteUser"."updatedAt" AS "renoteUser_updatedAt", "renoteUser"."lastFetchedAt" AS "renoteUser_lastFetchedAt", "renoteUser"."lastActiveDate" AS "renoteUser_lastActiveDate", "renoteUser"."hideOnlineStatus" AS "renoteUser_hideOnlineStatus", "renoteUser"."username" AS "renoteUser_username", "renoteUser"."name" AS "renoteUser_name", "renoteUser"."followersCount" AS "renoteUser_followersCount", "renoteUser"."followingCount" AS "renoteUser_followingCount", "renoteUser"."movedToUri" AS "renoteUser_movedToUri", "renoteUser"."movedAt" AS "renoteUser_movedAt", "renoteUser"."alsoKnownAs" AS "renoteUser_alsoKnownAs", "renoteUser"."notesCount" AS "renoteUser_notesCount", "renoteUser"."avatarId" AS "renoteUser_avatarId", "renoteUser"."bannerId" AS "renoteUser_bannerId", "renoteUser"."avatarUrl" AS "renoteUser_avatarUrl", "renoteUser"."bannerUrl" AS "renoteUser_bannerUrl", "renoteUser"."avatarBlurhash" AS "renoteUser_avatarBlurhash", "renoteUser"."bannerBlurhash" AS "renoteUser_bannerBlurhash", "renoteUser"."tags" AS "renoteUser_tags", "renoteUser"."isSuspended" AS "renoteUser_isSuspended", "renoteUser"."isLocked" AS "renoteUser_isLocked", "renoteUser"."isBot" AS "renoteUser_isBot", "renoteUser"."isCat" AS "renoteUser_isCat", "renoteUser"."isRoot" AS "renoteUser_isRoot", "renoteUser"."isExplorable" AS "renoteUser_isExplorable", "renoteUser"."isDeleted" AS "renoteUser_isDeleted", "renoteUser"."emojis" AS "renoteUser_emojis", "renoteUser"."host" AS "renoteUser_host", "renoteUser"."inbox" AS "renoteUser_inbox", "renoteUser"."sharedInbox" AS "renoteUser_sharedInbox", "renoteUser"."featured" AS "renoteUser_featured", "renoteUser"."uri" AS "renoteUser_uri", "renoteUser"."followersUri" AS "renoteUser_followersUri", "renoteUser"."token" AS "renoteUser_token" FROM "note" "note" INNER JOIN "user" "user" ON "user"."id"="note"."userId"  LEFT JOIN "note" "reply" ON "reply"."id"="note"."replyId"  LEFT JOIN "note" "renote" ON "renote"."id"="note"."renoteId"  LEFT JOIN "user" "replyUser" ON "replyUser"."id"="reply"."userId"  LEFT JOIN "user" "renoteUser" ON "renoteUser"."id"="renote"."userId" WHERE "note"."userId" = $1 AND (("note"."visibility" = $26 OR "note"."visibility" = $27) OR "note"."userId" = $2 OR $3 = ANY("note"."visibleUserIds") OR $4 = ANY("note"."mentions") OR ("note"."visibility" = $28 AND ("note"."userId" IN (SELECT "following"."followeeId" AS "following_followeeId" FROM "following" "following" WHERE "following"."followerId" = $5) OR "note"."replyUserId" = $6))) AND "note"."userId" NOT IN (SELECT "muting"."muteeId" AS "muting_muteeId" FROM "muting" "muting" WHERE "muting"."muterId" = $7 AND "muting"."muteeId" != $8) AND ("note"."replyUserId" IS NULL OR "note"."replyUserId" NOT IN (SELECT "muting"."muteeId" AS "muting_muteeId" FROM "muting" "muting" WHERE "muting"."muterId" = $9 AND "muting"."muteeId" != $10)) AND ("note"."renoteUserId" IS NULL OR "note"."renoteUserId" NOT IN (SELECT "muting"."muteeId" AS "muting_muteeId" FROM "muting" "muting" WHERE "muting"."muterId" = $11 AND "muting"."muteeId" != $12)) AND ("note"."userHost" IS NULL OR NOT ((SELECT "user_profile"."mutedInstances" AS "user_profile_mutedInstances" FROM "user_profile" "user_profile" WHERE "user_profile"."userId" = $13)::jsonb ? "note"."userHost")) AND ("note"."replyUserHost" IS NULL OR NOT ((SELECT "user_profile"."mutedInstances" AS "user_profile_mutedInstances" FROM "user_profile" "user_profile" WHERE "user_profile"."userId" = $14)::jsonb ? "note"."replyUserHost")) AND ("note"."renoteUserHost" IS NULL OR NOT ((SELECT "user_profile"."mutedInstances" AS "user_profile_mutedInstances" FROM "user_profile" "user_profile" WHERE "user_profile"."userId" = $15)::jsonb ? "note"."renoteUserHost")) AND "note"."userId" NOT IN (SELECT "blocking"."blockerId" AS "blocking_blockerId" FROM "blocking" "blocking" WHERE "blocking"."blockeeId" = $16) AND ("note"."replyUserId" IS NULL OR "note"."replyUserId" NOT IN (SELECT "blocking"."blockerId" AS "blocking_blockerId" FROM "blocking" "blocking" WHERE "blocking"."blockeeId" = $17)) AND ("note"."renoteUserId" IS NULL OR "note"."renoteUserId" NOT IN (SELECT "blocking"."blockerId" AS "blocking_blockerId" FROM "blocking" "blocking" WHERE "blocking"."blockeeId" = $18)) AND "note"."fileIds" != $29 AND ($19 = ANY("note"."attachedFileTypes") OR $20 = ANY("note"."attachedFileTypes") OR $21 = ANY("note"."attachedFileTypes") OR $22 = ANY("note"."attachedFileTypes") OR $23 = ANY("note"."attachedFileTypes") OR $24 = ANY("note"."attachedFileTypes") OR $25 = ANY("note"."attachedFileTypes")) AND "note"."cw" IS NULL AND $30 = (SELECT COUNT(*) FROM drive_file df WHERE df.id = ANY(note."fileIds") AND df."isSensitive" = $31)) "distinctAlias" ORDER BY "distinctAlias"."note_id" DESC, "note_id" ASC LIMIT $32 | 0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 11438 | 2843098.093984020 | 0.01945 | 7855.261708 | 248.5660162601850 | 547.1887165416280 | 81943 | 48143287 | 12225075 | 1688 | 5421 | 0 | 0 | 0 | 0 | 0 | 0 | 0.0 | 0.0 | 0.0 | 0.0 | 1817 | 1218 | 8952442 | 197709 | 31733.600407000000 | 2 | 375.01095700000000 | 1330 | 19569.19963200000 | 1330 | 197942.18525700000


userid	dbid	toplevel	queryid	query	plans	total_plan_time	min_plan_time	max_plan_time	mean_plan_time	stddev_plan_time	calls	total_exec_time	min_exec_time	max_exec_time	mean_exec_time	stddev_exec_time	rows	shared_blks_hit	shared_blks_read	shared_blks_dirtied	shared_blks_written	local_blks_hit	local_blks_read	local_blks_dirtied	local_blks_written	temp_blks_read	temp_blks_written	blk_read_time	blk_write_time	temp_blk_read_time	temp_blk_write_time	wal_records	wal_fpi	wal_bytes	jit_functions	jit_generation_time	jit_inlining_count	jit_inlining_time	jit_optimization_count	jit_optimization_time	jit_emission_count	jit_emission_time
16822	16426	TRUE	-5599249229748355469	SELECT DISTINCT "distinctAlias"."note_id" AS "ids_note_id", "distinctAlias"."note_id" FROM (SELECT "note"."id" AS "note_id", "note"."createdAt" AS "note_createdAt", "note"."replyId" AS "note_replyId", "note"."renoteId" AS "note_renoteId", "note"."threadId" AS "note_threadId", "note"."text" AS "note_text", "note"."name" AS "note_name", "note"."cw" AS "note_cw", "note"."userId" AS "note_userId", "note"."localOnly" AS "note_localOnly", "note"."reactionAcceptance" AS "note_reactionAcceptance", "note"."renoteCount" AS "note_renoteCount", "note"."repliesCount" AS "note_repliesCount", "note"."reactions" AS "note_reactions", "note"."visibility" AS "note_visibility", "note"."uri" AS "note_uri", "note"."url" AS "note_url", "note"."fileIds" AS "note_fileIds", "note"."attachedFileTypes" AS "note_attachedFileTypes", "note"."visibleUserIds" AS "note_visibleUserIds", "note"."mentions" AS "note_mentions", "note"."mentionedRemoteUsers" AS "note_mentionedRemoteUsers", "note"."emojis" AS "note_emojis", "note"."tags" AS "note_tags", "note"."hasPoll" AS "note_hasPoll", "note"."channelId" AS "note_channelId", "note"."userHost" AS "note_userHost", "note"."replyUserId" AS "note_replyUserId", "note"."replyUserHost" AS "note_replyUserHost", "note"."renoteUserId" AS "note_renoteUserId", "note"."renoteUserHost" AS "note_renoteUserHost", "user"."id" AS "user_id", "user"."createdAt" AS "user_createdAt", "user"."updatedAt" AS "user_updatedAt", "user"."lastFetchedAt" AS "user_lastFetchedAt", "user"."lastActiveDate" AS "user_lastActiveDate", "user"."hideOnlineStatus" AS "user_hideOnlineStatus", "user"."username" AS "user_username", "user"."name" AS "user_name", "user"."followersCount" AS "user_followersCount", "user"."followingCount" AS "user_followingCount", "user"."movedToUri" AS "user_movedToUri", "user"."movedAt" AS "user_movedAt", "user"."alsoKnownAs" AS "user_alsoKnownAs", "user"."notesCount" AS "user_notesCount", "user"."avatarId" AS "user_avatarId", "user"."bannerId" AS "user_bannerId", "user"."avatarUrl" AS "user_avatarUrl", "user"."bannerUrl" AS "user_bannerUrl", "user"."avatarBlurhash" AS "user_avatarBlurhash", "user"."bannerBlurhash" AS "user_bannerBlurhash", "user"."tags" AS "user_tags", "user"."isSuspended" AS "user_isSuspended", "user"."isLocked" AS "user_isLocked", "user"."isBot" AS "user_isBot", "user"."isCat" AS "user_isCat", "user"."isRoot" AS "user_isRoot", "user"."isExplorable" AS "user_isExplorable", "user"."isDeleted" AS "user_isDeleted", "user"."emojis" AS "user_emojis", "user"."host" AS "user_host", "user"."inbox" AS "user_inbox", "user"."sharedInbox" AS "user_sharedInbox", "user"."featured" AS "user_featured", "user"."uri" AS "user_uri", "user"."followersUri" AS "user_followersUri", "user"."token" AS "user_token", "reply"."id" AS "reply_id", "reply"."createdAt" AS "reply_createdAt", "reply"."replyId" AS "reply_replyId", "reply"."renoteId" AS "reply_renoteId", "reply"."threadId" AS "reply_threadId", "reply"."text" AS "reply_text", "reply"."name" AS "reply_name", "reply"."cw" AS "reply_cw", "reply"."userId" AS "reply_userId", "reply"."localOnly" AS "reply_localOnly", "reply"."reactionAcceptance" AS "reply_reactionAcceptance", "reply"."renoteCount" AS "reply_renoteCount", "reply"."repliesCount" AS "reply_repliesCount", "reply"."reactions" AS "reply_reactions", "reply"."visibility" AS "reply_visibility", "reply"."uri" AS "reply_uri", "reply"."url" AS "reply_url", "reply"."fileIds" AS "reply_fileIds", "reply"."attachedFileTypes" AS "reply_attachedFileTypes", "reply"."visibleUserIds" AS "reply_visibleUserIds", "reply"."mentions" AS "reply_mentions", "reply"."mentionedRemoteUsers" AS "reply_mentionedRemoteUsers", "reply"."emojis" AS "reply_emojis", "reply"."tags" AS "reply_tags", "reply"."hasPoll" AS "reply_hasPoll", "reply"."channelId" AS "reply_channelId", "reply"."userHost" AS "reply_userHost", "reply"."replyUserId" AS "reply_replyUserId", "reply"."replyUserHost" AS "reply_replyUserHost", "reply"."renoteUserId" AS "reply_renoteUserId", "reply"."renoteUserHost" AS "reply_renoteUserHost", "renote"."id" AS "renote_id", "renote"."createdAt" AS "renote_createdAt", "renote"."replyId" AS "renote_replyId", "renote"."renoteId" AS "renote_renoteId", "renote"."threadId" AS "renote_threadId", "renote"."text" AS "renote_text", "renote"."name" AS "renote_name", "renote"."cw" AS "renote_cw", "renote"."userId" AS "renote_userId", "renote"."localOnly" AS "renote_localOnly", "renote"."reactionAcceptance" AS "renote_reactionAcceptance", "renote"."renoteCount" AS "renote_renoteCount", "renote"."repliesCount" AS "renote_repliesCount", "renote"."reactions" AS "renote_reactions", "renote"."visibility" AS "renote_visibility", "renote"."uri" AS "renote_uri", "renote"."url" AS "renote_url", "renote"."fileIds" AS "renote_fileIds", "renote"."attachedFileTypes" AS "renote_attachedFileTypes", "renote"."visibleUserIds" AS "renote_visibleUserIds", "renote"."mentions" AS "renote_mentions", "renote"."mentionedRemoteUsers" AS "renote_mentionedRemoteUsers", "renote"."emojis" AS "renote_emojis", "renote"."tags" AS "renote_tags", "renote"."hasPoll" AS "renote_hasPoll", "renote"."channelId" AS "renote_channelId", "renote"."userHost" AS "renote_userHost", "renote"."replyUserId" AS "renote_replyUserId", "renote"."replyUserHost" AS "renote_replyUserHost", "renote"."renoteUserId" AS "renote_renoteUserId", "renote"."renoteUserHost" AS "renote_renoteUserHost", "replyUser"."id" AS "replyUser_id", "replyUser"."createdAt" AS "replyUser_createdAt", "replyUser"."updatedAt" AS "replyUser_updatedAt", "replyUser"."lastFetchedAt" AS "replyUser_lastFetchedAt", "replyUser"."lastActiveDate" AS "replyUser_lastActiveDate", "replyUser"."hideOnlineStatus" AS "replyUser_hideOnlineStatus", "replyUser"."username" AS "replyUser_username", "replyUser"."name" AS "replyUser_name", "replyUser"."followersCount" AS "replyUser_followersCount", "replyUser"."followingCount" AS "replyUser_followingCount", "replyUser"."movedToUri" AS "replyUser_movedToUri", "replyUser"."movedAt" AS "replyUser_movedAt", "replyUser"."alsoKnownAs" AS "replyUser_alsoKnownAs", "replyUser"."notesCount" AS "replyUser_notesCount", "replyUser"."avatarId" AS "replyUser_avatarId", "replyUser"."bannerId" AS "replyUser_bannerId", "replyUser"."avatarUrl" AS "replyUser_avatarUrl", "replyUser"."bannerUrl" AS "replyUser_bannerUrl", "replyUser"."avatarBlurhash" AS "replyUser_avatarBlurhash", "replyUser"."bannerBlurhash" AS "replyUser_bannerBlurhash", "replyUser"."tags" AS "replyUser_tags", "replyUser"."isSuspended" AS "replyUser_isSuspended", "replyUser"."isLocked" AS "replyUser_isLocked", "replyUser"."isBot" AS "replyUser_isBot", "replyUser"."isCat" AS "replyUser_isCat", "replyUser"."isRoot" AS "replyUser_isRoot", "replyUser"."isExplorable" AS "replyUser_isExplorable", "replyUser"."isDeleted" AS "replyUser_isDeleted", "replyUser"."emojis" AS "replyUser_emojis", "replyUser"."host" AS "replyUser_host", "replyUser"."inbox" AS "replyUser_inbox", "replyUser"."sharedInbox" AS "replyUser_sharedInbox", "replyUser"."featured" AS "replyUser_featured", "replyUser"."uri" AS "replyUser_uri", "replyUser"."followersUri" AS "replyUser_followersUri", "replyUser"."token" AS "replyUser_token", "renoteUser"."id" AS "renoteUser_id", "renoteUser"."createdAt" AS "renoteUser_createdAt", "renoteUser"."updatedAt" AS "renoteUser_updatedAt", "renoteUser"."lastFetchedAt" AS "renoteUser_lastFetchedAt", "renoteUser"."lastActiveDate" AS "renoteUser_lastActiveDate", "renoteUser"."hideOnlineStatus" AS "renoteUser_hideOnlineStatus", "renoteUser"."username" AS "renoteUser_username", "renoteUser"."name" AS "renoteUser_name", "renoteUser"."followersCount" AS "renoteUser_followersCount", "renoteUser"."followingCount" AS "renoteUser_followingCount", "renoteUser"."movedToUri" AS "renoteUser_movedToUri", "renoteUser"."movedAt" AS "renoteUser_movedAt", "renoteUser"."alsoKnownAs" AS "renoteUser_alsoKnownAs", "renoteUser"."notesCount" AS "renoteUser_notesCount", "renoteUser"."avatarId" AS "renoteUser_avatarId", "renoteUser"."bannerId" AS "renoteUser_bannerId", "renoteUser"."avatarUrl" AS "renoteUser_avatarUrl", "renoteUser"."bannerUrl" AS "renoteUser_bannerUrl", "renoteUser"."avatarBlurhash" AS "renoteUser_avatarBlurhash", "renoteUser"."bannerBlurhash" AS "renoteUser_bannerBlurhash", "renoteUser"."tags" AS "renoteUser_tags", "renoteUser"."isSuspended" AS "renoteUser_isSuspended", "renoteUser"."isLocked" AS "renoteUser_isLocked", "renoteUser"."isBot" AS "renoteUser_isBot", "renoteUser"."isCat" AS "renoteUser_isCat", "renoteUser"."isRoot" AS "renoteUser_isRoot", "renoteUser"."isExplorable" AS "renoteUser_isExplorable", "renoteUser"."isDeleted" AS "renoteUser_isDeleted", "renoteUser"."emojis" AS "renoteUser_emojis", "renoteUser"."host" AS "renoteUser_host", "renoteUser"."inbox" AS "renoteUser_inbox", "renoteUser"."sharedInbox" AS "renoteUser_sharedInbox", "renoteUser"."featured" AS "renoteUser_featured", "renoteUser"."uri" AS "renoteUser_uri", "renoteUser"."followersUri" AS "renoteUser_followersUri", "renoteUser"."token" AS "renoteUser_token" FROM "note" "note" INNER JOIN "user" "user" ON "user"."id"="note"."userId"  LEFT JOIN "note" "reply" ON "reply"."id"="note"."replyId"  LEFT JOIN "note" "renote" ON "renote"."id"="note"."renoteId"  LEFT JOIN "user" "replyUser" ON "replyUser"."id"="reply"."userId"  LEFT JOIN "user" "renoteUser" ON "renoteUser"."id"="renote"."userId" WHERE "note"."id" < $1 AND "note"."userId" = $2 AND ("note"."visibility" = $3 OR "note"."visibility" = $4)) "distinctAlias" ORDER BY "distinctAlias"."note_id" DESC, "note_id" ASC LIMIT $5	0	0.0	0.0	0.0	0.0	0.0	835	195447.5877150000	0.048698	60334.023031000000	234.06896732335300	2602.273461907280	15726	17317624	1163440	1039	69	0	0	0	0	0	0	0.0	0.0	0.0	0.0	1098	918	6695730	0	0.0	0	0.0	0	0.0	0	0.0
16822	16426	TRUE	6047802554448485168	SELECT DISTINCT "distinctAlias"."note_id" AS "ids_note_id", "distinctAlias"."note_id" FROM (SELECT "note"."id" AS "note_id", "note"."createdAt" AS "note_createdAt", "note"."replyId" AS "note_replyId", "note"."renoteId" AS "note_renoteId", "note"."threadId" AS "note_threadId", "note"."text" AS "note_text", "note"."name" AS "note_name", "note"."cw" AS "note_cw", "note"."userId" AS "note_userId", "note"."localOnly" AS "note_localOnly", "note"."reactionAcceptance" AS "note_reactionAcceptance", "note"."renoteCount" AS "note_renoteCount", "note"."repliesCount" AS "note_repliesCount", "note"."reactions" AS "note_reactions", "note"."visibility" AS "note_visibility", "note"."uri" AS "note_uri", "note"."url" AS "note_url", "note"."fileIds" AS "note_fileIds", "note"."attachedFileTypes" AS "note_attachedFileTypes", "note"."visibleUserIds" AS "note_visibleUserIds", "note"."mentions" AS "note_mentions", "note"."mentionedRemoteUsers" AS "note_mentionedRemoteUsers", "note"."emojis" AS "note_emojis", "note"."tags" AS "note_tags", "note"."hasPoll" AS "note_hasPoll", "note"."channelId" AS "note_channelId", "note"."userHost" AS "note_userHost", "note"."replyUserId" AS "note_replyUserId", "note"."replyUserHost" AS "note_replyUserHost", "note"."renoteUserId" AS "note_renoteUserId", "note"."renoteUserHost" AS "note_renoteUserHost", "user"."id" AS "user_id", "user"."createdAt" AS "user_createdAt", "user"."updatedAt" AS "user_updatedAt", "user"."lastFetchedAt" AS "user_lastFetchedAt", "user"."lastActiveDate" AS "user_lastActiveDate", "user"."hideOnlineStatus" AS "user_hideOnlineStatus", "user"."username" AS "user_username", "user"."name" AS "user_name", "user"."followersCount" AS "user_followersCount", "user"."followingCount" AS "user_followingCount", "user"."movedToUri" AS "user_movedToUri", "user"."movedAt" AS "user_movedAt", "user"."alsoKnownAs" AS "user_alsoKnownAs", "user"."notesCount" AS "user_notesCount", "user"."avatarId" AS "user_avatarId", "user"."bannerId" AS "user_bannerId", "user"."avatarUrl" AS "user_avatarUrl", "user"."bannerUrl" AS "user_bannerUrl", "user"."avatarBlurhash" AS "user_avatarBlurhash", "user"."bannerBlurhash" AS "user_bannerBlurhash", "user"."tags" AS "user_tags", "user"."isSuspended" AS "user_isSuspended", "user"."isLocked" AS "user_isLocked", "user"."isBot" AS "user_isBot", "user"."isCat" AS "user_isCat", "user"."isRoot" AS "user_isRoot", "user"."isExplorable" AS "user_isExplorable", "user"."isDeleted" AS "user_isDeleted", "user"."emojis" AS "user_emojis", "user"."host" AS "user_host", "user"."inbox" AS "user_inbox", "user"."sharedInbox" AS "user_sharedInbox", "user"."featured" AS "user_featured", "user"."uri" AS "user_uri", "user"."followersUri" AS "user_followersUri", "user"."token" AS "user_token", "reply"."id" AS "reply_id", "reply"."createdAt" AS "reply_createdAt", "reply"."replyId" AS "reply_replyId", "reply"."renoteId" AS "reply_renoteId", "reply"."threadId" AS "reply_threadId", "reply"."text" AS "reply_text", "reply"."name" AS "reply_name", "reply"."cw" AS "reply_cw", "reply"."userId" AS "reply_userId", "reply"."localOnly" AS "reply_localOnly", "reply"."reactionAcceptance" AS "reply_reactionAcceptance", "reply"."renoteCount" AS "reply_renoteCount", "reply"."repliesCount" AS "reply_repliesCount", "reply"."reactions" AS "reply_reactions", "reply"."visibility" AS "reply_visibility", "reply"."uri" AS "reply_uri", "reply"."url" AS "reply_url", "reply"."fileIds" AS "reply_fileIds", "reply"."attachedFileTypes" AS "reply_attachedFileTypes", "reply"."visibleUserIds" AS "reply_visibleUserIds", "reply"."mentions" AS "reply_mentions", "reply"."mentionedRemoteUsers" AS "reply_mentionedRemoteUsers", "reply"."emojis" AS "reply_emojis", "reply"."tags" AS "reply_tags", "reply"."hasPoll" AS "reply_hasPoll", "reply"."channelId" AS "reply_channelId", "reply"."userHost" AS "reply_userHost", "reply"."replyUserId" AS "reply_replyUserId", "reply"."replyUserHost" AS "reply_replyUserHost", "reply"."renoteUserId" AS "reply_renoteUserId", "reply"."renoteUserHost" AS "reply_renoteUserHost", "renote"."id" AS "renote_id", "renote"."createdAt" AS "renote_createdAt", "renote"."replyId" AS "renote_replyId", "renote"."renoteId" AS "renote_renoteId", "renote"."threadId" AS "renote_threadId", "renote"."text" AS "renote_text", "renote"."name" AS "renote_name", "renote"."cw" AS "renote_cw", "renote"."userId" AS "renote_userId", "renote"."localOnly" AS "renote_localOnly", "renote"."reactionAcceptance" AS "renote_reactionAcceptance", "renote"."renoteCount" AS "renote_renoteCount", "renote"."repliesCount" AS "renote_repliesCount", "renote"."reactions" AS "renote_reactions", "renote"."visibility" AS "renote_visibility", "renote"."uri" AS "renote_uri", "renote"."url" AS "renote_url", "renote"."fileIds" AS "renote_fileIds", "renote"."attachedFileTypes" AS "renote_attachedFileTypes", "renote"."visibleUserIds" AS "renote_visibleUserIds", "renote"."mentions" AS "renote_mentions", "renote"."mentionedRemoteUsers" AS "renote_mentionedRemoteUsers", "renote"."emojis" AS "renote_emojis", "renote"."tags" AS "renote_tags", "renote"."hasPoll" AS "renote_hasPoll", "renote"."channelId" AS "renote_channelId", "renote"."userHost" AS "renote_userHost", "renote"."replyUserId" AS "renote_replyUserId", "renote"."replyUserHost" AS "renote_replyUserHost", "renote"."renoteUserId" AS "renote_renoteUserId", "renote"."renoteUserHost" AS "renote_renoteUserHost", "replyUser"."id" AS "replyUser_id", "replyUser"."createdAt" AS "replyUser_createdAt", "replyUser"."updatedAt" AS "replyUser_updatedAt", "replyUser"."lastFetchedAt" AS "replyUser_lastFetchedAt", "replyUser"."lastActiveDate" AS "replyUser_lastActiveDate", "replyUser"."hideOnlineStatus" AS "replyUser_hideOnlineStatus", "replyUser"."username" AS "replyUser_username", "replyUser"."name" AS "replyUser_name", "replyUser"."followersCount" AS "replyUser_followersCount", "replyUser"."followingCount" AS "replyUser_followingCount", "replyUser"."movedToUri" AS "replyUser_movedToUri", "replyUser"."movedAt" AS "replyUser_movedAt", "replyUser"."alsoKnownAs" AS "replyUser_alsoKnownAs", "replyUser"."notesCount" AS "replyUser_notesCount", "replyUser"."avatarId" AS "replyUser_avatarId", "replyUser"."bannerId" AS "replyUser_bannerId", "replyUser"."avatarUrl" AS "replyUser_avatarUrl", "replyUser"."bannerUrl" AS "replyUser_bannerUrl", "replyUser"."avatarBlurhash" AS "replyUser_avatarBlurhash", "replyUser"."bannerBlurhash" AS "replyUser_bannerBlurhash", "replyUser"."tags" AS "replyUser_tags", "replyUser"."isSuspended" AS "replyUser_isSuspended", "replyUser"."isLocked" AS "replyUser_isLocked", "replyUser"."isBot" AS "replyUser_isBot", "replyUser"."isCat" AS "replyUser_isCat", "replyUser"."isRoot" AS "replyUser_isRoot", "replyUser"."isExplorable" AS "replyUser_isExplorable", "replyUser"."isDeleted" AS "replyUser_isDeleted", "replyUser"."emojis" AS "replyUser_emojis", "replyUser"."host" AS "replyUser_host", "replyUser"."inbox" AS "replyUser_inbox", "replyUser"."sharedInbox" AS "replyUser_sharedInbox", "replyUser"."featured" AS "replyUser_featured", "replyUser"."uri" AS "replyUser_uri", "replyUser"."followersUri" AS "replyUser_followersUri", "replyUser"."token" AS "replyUser_token", "renoteUser"."id" AS "renoteUser_id", "renoteUser"."createdAt" AS "renoteUser_createdAt", "renoteUser"."updatedAt" AS "renoteUser_updatedAt", "renoteUser"."lastFetchedAt" AS "renoteUser_lastFetchedAt", "renoteUser"."lastActiveDate" AS "renoteUser_lastActiveDate", "renoteUser"."hideOnlineStatus" AS "renoteUser_hideOnlineStatus", "renoteUser"."username" AS "renoteUser_username", "renoteUser"."name" AS "renoteUser_name", "renoteUser"."followersCount" AS "renoteUser_followersCount", "renoteUser"."followingCount" AS "renoteUser_followingCount", "renoteUser"."movedToUri" AS "renoteUser_movedToUri", "renoteUser"."movedAt" AS "renoteUser_movedAt", "renoteUser"."alsoKnownAs" AS "renoteUser_alsoKnownAs", "renoteUser"."notesCount" AS "renoteUser_notesCount", "renoteUser"."avatarId" AS "renoteUser_avatarId", "renoteUser"."bannerId" AS "renoteUser_bannerId", "renoteUser"."avatarUrl" AS "renoteUser_avatarUrl", "renoteUser"."bannerUrl" AS "renoteUser_bannerUrl", "renoteUser"."avatarBlurhash" AS "renoteUser_avatarBlurhash", "renoteUser"."bannerBlurhash" AS "renoteUser_bannerBlurhash", "renoteUser"."tags" AS "renoteUser_tags", "renoteUser"."isSuspended" AS "renoteUser_isSuspended", "renoteUser"."isLocked" AS "renoteUser_isLocked", "renoteUser"."isBot" AS "renoteUser_isBot", "renoteUser"."isCat" AS "renoteUser_isCat", "renoteUser"."isRoot" AS "renoteUser_isRoot", "renoteUser"."isExplorable" AS "renoteUser_isExplorable", "renoteUser"."isDeleted" AS "renoteUser_isDeleted", "renoteUser"."emojis" AS "renoteUser_emojis", "renoteUser"."host" AS "renoteUser_host", "renoteUser"."inbox" AS "renoteUser_inbox", "renoteUser"."sharedInbox" AS "renoteUser_sharedInbox", "renoteUser"."featured" AS "renoteUser_featured", "renoteUser"."uri" AS "renoteUser_uri", "renoteUser"."followersUri" AS "renoteUser_followersUri", "renoteUser"."token" AS "renoteUser_token" FROM "note" "note" INNER JOIN "user_list_joining" "userListJoining" ON "userListJoining"."userId" = "note"."userId"  INNER JOIN "user" "user" ON "user"."id"="note"."userId"  LEFT JOIN "note" "reply" ON "reply"."id"="note"."replyId"  LEFT JOIN "note" "renote" ON "renote"."id"="note"."renoteId"  LEFT JOIN "user" "replyUser" ON "replyUser"."id"="reply"."userId"  LEFT JOIN "user" "renoteUser" ON "renoteUser"."id"="renote"."userId" WHERE "userListJoining"."userListId" = $1 AND (("note"."visibility" = $7 OR "note"."visibility" = $8) OR "note"."userId" = $2 OR $3 = ANY("note"."visibleUserIds") OR $4 = ANY("note"."mentions") OR ("note"."visibility" = $9 AND ("note"."userId" IN (SELECT "following"."followeeId" AS "following_followeeId" FROM "following" "following" WHERE "following"."followerId" = $5) OR "note"."replyUserId" = $6)))) "distinctAlias" ORDER BY "distinctAlias"."note_id" DESC, "note_id" ASC LIMIT $10	0	0.0	0.0	0.0	0.0	0.0	2405	1155895.4092980000	0.03266	47591.22705	480.6217918079010	1349.8401904937000	24362	24448039	7372857	1662	5848	0	0	0	0	0	0	0.0	0.0	0.0	0.0	2518	1435	10378057	0	0.0	0	0.0	0	0.0	0	0.0
16822	16426	TRUE	-4295012842788197408	SELECT DISTINCT "distinctAlias"."reaction_id" AS "ids_reaction_id", "distinctAlias"."reaction_id" FROM (SELECT "reaction"."id" AS "reaction_id", "reaction"."createdAt" AS "reaction_createdAt", "reaction"."userId" AS "reaction_userId", "reaction"."noteId" AS "reaction_noteId", "reaction"."reaction" AS "reaction_reaction", "note"."id" AS "note_id", "note"."createdAt" AS "note_createdAt", "note"."replyId" AS "note_replyId", "note"."renoteId" AS "note_renoteId", "note"."threadId" AS "note_threadId", "note"."text" AS "note_text", "note"."name" AS "note_name", "note"."cw" AS "note_cw", "note"."userId" AS "note_userId", "note"."localOnly" AS "note_localOnly", "note"."reactionAcceptance" AS "note_reactionAcceptance", "note"."renoteCount" AS "note_renoteCount", "note"."repliesCount" AS "note_repliesCount", "note"."reactions" AS "note_reactions", "note"."visibility" AS "note_visibility", "note"."uri" AS "note_uri", "note"."url" AS "note_url", "note"."fileIds" AS "note_fileIds", "note"."attachedFileTypes" AS "note_attachedFileTypes", "note"."visibleUserIds" AS "note_visibleUserIds", "note"."mentions" AS "note_mentions", "note"."mentionedRemoteUsers" AS "note_mentionedRemoteUsers", "note"."emojis" AS "note_emojis", "note"."tags" AS "note_tags", "note"."hasPoll" AS "note_hasPoll", "note"."channelId" AS "note_channelId", "note"."userHost" AS "note_userHost", "note"."replyUserId" AS "note_replyUserId", "note"."replyUserHost" AS "note_replyUserHost", "note"."renoteUserId" AS "note_renoteUserId", "note"."renoteUserHost" AS "note_renoteUserHost" FROM "note_reaction" "reaction" LEFT JOIN "note" "note" ON "note"."id"="reaction"."noteId" WHERE "reaction"."userId" = $1 AND ("note"."visibility" = $2 OR "note"."visibility" = $3)) "distinctAlias" ORDER BY "distinctAlias"."reaction_id" DESC, "reaction_id" ASC LIMIT $4	0	0.0	0.0	0.0	0.0	0.0	38	109068.08901100000	1.266135	37117.411897	2870.212868710530	7575.171793860580	660	36941666	794634	2714	465	0	0	0	0	0	0	0.0	0.0	0.0	0.0	2560	2485	18471909	0	0.0	0	0.0	0	0.0	0	0.0
16822	16426	TRUE	-1765600823722344336	SELECT DISTINCT "distinctAlias"."note_id" AS "ids_note_id", "distinctAlias"."note_id" FROM (SELECT "note"."id" AS "note_id", "note"."createdAt" AS "note_createdAt", "note"."replyId" AS "note_replyId", "note"."renoteId" AS "note_renoteId", "note"."threadId" AS "note_threadId", "note"."text" AS "note_text", "note"."name" AS "note_name", "note"."cw" AS "note_cw", "note"."userId" AS "note_userId", "note"."localOnly" AS "note_localOnly", "note"."reactionAcceptance" AS "note_reactionAcceptance", "note"."renoteCount" AS "note_renoteCount", "note"."repliesCount" AS "note_repliesCount", "note"."reactions" AS "note_reactions", "note"."visibility" AS "note_visibility", "note"."uri" AS "note_uri", "note"."url" AS "note_url", "note"."fileIds" AS "note_fileIds", "note"."attachedFileTypes" AS "note_attachedFileTypes", "note"."visibleUserIds" AS "note_visibleUserIds", "note"."mentions" AS "note_mentions", "note"."mentionedRemoteUsers" AS "note_mentionedRemoteUsers", "note"."emojis" AS "note_emojis", "note"."tags" AS "note_tags", "note"."hasPoll" AS "note_hasPoll", "note"."channelId" AS "note_channelId", "note"."userHost" AS "note_userHost", "note"."replyUserId" AS "note_replyUserId", "note"."replyUserHost" AS "note_replyUserHost", "note"."renoteUserId" AS "note_renoteUserId", "note"."renoteUserHost" AS "note_renoteUserHost", "user"."id" AS "user_id", "user"."createdAt" AS "user_createdAt", "user"."updatedAt" AS "user_updatedAt", "user"."lastFetchedAt" AS "user_lastFetchedAt", "user"."lastActiveDate" AS "user_lastActiveDate", "user"."hideOnlineStatus" AS "user_hideOnlineStatus", "user"."username" AS "user_username", "user"."name" AS "user_name", "user"."followersCount" AS "user_followersCount", "user"."followingCount" AS "user_followingCount", "user"."movedToUri" AS "user_movedToUri", "user"."movedAt" AS "user_movedAt", "user"."alsoKnownAs" AS "user_alsoKnownAs", "user"."notesCount" AS "user_notesCount", "user"."avatarId" AS "user_avatarId", "user"."bannerId" AS "user_bannerId", "user"."avatarUrl" AS "user_avatarUrl", "user"."bannerUrl" AS "user_bannerUrl", "user"."avatarBlurhash" AS "user_avatarBlurhash", "user"."bannerBlurhash" AS "user_bannerBlurhash", "user"."tags" AS "user_tags", "user"."isSuspended" AS "user_isSuspended", "user"."isLocked" AS "user_isLocked", "user"."isBot" AS "user_isBot", "user"."isCat" AS "user_isCat", "user"."isRoot" AS "user_isRoot", "user"."isExplorable" AS "user_isExplorable", "user"."isDeleted" AS "user_isDeleted", "user"."emojis" AS "user_emojis", "user"."host" AS "user_host", "user"."inbox" AS "user_inbox", "user"."sharedInbox" AS "user_sharedInbox", "user"."featured" AS "user_featured", "user"."uri" AS "user_uri", "user"."followersUri" AS "user_followersUri", "user"."token" AS "user_token", "reply"."id" AS "reply_id", "reply"."createdAt" AS "reply_createdAt", "reply"."replyId" AS "reply_replyId", "reply"."renoteId" AS "reply_renoteId", "reply"."threadId" AS "reply_threadId", "reply"."text" AS "reply_text", "reply"."name" AS "reply_name", "reply"."cw" AS "reply_cw", "reply"."userId" AS "reply_userId", "reply"."localOnly" AS "reply_localOnly", "reply"."reactionAcceptance" AS "reply_reactionAcceptance", "reply"."renoteCount" AS "reply_renoteCount", "reply"."repliesCount" AS "reply_repliesCount", "reply"."reactions" AS "reply_reactions", "reply"."visibility" AS "reply_visibility", "reply"."uri" AS "reply_uri", "reply"."url" AS "reply_url", "reply"."fileIds" AS "reply_fileIds", "reply"."attachedFileTypes" AS "reply_attachedFileTypes", "reply"."visibleUserIds" AS "reply_visibleUserIds", "reply"."mentions" AS "reply_mentions", "reply"."mentionedRemoteUsers" AS "reply_mentionedRemoteUsers", "reply"."emojis" AS "reply_emojis", "reply"."tags" AS "reply_tags", "reply"."hasPoll" AS "reply_hasPoll", "reply"."channelId" AS "reply_channelId", "reply"."userHost" AS "reply_userHost", "reply"."replyUserId" AS "reply_replyUserId", "reply"."replyUserHost" AS "reply_replyUserHost", "reply"."renoteUserId" AS "reply_renoteUserId", "reply"."renoteUserHost" AS "reply_renoteUserHost", "renote"."id" AS "renote_id", "renote"."createdAt" AS "renote_createdAt", "renote"."replyId" AS "renote_replyId", "renote"."renoteId" AS "renote_renoteId", "renote"."threadId" AS "renote_threadId", "renote"."text" AS "renote_text", "renote"."name" AS "renote_name", "renote"."cw" AS "renote_cw", "renote"."userId" AS "renote_userId", "renote"."localOnly" AS "renote_localOnly", "renote"."reactionAcceptance" AS "renote_reactionAcceptance", "renote"."renoteCount" AS "renote_renoteCount", "renote"."repliesCount" AS "renote_repliesCount", "renote"."reactions" AS "renote_reactions", "renote"."visibility" AS "renote_visibility", "renote"."uri" AS "renote_uri", "renote"."url" AS "renote_url", "renote"."fileIds" AS "renote_fileIds", "renote"."attachedFileTypes" AS "renote_attachedFileTypes", "renote"."visibleUserIds" AS "renote_visibleUserIds", "renote"."mentions" AS "renote_mentions", "renote"."mentionedRemoteUsers" AS "renote_mentionedRemoteUsers", "renote"."emojis" AS "renote_emojis", "renote"."tags" AS "renote_tags", "renote"."hasPoll" AS "renote_hasPoll", "renote"."channelId" AS "renote_channelId", "renote"."userHost" AS "renote_userHost", "renote"."replyUserId" AS "renote_replyUserId", "renote"."replyUserHost" AS "renote_replyUserHost", "renote"."renoteUserId" AS "renote_renoteUserId", "renote"."renoteUserHost" AS "renote_renoteUserHost", "replyUser"."id" AS "replyUser_id", "replyUser"."createdAt" AS "replyUser_createdAt", "replyUser"."updatedAt" AS "replyUser_updatedAt", "replyUser"."lastFetchedAt" AS "replyUser_lastFetchedAt", "replyUser"."lastActiveDate" AS "replyUser_lastActiveDate", "replyUser"."hideOnlineStatus" AS "replyUser_hideOnlineStatus", "replyUser"."username" AS "replyUser_username", "replyUser"."name" AS "replyUser_name", "replyUser"."followersCount" AS "replyUser_followersCount", "replyUser"."followingCount" AS "replyUser_followingCount", "replyUser"."movedToUri" AS "replyUser_movedToUri", "replyUser"."movedAt" AS "replyUser_movedAt", "replyUser"."alsoKnownAs" AS "replyUser_alsoKnownAs", "replyUser"."notesCount" AS "replyUser_notesCount", "replyUser"."avatarId" AS "replyUser_avatarId", "replyUser"."bannerId" AS "replyUser_bannerId", "replyUser"."avatarUrl" AS "replyUser_avatarUrl", "replyUser"."bannerUrl" AS "replyUser_bannerUrl", "replyUser"."avatarBlurhash" AS "replyUser_avatarBlurhash", "replyUser"."bannerBlurhash" AS "replyUser_bannerBlurhash", "replyUser"."tags" AS "replyUser_tags", "replyUser"."isSuspended" AS "replyUser_isSuspended", "replyUser"."isLocked" AS "replyUser_isLocked", "replyUser"."isBot" AS "replyUser_isBot", "replyUser"."isCat" AS "replyUser_isCat", "replyUser"."isRoot" AS "replyUser_isRoot", "replyUser"."isExplorable" AS "replyUser_isExplorable", "replyUser"."isDeleted" AS "replyUser_isDeleted", "replyUser"."emojis" AS "replyUser_emojis", "replyUser"."host" AS "replyUser_host", "replyUser"."inbox" AS "replyUser_inbox", "replyUser"."sharedInbox" AS "replyUser_sharedInbox", "replyUser"."featured" AS "replyUser_featured", "replyUser"."uri" AS "replyUser_uri", "replyUser"."followersUri" AS "replyUser_followersUri", "replyUser"."token" AS "replyUser_token", "renoteUser"."id" AS "renoteUser_id", "renoteUser"."createdAt" AS "renoteUser_createdAt", "renoteUser"."updatedAt" AS "renoteUser_updatedAt", "renoteUser"."lastFetchedAt" AS "renoteUser_lastFetchedAt", "renoteUser"."lastActiveDate" AS "renoteUser_lastActiveDate", "renoteUser"."hideOnlineStatus" AS "renoteUser_hideOnlineStatus", "renoteUser"."username" AS "renoteUser_username", "renoteUser"."name" AS "renoteUser_name", "renoteUser"."followersCount" AS "renoteUser_followersCount", "renoteUser"."followingCount" AS "renoteUser_followingCount", "renoteUser"."movedToUri" AS "renoteUser_movedToUri", "renoteUser"."movedAt" AS "renoteUser_movedAt", "renoteUser"."alsoKnownAs" AS "renoteUser_alsoKnownAs", "renoteUser"."notesCount" AS "renoteUser_notesCount", "renoteUser"."avatarId" AS "renoteUser_avatarId", "renoteUser"."bannerId" AS "renoteUser_bannerId", "renoteUser"."avatarUrl" AS "renoteUser_avatarUrl", "renoteUser"."bannerUrl" AS "renoteUser_bannerUrl", "renoteUser"."avatarBlurhash" AS "renoteUser_avatarBlurhash", "renoteUser"."bannerBlurhash" AS "renoteUser_bannerBlurhash", "renoteUser"."tags" AS "renoteUser_tags", "renoteUser"."isSuspended" AS "renoteUser_isSuspended", "renoteUser"."isLocked" AS "renoteUser_isLocked", "renoteUser"."isBot" AS "renoteUser_isBot", "renoteUser"."isCat" AS "renoteUser_isCat", "renoteUser"."isRoot" AS "renoteUser_isRoot", "renoteUser"."isExplorable" AS "renoteUser_isExplorable", "renoteUser"."isDeleted" AS "renoteUser_isDeleted", "renoteUser"."emojis" AS "renoteUser_emojis", "renoteUser"."host" AS "renoteUser_host", "renoteUser"."inbox" AS "renoteUser_inbox", "renoteUser"."sharedInbox" AS "renoteUser_sharedInbox", "renoteUser"."featured" AS "renoteUser_featured", "renoteUser"."uri" AS "renoteUser_uri", "renoteUser"."followersUri" AS "renoteUser_followersUri", "renoteUser"."token" AS "renoteUser_token" FROM "note" "note" INNER JOIN "user" "user" ON "user"."id"="note"."userId"  LEFT JOIN "note" "reply" ON "reply"."id"="note"."replyId"  LEFT JOIN "note" "renote" ON "renote"."id"="note"."renoteId"  LEFT JOIN "user" "replyUser" ON "replyUser"."id"="reply"."userId"  LEFT JOIN "user" "renoteUser" ON "renoteUser"."id"="renote"."userId" WHERE "note"."id" > $1 AND "note"."userId" = $2 AND ("note"."visibility" = $3 OR "note"."visibility" = $4)) "distinctAlias" ORDER BY "distinctAlias"."note_id" ASC, "note_id" ASC LIMIT $5	0	0.0	0.0	0.0	0.0	0.0	280	86080.47453400000	0.026333	28175.532895	307.4302661928570	2489.899267513270	934	8923005	608268	2080	351	0	0	0	0	0	0	0.0	0.0	0.0	0.0	2155	1993	14337277	0	0.0	0	0.0	0	0.0	0	0.0
16822	16426	TRUE	1654036986644845719	SELECT COUNT($1) AS "cnt" FROM "note" "Note" WHERE (NOT("Note"."userHost" IS NULL))	0	0.0	0.0	0.0	0.0	0.0	1	25877.970488	25877.970488	25877.970488	25877.970488	0.0	1	1151161	696734	2430	609	0	0	0	0	0	0	0.0	0.0	0.0	0.0	2287	2272	14826898	5	0.496294	0	0.0	1	0.462121	1	18.538977
16822	16426	TRUE	-7540922400907630251	SELECT DISTINCT "distinctAlias"."reaction_id" AS "ids_reaction_id", "distinctAlias"."reaction_id" FROM (SELECT "reaction"."id" AS "reaction_id", "reaction"."createdAt" AS "reaction_createdAt", "reaction"."userId" AS "reaction_userId", "reaction"."noteId" AS "reaction_noteId", "reaction"."reaction" AS "reaction_reaction", "note"."id" AS "note_id", "note"."createdAt" AS "note_createdAt", "note"."replyId" AS "note_replyId", "note"."renoteId" AS "note_renoteId", "note"."threadId" AS "note_threadId", "note"."text" AS "note_text", "note"."name" AS "note_name", "note"."cw" AS "note_cw", "note"."userId" AS "note_userId", "note"."localOnly" AS "note_localOnly", "note"."reactionAcceptance" AS "note_reactionAcceptance", "note"."renoteCount" AS "note_renoteCount", "note"."repliesCount" AS "note_repliesCount", "note"."reactions" AS "note_reactions", "note"."visibility" AS "note_visibility", "note"."uri" AS "note_uri", "note"."url" AS "note_url", "note"."fileIds" AS "note_fileIds", "note"."attachedFileTypes" AS "note_attachedFileTypes", "note"."visibleUserIds" AS "note_visibleUserIds", "note"."mentions" AS "note_mentions", "note"."mentionedRemoteUsers" AS "note_mentionedRemoteUsers", "note"."emojis" AS "note_emojis", "note"."tags" AS "note_tags", "note"."hasPoll" AS "note_hasPoll", "note"."channelId" AS "note_channelId", "note"."userHost" AS "note_userHost", "note"."replyUserId" AS "note_replyUserId", "note"."replyUserHost" AS "note_replyUserHost", "note"."renoteUserId" AS "note_renoteUserId", "note"."renoteUserHost" AS "note_renoteUserHost" FROM "note_reaction" "reaction" LEFT JOIN "note" "note" ON "note"."id"="reaction"."noteId" WHERE "reaction"."userId" = $1 AND (("note"."visibility" = $7 OR "note"."visibility" = $8) OR "note"."userId" = $2 OR $3 = ANY("note"."visibleUserIds") OR $4 = ANY("note"."mentions") OR ("note"."visibility" = $9 AND ("note"."userId" IN (SELECT "following"."followeeId" AS "following_followeeId" FROM "following" "following" WHERE "following"."followerId" = $5) OR "note"."replyUserId" = $6)))) "distinctAlias" ORDER BY "distinctAlias"."reaction_id" DESC, "reaction_id" ASC LIMIT $10	0	0.0	0.0	0.0	0.0	0.0	130	616736.6207930000	0.5771040000000000	18576.845245	4744.127852253850	7238.885784631330	1948	283590723	5302448	3427	3126	0	0	0	0	0	0	0.0	0.0	0.0	0.0	2935	1861	13533311	0	0.0	0	0.0	0	0.0	0	0.0
16822	16426	TRUE	-2691487539323277329	SELECT "NoteUnread"."id" AS "NoteUnread_id", "NoteUnread"."userId" AS "NoteUnread_userId", "NoteUnread"."noteId" AS "NoteUnread_noteId", "NoteUnread"."isMentioned" AS "NoteUnread_isMentioned", "NoteUnread"."isSpecified" AS "NoteUnread_isSpecified", "NoteUnread"."noteUserId" AS "NoteUnread_noteUserId", "NoteUnread"."noteChannelId" AS "NoteUnread_noteChannelId" FROM "note_unread" "NoteUnread" WHERE ("NoteUnread"."noteChannelId" = $1 AND "NoteUnread"."userId" = $2) LIMIT $3	0	0.0	0.0	0.0	0.0	0.0	158135	10848611.660474000	0.007074	15160.238492	68.60348221755920	657.2720886558900	49756	67887204	38799457	118785	34243	0	0	0	0	0	0	0.0	0.0	0.0	0.0	158537	110504	858707672	0	0.0	0	0.0	0	0.0	0	0.0
16822	16426	TRUE	-6004942123678083980	SELECT DISTINCT "distinctAlias"."reaction_id" AS "ids_reaction_id", "distinctAlias"."reaction_id" FROM (SELECT "reaction"."id" AS "reaction_id", "reaction"."createdAt" AS "reaction_createdAt", "reaction"."userId" AS "reaction_userId", "reaction"."noteId" AS "reaction_noteId", "reaction"."reaction" AS "reaction_reaction", "note"."id" AS "note_id", "note"."createdAt" AS "note_createdAt", "note"."replyId" AS "note_replyId", "note"."renoteId" AS "note_renoteId", "note"."threadId" AS "note_threadId", "note"."text" AS "note_text", "note"."name" AS "note_name", "note"."cw" AS "note_cw", "note"."userId" AS "note_userId", "note"."localOnly" AS "note_localOnly", "note"."reactionAcceptance" AS "note_reactionAcceptance", "note"."renoteCount" AS "note_renoteCount", "note"."repliesCount" AS "note_repliesCount", "note"."reactions" AS "note_reactions", "note"."visibility" AS "note_visibility", "note"."uri" AS "note_uri", "note"."url" AS "note_url", "note"."fileIds" AS "note_fileIds", "note"."attachedFileTypes" AS "note_attachedFileTypes", "note"."visibleUserIds" AS "note_visibleUserIds", "note"."mentions" AS "note_mentions", "note"."mentionedRemoteUsers" AS "note_mentionedRemoteUsers", "note"."emojis" AS "note_emojis", "note"."tags" AS "note_tags", "note"."hasPoll" AS "note_hasPoll", "note"."channelId" AS "note_channelId", "note"."userHost" AS "note_userHost", "note"."replyUserId" AS "note_replyUserId", "note"."replyUserHost" AS "note_replyUserHost", "note"."renoteUserId" AS "note_renoteUserId", "note"."renoteUserHost" AS "note_renoteUserHost" FROM "note_reaction" "reaction" LEFT JOIN "note" "note" ON "note"."id"="reaction"."noteId" WHERE "reaction"."id" < $1 AND "reaction"."userId" = $2 AND (("note"."visibility" = $8 OR "note"."visibility" = $9) OR "note"."userId" = $3 OR $4 = ANY("note"."visibleUserIds") OR $5 = ANY("note"."mentions") OR ("note"."visibility" = $10 AND ("note"."userId" IN (SELECT "following"."followeeId" AS "following_followeeId" FROM "following" "following" WHERE "following"."followerId" = $6) OR "note"."replyUserId" = $7)))) "distinctAlias" ORDER BY "distinctAlias"."reaction_id" DESC, "reaction_id" ASC LIMIT $11	0	0.0	0.0	0.0	0.0	0.0	35	17222.766013	21.509164000000000	14722.809564000000	492.0790289428570	2443.374730779850	960	6760904	182160	18	48	0	0	0	0	0	0	0.0	0.0	0.0	0.0	29	11	89801	0	0.0	0	0.0	0	0.0	0	0.0
16822	16426	TRUE	-6892100638206848872	DELETE FROM "user" WHERE "id" IN ($1)	0	0.0	0.0	0.0	0.0	0.0	1419	64698.88648200010	4.457217	11767.120392	45.59470506131070	337.8198344050560	1419	2082571	113871	51824	65	0	0	0	0	0	0	0.0	0.0	0.0	0.0	58321	51730	402572043	0	0.0	0	0.0	0	0.0	0	0.0
16822	16426	TRUE	1136360094718252966	SELECT DISTINCT "distinctAlias"."note_id" AS "ids_note_id", "distinctAlias"."note_id" FROM (SELECT "note"."id" AS "note_id", "note"."createdAt" AS "note_createdAt", "note"."replyId" AS "note_replyId", "note"."renoteId" AS "note_renoteId", "note"."threadId" AS "note_threadId", "note"."text" AS "note_text", "note"."name" AS "note_name", "note"."cw" AS "note_cw", "note"."userId" AS "note_userId", "note"."localOnly" AS "note_localOnly", "note"."reactionAcceptance" AS "note_reactionAcceptance", "note"."renoteCount" AS "note_renoteCount", "note"."repliesCount" AS "note_repliesCount", "note"."reactions" AS "note_reactions", "note"."visibility" AS "note_visibility", "note"."uri" AS "note_uri", "note"."url" AS "note_url", "note"."fileIds" AS "note_fileIds", "note"."attachedFileTypes" AS "note_attachedFileTypes", "note"."visibleUserIds" AS "note_visibleUserIds", "note"."mentions" AS "note_mentions", "note"."mentionedRemoteUsers" AS "note_mentionedRemoteUsers", "note"."emojis" AS "note_emojis", "note"."tags" AS "note_tags", "note"."hasPoll" AS "note_hasPoll", "note"."channelId" AS "note_channelId", "note"."userHost" AS "note_userHost", "note"."replyUserId" AS "note_replyUserId", "note"."replyUserHost" AS "note_replyUserHost", "note"."renoteUserId" AS "note_renoteUserId", "note"."renoteUserHost" AS "note_renoteUserHost", "user"."id" AS "user_id", "user"."createdAt" AS "user_createdAt", "user"."updatedAt" AS "user_updatedAt", "user"."lastFetchedAt" AS "user_lastFetchedAt", "user"."lastActiveDate" AS "user_lastActiveDate", "user"."hideOnlineStatus" AS "user_hideOnlineStatus", "user"."username" AS "user_username", "user"."name" AS "user_name", "user"."followersCount" AS "user_followersCount", "user"."followingCount" AS "user_followingCount", "user"."movedToUri" AS "user_movedToUri", "user"."movedAt" AS "user_movedAt", "user"."alsoKnownAs" AS "user_alsoKnownAs", "user"."notesCount" AS "user_notesCount", "user"."avatarId" AS "user_avatarId", "user"."bannerId" AS "user_bannerId", "user"."avatarUrl" AS "user_avatarUrl", "user"."bannerUrl" AS "user_bannerUrl", "user"."avatarBlurhash" AS "user_avatarBlurhash", "user"."bannerBlurhash" AS "user_bannerBlurhash", "user"."tags" AS "user_tags", "user"."isSuspended" AS "user_isSuspended", "user"."isLocked" AS "user_isLocked", "user"."isBot" AS "user_isBot", "user"."isCat" AS "user_isCat", "user"."isRoot" AS "user_isRoot", "user"."isExplorable" AS "user_isExplorable", "user"."isDeleted" AS "user_isDeleted", "user"."emojis" AS "user_emojis", "user"."host" AS "user_host", "user"."inbox" AS "user_inbox", "user"."sharedInbox" AS "user_sharedInbox", "user"."featured" AS "user_featured", "user"."uri" AS "user_uri", "user"."followersUri" AS "user_followersUri", "user"."token" AS "user_token", "reply"."id" AS "reply_id", "reply"."createdAt" AS "reply_createdAt", "reply"."replyId" AS "reply_replyId", "reply"."renoteId" AS "reply_renoteId", "reply"."threadId" AS "reply_threadId", "reply"."text" AS "reply_text", "reply"."name" AS "reply_name", "reply"."cw" AS "reply_cw", "reply"."userId" AS "reply_userId", "reply"."localOnly" AS "reply_localOnly", "reply"."reactionAcceptance" AS "reply_reactionAcceptance", "reply"."renoteCount" AS "reply_renoteCount", "reply"."repliesCount" AS "reply_repliesCount", "reply"."reactions" AS "reply_reactions", "reply"."visibility" AS "reply_visibility", "reply"."uri" AS "reply_uri", "reply"."url" AS "reply_url", "reply"."fileIds" AS "reply_fileIds", "reply"."attachedFileTypes" AS "reply_attachedFileTypes", "reply"."visibleUserIds" AS "reply_visibleUserIds", "reply"."mentions" AS "reply_mentions", "reply"."mentionedRemoteUsers" AS "reply_mentionedRemoteUsers", "reply"."emojis" AS "reply_emojis", "reply"."tags" AS "reply_tags", "reply"."hasPoll" AS "reply_hasPoll", "reply"."channelId" AS "reply_channelId", "reply"."userHost" AS "reply_userHost", "reply"."replyUserId" AS "reply_replyUserId", "reply"."replyUserHost" AS "reply_replyUserHost", "reply"."renoteUserId" AS "reply_renoteUserId", "reply"."renoteUserHost" AS "reply_renoteUserHost", "renote"."id" AS "renote_id", "renote"."createdAt" AS "renote_createdAt", "renote"."replyId" AS "renote_replyId", "renote"."renoteId" AS "renote_renoteId", "renote"."threadId" AS "renote_threadId", "renote"."text" AS "renote_text", "renote"."name" AS "renote_name", "renote"."cw" AS "renote_cw", "renote"."userId" AS "renote_userId", "renote"."localOnly" AS "renote_localOnly", "renote"."reactionAcceptance" AS "renote_reactionAcceptance", "renote"."renoteCount" AS "renote_renoteCount", "renote"."repliesCount" AS "renote_repliesCount", "renote"."reactions" AS "renote_reactions", "renote"."visibility" AS "renote_visibility", "renote"."uri" AS "renote_uri", "renote"."url" AS "renote_url", "renote"."fileIds" AS "renote_fileIds", "renote"."attachedFileTypes" AS "renote_attachedFileTypes", "renote"."visibleUserIds" AS "renote_visibleUserIds", "renote"."mentions" AS "renote_mentions", "renote"."mentionedRemoteUsers" AS "renote_mentionedRemoteUsers", "renote"."emojis" AS "renote_emojis", "renote"."tags" AS "renote_tags", "renote"."hasPoll" AS "renote_hasPoll", "renote"."channelId" AS "renote_channelId", "renote"."userHost" AS "renote_userHost", "renote"."replyUserId" AS "renote_replyUserId", "renote"."replyUserHost" AS "renote_replyUserHost", "renote"."renoteUserId" AS "renote_renoteUserId", "renote"."renoteUserHost" AS "renote_renoteUserHost", "replyUser"."id" AS "replyUser_id", "replyUser"."createdAt" AS "replyUser_createdAt", "replyUser"."updatedAt" AS "replyUser_updatedAt", "replyUser"."lastFetchedAt" AS "replyUser_lastFetchedAt", "replyUser"."lastActiveDate" AS "replyUser_lastActiveDate", "replyUser"."hideOnlineStatus" AS "replyUser_hideOnlineStatus", "replyUser"."username" AS "replyUser_username", "replyUser"."name" AS "replyUser_name", "replyUser"."followersCount" AS "replyUser_followersCount", "replyUser"."followingCount" AS "replyUser_followingCount", "replyUser"."movedToUri" AS "replyUser_movedToUri", "replyUser"."movedAt" AS "replyUser_movedAt", "replyUser"."alsoKnownAs" AS "replyUser_alsoKnownAs", "replyUser"."notesCount" AS "replyUser_notesCount", "replyUser"."avatarId" AS "replyUser_avatarId", "replyUser"."bannerId" AS "replyUser_bannerId", "replyUser"."avatarUrl" AS "replyUser_avatarUrl", "replyUser"."bannerUrl" AS "replyUser_bannerUrl", "replyUser"."avatarBlurhash" AS "replyUser_avatarBlurhash", "replyUser"."bannerBlurhash" AS "replyUser_bannerBlurhash", "replyUser"."tags" AS "replyUser_tags", "replyUser"."isSuspended" AS "replyUser_isSuspended", "replyUser"."isLocked" AS "replyUser_isLocked", "replyUser"."isBot" AS "replyUser_isBot", "replyUser"."isCat" AS "replyUser_isCat", "replyUser"."isRoot" AS "replyUser_isRoot", "replyUser"."isExplorable" AS "replyUser_isExplorable", "replyUser"."isDeleted" AS "replyUser_isDeleted", "replyUser"."emojis" AS "replyUser_emojis", "replyUser"."host" AS "replyUser_host", "replyUser"."inbox" AS "replyUser_inbox", "replyUser"."sharedInbox" AS "replyUser_sharedInbox", "replyUser"."featured" AS "replyUser_featured", "replyUser"."uri" AS "replyUser_uri", "replyUser"."followersUri" AS "replyUser_followersUri", "replyUser"."token" AS "replyUser_token", "renoteUser"."id" AS "renoteUser_id", "renoteUser"."createdAt" AS "renoteUser_createdAt", "renoteUser"."updatedAt" AS "renoteUser_updatedAt", "renoteUser"."lastFetchedAt" AS "renoteUser_lastFetchedAt", "renoteUser"."lastActiveDate" AS "renoteUser_lastActiveDate", "renoteUser"."hideOnlineStatus" AS "renoteUser_hideOnlineStatus", "renoteUser"."username" AS "renoteUser_username", "renoteUser"."name" AS "renoteUser_name", "renoteUser"."followersCount" AS "renoteUser_followersCount", "renoteUser"."followingCount" AS "renoteUser_followingCount", "renoteUser"."movedToUri" AS "renoteUser_movedToUri", "renoteUser"."movedAt" AS "renoteUser_movedAt", "renoteUser"."alsoKnownAs" AS "renoteUser_alsoKnownAs", "renoteUser"."notesCount" AS "renoteUser_notesCount", "renoteUser"."avatarId" AS "renoteUser_avatarId", "renoteUser"."bannerId" AS "renoteUser_bannerId", "renoteUser"."avatarUrl" AS "renoteUser_avatarUrl", "renoteUser"."bannerUrl" AS "renoteUser_bannerUrl", "renoteUser"."avatarBlurhash" AS "renoteUser_avatarBlurhash", "renoteUser"."bannerBlurhash" AS "renoteUser_bannerBlurhash", "renoteUser"."tags" AS "renoteUser_tags", "renoteUser"."isSuspended" AS "renoteUser_isSuspended", "renoteUser"."isLocked" AS "renoteUser_isLocked", "renoteUser"."isBot" AS "renoteUser_isBot", "renoteUser"."isCat" AS "renoteUser_isCat", "renoteUser"."isRoot" AS "renoteUser_isRoot", "renoteUser"."isExplorable" AS "renoteUser_isExplorable", "renoteUser"."isDeleted" AS "renoteUser_isDeleted", "renoteUser"."emojis" AS "renoteUser_emojis", "renoteUser"."host" AS "renoteUser_host", "renoteUser"."inbox" AS "renoteUser_inbox", "renoteUser"."sharedInbox" AS "renoteUser_sharedInbox", "renoteUser"."featured" AS "renoteUser_featured", "renoteUser"."uri" AS "renoteUser_uri", "renoteUser"."followersUri" AS "renoteUser_followersUri", "renoteUser"."token" AS "renoteUser_token" FROM "note" "note" INNER JOIN "user" "user" ON "user"."id"="note"."userId"  LEFT JOIN "note" "reply" ON "reply"."id"="note"."replyId"  LEFT JOIN "note" "renote" ON "renote"."id"="note"."renoteId"  LEFT JOIN "user" "replyUser" ON "replyUser"."id"="reply"."userId"  LEFT JOIN "user" "renoteUser" ON "renoteUser"."id"="renote"."userId" WHERE "note"."userId" = $1 AND (("note"."visibility" = $26 OR "note"."visibility" = $27) OR "note"."userId" = $2 OR $3 = ANY("note"."visibleUserIds") OR $4 = ANY("note"."mentions") OR ("note"."visibility" = $28 AND ("note"."userId" IN (SELECT "following"."followeeId" AS "following_followeeId" FROM "following" "following" WHERE "following"."followerId" = $5) OR "note"."replyUserId" = $6))) AND "note"."userId" NOT IN (SELECT "muting"."muteeId" AS "muting_muteeId" FROM "muting" "muting" WHERE "muting"."muterId" = $7 AND "muting"."muteeId" != $8) AND ("note"."replyUserId" IS NULL OR "note"."replyUserId" NOT IN (SELECT "muting"."muteeId" AS "muting_muteeId" FROM "muting" "muting" WHERE "muting"."muterId" = $9 AND "muting"."muteeId" != $10)) AND ("note"."renoteUserId" IS NULL OR "note"."renoteUserId" NOT IN (SELECT "muting"."muteeId" AS "muting_muteeId" FROM "muting" "muting" WHERE "muting"."muterId" = $11 AND "muting"."muteeId" != $12)) AND ("note"."userHost" IS NULL OR NOT ((SELECT "user_profile"."mutedInstances" AS "user_profile_mutedInstances" FROM "user_profile" "user_profile" WHERE "user_profile"."userId" = $13)::jsonb ? "note"."userHost")) AND ("note"."replyUserHost" IS NULL OR NOT ((SELECT "user_profile"."mutedInstances" AS "user_profile_mutedInstances" FROM "user_profile" "user_profile" WHERE "user_profile"."userId" = $14)::jsonb ? "note"."replyUserHost")) AND ("note"."renoteUserHost" IS NULL OR NOT ((SELECT "user_profile"."mutedInstances" AS "user_profile_mutedInstances" FROM "user_profile" "user_profile" WHERE "user_profile"."userId" = $15)::jsonb ? "note"."renoteUserHost")) AND "note"."userId" NOT IN (SELECT "blocking"."blockerId" AS "blocking_blockerId" FROM "blocking" "blocking" WHERE "blocking"."blockeeId" = $16) AND ("note"."replyUserId" IS NULL OR "note"."replyUserId" NOT IN (SELECT "blocking"."blockerId" AS "blocking_blockerId" FROM "blocking" "blocking" WHERE "blocking"."blockeeId" = $17)) AND ("note"."renoteUserId" IS NULL OR "note"."renoteUserId" NOT IN (SELECT "blocking"."blockerId" AS "blocking_blockerId" FROM "blocking" "blocking" WHERE "blocking"."blockeeId" = $18)) AND "note"."fileIds" != $29 AND ($19 = ANY("note"."attachedFileTypes") OR $20 = ANY("note"."attachedFileTypes") OR $21 = ANY("note"."attachedFileTypes") OR $22 = ANY("note"."attachedFileTypes") OR $23 = ANY("note"."attachedFileTypes") OR $24 = ANY("note"."attachedFileTypes") OR $25 = ANY("note"."attachedFileTypes")) AND "note"."cw" IS NULL AND $30 = (SELECT COUNT(*) FROM drive_file df WHERE [df.id](http://df.id/) = ANY(note."fileIds") AND df."isSensitive" = $31)) "distinctAlias" ORDER BY "distinctAlias"."note_id" DESC, "note_id" ASC LIMIT $32	0	0.0	0.0	0.0	0.0	0.0	11438	2843098.093984020	0.01945	7855.261708	248.5660162601850	547.1887165416280	81943	48143287	12225075	1688	5421	0	0	0	0	0	0	0.0	0.0	0.0	0.0	1817	1218	8952442	197709	31733.600407000000	2	375.01095700000000	1330	19569.19963200000	1330	197942.18525700000

そのうちひとつを整形

SELECT DISTINCT
    "distinctAlias"."note_id" AS "ids_note_id",
    "distinctAlias"."note_id"
FROM
    (
        SELECT
            "note"."id" AS "note_id",
            "note"."createdAt" AS "note_createdAt",
            "note"."replyId" AS "note_replyId",
            "note"."renoteId" AS "note_renoteId",
            "note"."threadId" AS "note_threadId",
            "note"."text" AS "note_text",
            "note"."name" AS "note_name",
            "note"."cw" AS "note_cw",
            "note"."userId" AS "note_userId",
            "note"."localOnly" AS "note_localOnly",
            "note"."reactionAcceptance" AS "note_reactionAcceptance",
            "note"."renoteCount" AS "note_renoteCount",
            "note"."repliesCount" AS "note_repliesCount",
            "note"."reactions" AS "note_reactions",
            "note"."visibility" AS "note_visibility",
            "note"."uri" AS "note_uri",
            "note"."url" AS "note_url",
            "note"."fileIds" AS "note_fileIds",
            "note"."attachedFileTypes" AS "note_attachedFileTypes",
            "note"."visibleUserIds" AS "note_visibleUserIds",
            "note"."mentions" AS "note_mentions",
            "note"."mentionedRemoteUsers" AS "note_mentionedRemoteUsers",
            "note"."emojis" AS "note_emojis",
            "note"."tags" AS "note_tags",
            "note"."hasPoll" AS "note_hasPoll",
            "note"."channelId" AS "note_channelId",
            "note"."userHost" AS "note_userHost",
            "note"."replyUserId" AS "note_replyUserId",
            "note"."replyUserHost" AS "note_replyUserHost",
            "note"."renoteUserId" AS "note_renoteUserId",
            "note"."renoteUserHost" AS "note_renoteUserHost",
            "user"."id" AS "user_id",
            "user"."createdAt" AS "user_createdAt",
            "user"."updatedAt" AS "user_updatedAt",
            "user"."lastFetchedAt" AS "user_lastFetchedAt",
            "user"."lastActiveDate" AS "user_lastActiveDate",
            "user"."hideOnlineStatus" AS "user_hideOnlineStatus",
            "user"."username" AS "user_username",
            "user"."name" AS "user_name",
            "user"."followersCount" AS "user_followersCount",
            "user"."followingCount" AS "user_followingCount",
            "user"."movedToUri" AS "user_movedToUri",
            "user"."movedAt" AS "user_movedAt",
            "user"."alsoKnownAs" AS "user_alsoKnownAs",
            "user"."notesCount" AS "user_notesCount",
            "user"."avatarId" AS "user_avatarId",
            "user"."bannerId" AS "user_bannerId",
            "user"."avatarUrl" AS "user_avatarUrl",
            "user"."bannerUrl" AS "user_bannerUrl",
            "user"."avatarBlurhash" AS "user_avatarBlurhash",
            "user"."bannerBlurhash" AS "user_bannerBlurhash",
            "user"."tags" AS "user_tags",
            "user"."isSuspended" AS "user_isSuspended",
            "user"."isLocked" AS "user_isLocked",
            "user"."isBot" AS "user_isBot",
            "user"."isCat" AS "user_isCat",
            "user"."isRoot" AS "user_isRoot",
            "user"."isExplorable" AS "user_isExplorable",
            "user"."isDeleted" AS "user_isDeleted",
            "user"."emojis" AS "user_emojis",
            "user"."host" AS "user_host",
            "user"."inbox" AS "user_inbox",
            "user"."sharedInbox" AS "user_sharedInbox",
            "user"."featured" AS "user_featured",
            "user"."uri" AS "user_uri",
            "user"."followersUri" AS "user_followersUri",
            "user"."token" AS "user_token",
            "reply"."id" AS "reply_id",
            "reply"."createdAt" AS "reply_createdAt",
            "reply"."replyId" AS "reply_replyId",
            "reply"."renoteId" AS "reply_renoteId",
            "reply"."threadId" AS "reply_threadId",
            "reply"."text" AS "reply_text",
            "reply"."name" AS "reply_name",
            "reply"."cw" AS "reply_cw",
            "reply"."userId" AS "reply_userId",
            "reply"."localOnly" AS "reply_localOnly",
            "reply"."reactionAcceptance" AS "reply_reactionAcceptance",
            "reply"."renoteCount" AS "reply_renoteCount",
            "reply"."repliesCount" AS "reply_repliesCount",
            "reply"."reactions" AS "reply_reactions",
            "reply"."visibility" AS "reply_visibility",
            "reply"."uri" AS "reply_uri",
            "reply"."url" AS "reply_url",
            "reply"."fileIds" AS "reply_fileIds",
            "reply"."attachedFileTypes" AS "reply_attachedFileTypes",
            "reply"."visibleUserIds" AS "reply_visibleUserIds",
            "reply"."mentions" AS "reply_mentions",
            "reply"."mentionedRemoteUsers" AS "reply_mentionedRemoteUsers",
            "reply"."emojis" AS "reply_emojis",
            "reply"."tags" AS "reply_tags",
            "reply"."hasPoll" AS "reply_hasPoll",
            "reply"."channelId" AS "reply_channelId",
            "reply"."userHost" AS "reply_userHost",
            "reply"."replyUserId" AS "reply_replyUserId",
            "reply"."replyUserHost" AS "reply_replyUserHost",
            "reply"."renoteUserId" AS "reply_renoteUserId",
            "reply"."renoteUserHost" AS "reply_renoteUserHost",
            "renote"."id" AS "renote_id",
            "renote"."createdAt" AS "renote_createdAt",
            "renote"."replyId" AS "renote_replyId",
            "renote"."renoteId" AS "renote_renoteId",
            "renote"."threadId" AS "renote_threadId",
            "renote"."text" AS "renote_text",
            "renote"."name" AS "renote_name",
            "renote"."cw" AS "renote_cw",
            "renote"."userId" AS "renote_userId",
            "renote"."localOnly" AS "renote_localOnly",
            "renote"."reactionAcceptance" AS "renote_reactionAcceptance",
            "renote"."renoteCount" AS "renote_renoteCount",
            "renote"."repliesCount" AS "renote_repliesCount",
            "renote"."reactions" AS "renote_reactions",
            "renote"."visibility" AS "renote_visibility",
            "renote"."uri" AS "renote_uri",
            "renote"."url" AS "renote_url",
            "renote"."fileIds" AS "renote_fileIds",
            "renote"."attachedFileTypes" AS "renote_attachedFileTypes",
            "renote"."visibleUserIds" AS "renote_visibleUserIds",
            "renote"."mentions" AS "renote_mentions",
            "renote"."mentionedRemoteUsers" AS "renote_mentionedRemoteUsers",
            "renote"."emojis" AS "renote_emojis",
            "renote"."tags" AS "renote_tags",
            "renote"."hasPoll" AS "renote_hasPoll",
            "renote"."channelId" AS "renote_channelId",
            "renote"."userHost" AS "renote_userHost",
            "renote"."replyUserId" AS "renote_replyUserId",
            "renote"."replyUserHost" AS "renote_replyUserHost",
            "renote"."renoteUserId" AS "renote_renoteUserId",
            "renote"."renoteUserHost" AS "renote_renoteUserHost",
            "replyUser"."id" AS "replyUser_id",
            "replyUser"."createdAt" AS "replyUser_createdAt",
            "replyUser"."updatedAt" AS "replyUser_updatedAt",
            "replyUser"."lastFetchedAt" AS "replyUser_lastFetchedAt",
            "replyUser"."lastActiveDate" AS "replyUser_lastActiveDate",
            "replyUser"."hideOnlineStatus" AS "replyUser_hideOnlineStatus",
            "replyUser"."username" AS "replyUser_username",
            "replyUser"."name" AS "replyUser_name",
            "replyUser"."followersCount" AS "replyUser_followersCount",
            "replyUser"."followingCount" AS "replyUser_followingCount",
            "replyUser"."movedToUri" AS "replyUser_movedToUri",
            "replyUser"."movedAt" AS "replyUser_movedAt",
            "replyUser"."alsoKnownAs" AS "replyUser_alsoKnownAs",
            "replyUser"."notesCount" AS "replyUser_notesCount",
            "replyUser"."avatarId" AS "replyUser_avatarId",
            "replyUser"."bannerId" AS "replyUser_bannerId",
            "replyUser"."avatarUrl" AS "replyUser_avatarUrl",
            "replyUser"."bannerUrl" AS "replyUser_bannerUrl",
            "replyUser"."avatarBlurhash" AS "replyUser_avatarBlurhash",
            "replyUser"."bannerBlurhash" AS "replyUser_bannerBlurhash",
            "replyUser"."tags" AS "replyUser_tags",
            "replyUser"."isSuspended" AS "replyUser_isSuspended",
            "replyUser"."isLocked" AS "replyUser_isLocked",
            "replyUser"."isBot" AS "replyUser_isBot",
            "replyUser"."isCat" AS "replyUser_isCat",
            "replyUser"."isRoot" AS "replyUser_isRoot",
            "replyUser"."isExplorable" AS "replyUser_isExplorable",
            "replyUser"."isDeleted" AS "replyUser_isDeleted",
            "replyUser"."emojis" AS "replyUser_emojis",
            "replyUser"."host" AS "replyUser_host",
            "replyUser"."inbox" AS "replyUser_inbox",
            "replyUser"."sharedInbox" AS "replyUser_sharedInbox",
            "replyUser"."featured" AS "replyUser_featured",
            "replyUser"."uri" AS "replyUser_uri",
            "replyUser"."followersUri" AS "replyUser_followersUri",
            "replyUser"."token" AS "replyUser_token",
            "renoteUser"."id" AS "renoteUser_id",
            "renoteUser"."createdAt" AS "renoteUser_createdAt",
            "renoteUser"."updatedAt" AS "renoteUser_updatedAt",
            "renoteUser"."lastFetchedAt" AS "renoteUser_lastFetchedAt",
            "renoteUser"."lastActiveDate" AS "renoteUser_lastActiveDate",
            "renoteUser"."hideOnlineStatus" AS "renoteUser_hideOnlineStatus",
            "renoteUser"."username" AS "renoteUser_username",
            "renoteUser"."name" AS "renoteUser_name",
            "renoteUser"."followersCount" AS "renoteUser_followersCount",
            "renoteUser"."followingCount" AS "renoteUser_followingCount",
            "renoteUser"."movedToUri" AS "renoteUser_movedToUri",
            "renoteUser"."movedAt" AS "renoteUser_movedAt",
            "renoteUser"."alsoKnownAs" AS "renoteUser_alsoKnownAs",
            "renoteUser"."notesCount" AS "renoteUser_notesCount",
            "renoteUser"."avatarId" AS "renoteUser_avatarId",
            "renoteUser"."bannerId" AS "renoteUser_bannerId",
            "renoteUser"."avatarUrl" AS "renoteUser_avatarUrl",
            "renoteUser"."bannerUrl" AS "renoteUser_bannerUrl",
            "renoteUser"."avatarBlurhash" AS "renoteUser_avatarBlurhash",
            "renoteUser"."bannerBlurhash" AS "renoteUser_bannerBlurhash",
            "renoteUser"."tags" AS "renoteUser_tags",
            "renoteUser"."isSuspended" AS "renoteUser_isSuspended",
            "renoteUser"."isLocked" AS "renoteUser_isLocked",
            "renoteUser"."isBot" AS "renoteUser_isBot",
            "renoteUser"."isCat" AS "renoteUser_isCat",
            "renoteUser"."isRoot" AS "renoteUser_isRoot",
            "renoteUser"."isExplorable" AS "renoteUser_isExplorable",
            "renoteUser"."isDeleted" AS "renoteUser_isDeleted",
            "renoteUser"."emojis" AS "renoteUser_emojis",
            "renoteUser"."host" AS "renoteUser_host",
            "renoteUser"."inbox" AS "renoteUser_inbox",
            "renoteUser"."sharedInbox" AS "renoteUser_sharedInbox",
            "renoteUser"."featured" AS "renoteUser_featured",
            "renoteUser"."uri" AS "renoteUser_uri",
            "renoteUser"."followersUri" AS "renoteUser_followersUri",
            "renoteUser"."token" AS "renoteUser_token"
        FROM
            "note" "note"
            INNER JOIN
                "user_list_joining" "userListJoining"
            ON  "userListJoining"."userId" = "note"."userId"
            INNER JOIN
                "user" "user"
            ON  "user"."id" = "note"."userId"
            LEFT JOIN
                "note" "reply"
            ON  "reply"."id" = "note"."replyId"
            LEFT JOIN
                "note" "renote"
            ON  "renote"."id" = "note"."renoteId"
            LEFT JOIN
                "user" "replyUser"
            ON  "replyUser"."id" = "reply"."userId"
            LEFT JOIN
                "user" "renoteUser"
            ON  "renoteUser"."id" = "renote"."userId"
        WHERE
            "userListJoining"."userListId" = $1
        AND (
                (
                    "note"."visibility" = $7
                OR  "note"."visibility" = $8
                )
            OR  "note"."userId" = $2
            OR  $3 = ANY("note"."visibleUserIds")
            OR  $4 = ANY("note"."mentions")
            OR  (
                    "note"."visibility" = $9
                AND (
                        "note"."userId" IN(
                            SELECT
                                "following"."followeeId" AS "following_followeeId"
                            FROM
                                "following" "following"
                            WHERE
                                "following"."followerId" = $5
                        )
                    OR  "note"."replyUserId" = $6
                    )
                )
            )
    ) "distinctAlias"
ORDER BY
    "distinctAlias"."note_id" DESC,
    "note_id" ASC
LIMIT $10

サブクエリやめてPreloadすれば早くなるんじゃないかな

@MineCake147E
Copy link

純Rustの場合、async runtimeなど独自の実装の学習が必要なので、メインはTypescriptを維持したほうがいいと思います。

少し調べてみたのですが、Rustでは非同期処理の実装が乱立しているみたいですね。
純Rustになった後で大揉めする原因になると思うので、私も純Rust案には賛同出来ないです。

@KisaragiEffective
Copy link
Contributor

通りすがりの意見ですが、風のうわさで伺った「TypeErrorがバックエンドで発生している」という状況がある以上 (disclaimer: 頻度は知りません)、コードベースを100%Rustにすることは現実的ではないと考えています。

@yuriha-chan
Copy link
Contributor

Rust や Go 案にどちらかというと賛成です。
・メモリのフットプリント削減が見込める
・パフォーマンスの問題がより理解しやすく、予見しやすくなる
おもしろそう

C#は、パフォーマンスの完全なコントロールを目的とするのなら、中途半端な気もします。(私は.NETを使わないので、偏見がありますが)

依存ライブラリを移行できなかったらどうしようもできないので、どちらにせよRustで作ったNodeのネイティブモジュールをパフォーマンスの影響が大きいところから採用していくという現在の方針を推し進めるのが良いかと思います。

@sorairolake
Copy link
Contributor

メモリ関連の問題はGCのあるGoでもある程度は改善するでしょうが、GCやメモリリークの問題も考えたらGCのないRustを使う方がより良いとは思います。Rustに移行するにしても、移行や学習のコストを考えると必要な部分だけで段階的に行うのが良いと思います。

@syuilo
Copy link
Member Author

syuilo commented Jul 3, 2023

Rustが実際にパフォーマンスが良いかどうかは抜きにしても、一般にRustの方がパフォーマンスが良いというイメージが広まっていて、Rustで書かれているという理由で他ソフトウェアが選択されることが増えているのでMisskeyを使ってもらうためにはRustにするしかなくなってきている

@tamaina
Copy link
Member

tamaina commented Jul 3, 2023

そういう理由で技術選定するのは嫌い

@windymelt
Copy link
Contributor

本当に速くしたかったらスロークエリなんとかするほうが先じゃないですか 言語を変えてスロークエリ超えられるパフォーマンス出るなら別ですがそんなことないと思う 平均 500msかかっているクエリがある以上、言語を変えても500msかかり続けるのではないですか

@EbiseLutica
Copy link
Member

Rustが実際にパフォーマンスが良いかどうかは抜きにしても、一般にRustの方がパフォーマンスが良いというイメージが広まっていて、Rustで書かれているという理由で他ソフトウェアが選択されることが増えているのでMisskeyを使ってもらうためにはRustにするしかなくなってきている

気持ちはわかるけど、そういう理由でRustに置き換えたら100%利用者が増えるとは限らないし、戦うなら他の分野で戦う方法だってあるはず

重たい作業だし、これによるメリットがデメリットを上回る可能性もある 選定する理由としてはあと2,3個無いと不安

@yuriha-chan
Copy link
Contributor

今の自分の能力では今のパフォーマンスがほぼ限界で、これ以上パフォーマンスを改善するアイデアが無くなりつつある

こういう理由なら焦らないでよき、というお気持ち

地道に調査していけばそのうちパフォーマンスの問題点も解決策もみつけられるはずだし、Rustに移植したからと言ってその問題点がわかったり、解決策が見つかるわけでもないので。

@saschanaz
Copy link
Member

APIのエンドポイント…?意味あるの…?

(部分的にRustなどネイティブモジュールにするにしても、複雑な処理系とかバックグラウンド処理、ストリーミング処理を書き換えるのかなと思っていた)

(複雑な処理をRustでして、それを使うエンドポイントごとRustにしたらwasmとかで頭痛くならないので)

@KisaragiEffective
Copy link
Contributor

(複雑な処理をRustでして、それを使うエンドポイントごとRustにしたらwasmとかで頭痛くならないので)

その処理のコードが複雑であるかどうかと、その処理においてCPU (やIO) がボトルネックになっているかどうかというのは別の問題です。

@sorairolake
Copy link
Contributor

LemmyがRustで実装されてるからRustであることが性能に大きな影響を与えているのなら参考になるかも

@tamaina
Copy link
Member

tamaina commented Jul 3, 2023

wasmとかで頭痛くならない

複雑な処理って普通はNestモジュールや関数になっているのだからAPIから呼び出しても頭が痛くなることはない気がするけど…

あとAPIエンドポイントってスクリプト言語で書いたほうが保守性がいいのでは…?

@MineCake147E
Copy link

あとAPIエンドポイントってスクリプト言語で書いたほうが保守性がいいのでは…?

保守性と「スクリプト言語」であることに相関があるとは思えません。

@tamaina
Copy link
Member

tamaina commented Jul 3, 2023

あとAPIエンドポイントってスクリプト言語で書いたほうが保守性がいいのでは…?

これなしで

@saschanaz
Copy link
Member

「どうしてNodeではダメなのか」がまだ明確じゃないのは問題かも

@fruitriin
Copy link
Contributor

RustよりNode.jsのほうが開発の敷居が低いように思うので個人的にはNode.jsであることにかなりポジティブだよ〜

@tamaina
Copy link
Member

tamaina commented Jul 3, 2023

みんな移行はコスト高いって言ってるけど自分はそう思ってない(フロントエンドをReactに書き換えるとかの方がコスト高そう)

少なくともここだけはちょっと同意する

自分たちで書いたコードを愚直に置き換えること自体は苦痛ではなさそうだけど、パッケージ(ライブラリ)の代替を探すのが苦痛そうかつ書き換えが面倒そうなのと、ビルドした後のバイナリがめっちゃ肥大化するんじゃないかというのが不安

@rinsuki
Copy link
Contributor

rinsuki commented Jul 3, 2023

純Rustの場合、async runtimeなど独自の実装の学習が必要なので、メインはTypescriptを維持したほうがいいと思います。

少し調べてみたのですが、Rustでは非同期処理の実装が乱立しているみたいですね。 純Rustになった後で大揉めする原因になると思うので、私も純Rust案には賛同出来ないです。

  • 乱立と言ってもほぼ2個 (tokio / async-std)
  • だいたいの場合サーバーフレームワークを決めたらついでに非同期ランタイムも決まるのであんまりそこは気にしなくていい

@rinsuki
Copy link
Contributor

rinsuki commented Jul 3, 2023

Deno とか Bun に移行するなら前座としてルーター Hono にしたらリクエスト受ける部分がちょっと早くなったりしないかなと思っています https://github.com/honojs/hono (Misskeyの場合にFastifyとどっちが早いかは知らない)

まあまずスロークエリ含めたDB周り何とかしたほうがいいと思いますが…

@rinsuki
Copy link
Contributor

rinsuki commented Jul 3, 2023

あと JSON-LD on Rust はなんか面倒そう (予想) なのでその辺の検証をしっかりやったほうがいいかも

@rinsuki
Copy link
Contributor

rinsuki commented Jul 3, 2023

Deno とか Bun に移行するなら前座としてルーター Hono にしたらリクエスト受ける部分がちょっと早くなったりしないかなと思っています https://github.com/honojs/hono (Misskeyの場合にFastifyとどっちが早いかは知らない)

そういえば思い出したが今は koa でエイヤではなく NestJS に移行したので NestJS 用の hono のアダプターとか作らないといけなくて面倒?

@syuilo
Copy link
Member Author

syuilo commented Jul 3, 2023

Nestjsをフルで使ってはいなくて主にDI部分だけ使ってるからそこは大丈夫かも

@equal-l2
Copy link

equal-l2 commented Jul 3, 2023

Rustの話題と聞いて流れてきたRustaceanです。

今までの議論を読んだ感じ、Rustに移行する動機が弱いかなと思います。
最近大企業が他言語からRustに移行する事例はちょいちょいあるんですが、どれもちゃんとプロファイリングをやって「今の言語ではどうしても解決できないパフォーマンス上の問題がある」という結論に至ったうえでやっている印象があります。
例:Discord(https://discord.com/blog/why-discord-is-switching-from-go-to-rust

上でも言われているようにプロファイリングをしてみて、CPUバウンドなのかIOバウンドなのか、GCのタイミングで遅くなったりするのかなどを洗い出したほうがいいのでしょうね。

JavaScriptは「GC付きのスクリプト言語」という印象からパフォーマンス上目の敵にされがちですが、実のところどの処理系でも「JavaScriptという遅い言語をいかに速く動かすか」という努力がされていてそこまで遅くない、という評判がコンパイル型言語界隈でも聞こえてくるような状況です。

NodeをBunに変えてみるとかなら割と簡単な気もしますが、実装言語を変えるというのはかなり重い判断になると思います。

@equal-l2
Copy link

equal-l2 commented Jul 3, 2023

↑(個人開発では自分もとりあえず言語やフレームワークをえいやで変えてみたりするので、気持ちはわかる……)

@equal-l2
Copy link

equal-l2 commented Jul 3, 2023

Rustaceanとしての個人的感情を言えばRustで書かれたものが世間に広がったら面白いが、それはそれとしてRustは銀の弾丸ではないので「とりあえずRustで書き直そうぜ!(Rewrite It In Rust)」には賛同しかねる、という立場です。

@j416dy
Copy link

j416dy commented Jul 3, 2023

開発言語の話とはズレるけど、ここまでDBが足引っ張ってないか気にしてないのが気になるかも。
言語変えたいの話をするなら、せめてどのエンドポイントがどのくらい遅いのか、リクエスト時間中Node.jsのどこが遅いのか、くらいは把握したい所・・・。
(ここ以外のissueですでに議論済みだったらごめんなさい。見つけられなかった。)

感覚的にはDBで詰まってない?とは思ってて、実際上で出たSlowQueryは全部平均30秒超えてるし、大半ブラウザには届いてないはずでは?と思う所。
max_exec_timeに至っては16時間くらい回ってるときもあって、どう考えても無駄っぽい。
それならクエリ実行時にstatement_timeoutしただけでマシになるんでは?とか。
下手に居座るノードがあるより、timeoutエラー頻発でいいからさっさと返したほうがいいはずと思っているので。

@syuilo
Copy link
Member Author

syuilo commented Jul 3, 2023

それならクエリ実行時にstatement_timeoutしただけでマシになるんでは?とか。

既に設定されている

@kurehajime
Copy link

このIssueは『パフォーマンスを改善したい』と『開発体験を高めたい』の2つを解決しようとしてる
前者の『パフォーマンス』に関してはスロークエリが一番てっとり早そう
後者の『開発体験』はちょっと難しくて、仕事ではない個人のやる気ドリブンの開発では、その技術使ってテンションがあがるか・ワクワクするかが一番大事だと思う

@j416dy
Copy link

j416dy commented Jul 4, 2023

それならクエリ実行時にstatement_timeoutしただけでマシになるんでは?とか。

既に設定されている

確かに確認したら記述は1年前からありました。失礼しました。

statement_timeout: 1000 * 10,

ただioのslowQuery(であってるよね?)でそれを超えるクエリがあるなら、
ここが機能せずに流れてるクエリがあるということかも?とかそういう方向をみたいかも。
ただメインで運用しているのは村上さんなので管轄違うとかそういう所がある?外野からだとなんとも・・・。

@utopianf
Copy link

utopianf commented Jul 4, 2023

企業とかではなくほぼ個人プロジェクトってところもあるので、作者がRustを試してみたいって言ったらそれが尊重されるべきだとも思うんですけどね

@MineCake147E
Copy link

MineCake147E commented Jul 4, 2023

企業とかではなくほぼ個人プロジェクト

image

190人+Dependabotははたして「個人」なのでしょうか。

@j416dy
Copy link

j416dy commented Jul 4, 2023

190人+Dependabotははたして「個人」なのでしょうか。

個人かどうかじゃなくて、そこは「商業・営利」と、「趣味・同人」とかの違いだと思うので・・・。
極端な話、 syuilo さんは責務を負ってないとも言える。
(今のFanboxで運用されている環境が本当にそうか?というのはあるが、MisskeyHQとの関係性が良くも悪くも曖昧)

@acid-chicken
Copy link
Member

acid-chicken commented Jul 4, 2023

メンバーの立場から見る限り、私は少なくとも現体制は個人(同人的)プロジェクトと表現するのが適切だと思うけど

@acid-chicken
Copy link
Member

misskey-dev と io さんの関係は現在はしゅいろが io に住んでいることぐらいしか関係がないぐらい、グループとしては別物であって、例え io さんがどれぐらいの規模感で運営されていようと、それに misskey-dev が追従している(できている)わけではない。
それが課題だとしてもどのみちオフトピなので、この話はこれぐらい説明すればもう十分ですか?

@equal-l2
Copy link

equal-l2 commented Jul 4, 2023

最終的にリーダーが「僕はこうしたいからこうします!」というのは全然アリだとは思う。
オープンソースなので、気に入らない人は自分でフォークしてやっていく手もあるので。

こうやってIssueが開かれた以上意見を求めているのかな?と思ってやってきただけの外野なので、方針を強制する気はないということを後出しながら表明しておきます。

@equal-l2
Copy link

equal-l2 commented Jul 4, 2023

ただ、一人のRustaceanとしては、見切り発車した結果「Rustで書き直してみたけど思ったより良くならないな〜」とがっかりされてしまうのではないか、という危惧があって一連のコメントをするに至ったかたちです。

@misskey-dev misskey-dev locked and limited conversation to collaborators Jul 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
packages/backend Server side specific issue/PR 🐢Performance Efficiency related issue/PR 💚Refactor Rewriting code without changing behavior
Projects
None yet
Development

No branches or pull requests