00:08:55
icon

ゆれ?

00:14:05
icon

6.9秒も動いているらしい。
SELECT SUM("account_stats"."statuses_count") FROM "accounts" INNER JOIN "account_stats" ON "account_stats"."account_id" = "accounts"."id" WHERE "accounts"."domain" IS NULL

00:24:18
icon

Explainの結果
Aggregate (cost=37791.30..37791.31 rows=1 width=32)
-> Nested Loop (cost=0.42..37791.30 rows=1 width=8)
-> Seq Scan on accounts (cost=0.00..37788.66 rows=1 width=8)
Filter: (domain IS NULL)
-> Index Scan using index_account_stats_on_account_id on account_stats (cost=0.42..2.64 rows=1 width=16)
Index Cond: (account_id = accounts.id)

00:28:01
icon

bingチャットの回答
Seq Scan on accountsという行は、accountsテーブルの全ての行をスキャンしていることを示しています。これは、accountsテーブルにdomain列にインデックスが貼られていないことを意味します。
Index Scan using index_account_stats_on_account_id on account_statsという行は、account_statsテーブルの全ての行をインデックススキャンしていることを示しています。これは、account_statsテーブルにaccount_id列にインデックスが貼られていることを意味します。
Aggregateという行は、account_statsテーブルからstatuses_count列の値を集計していることを示しています。これは、account_statsテーブルにstatuses_count列にインデックスが貼られていないことを意味します。

00:28:10
icon

これらの問題を解決するためには、accountsテーブルにdomain列にインデックスを貼る、account_statsテーブルにstatuses_count列にインデックスを貼るなどの方法があります。

00:30:31
icon

うちのアプリ、文字数オーバーの時にエラー返さないな。

20:45:19
icon

かえる。

23:14:52
icon

情弱なのでarrows Nをいつでもカエドキプログラムで白ロム購入しました。

23:40:11
icon

初回全話無料のマンガアプリ「少年ジャンプ+」で「[43話]タヌキツネのゴン」を読んでます! shonenjumpplus.com/red/content

23:53:36
icon

初回全話無料のマンガアプリ「少年ジャンプ+」で「[第34話]幼稚園WARS」を読んでます! shonenjumpplus.com/red/content