When I run function to get data below
const [users, diaries, comments, likes, step] =
await Promise.all([
await supabase.rpc("get_users"),
await supabase.rpc("get_period_diaries", {
mondaysecs: monday,
sundaysecs: sunday,
}),
await supabase.rpc("get_period_comments_month_diary_three", {
mondaysecs: monday,
sundaysecs: sunday,
}),
await supabase.rpc("get_period_likes_month_diary_three", {
mondaysecs: monday,
sundaysecs: sunday,
}),
await supabase.rpc("get_period_steps", {
weekdays: weekDays,
}),
]);
It works fine.
But when I run as adding one more field invitations
,
const [users, diaries, comments, likes, steps, invitations] =
await Promise.all([
await supabase.rpc("get_users"),
await supabase.rpc("get_period_diaries", {
mondaysecs: monday,
sundaysecs: sunday,
}),
await supabase.rpc("get_period_comments_month_diary_three", {
mondaysecs: monday,
sundaysecs: sunday,
}),
await supabase.rpc("get_period_likes_month_diary_three", {
mondaysecs: monday,
sundaysecs: sunday,
}),
await supabase.rpc("get_period_steps", {
weekdays: weekDays,
}),
await supabase.rpc("get_period_invitations", {
mondaysecs: monday,
sundaysecs: sunday,
}),
]);
It throws error.
"error": { "code": "57014", "details": null, "hint": null, "message": "canceling statement due to statement timeout" },
But it comes with comments
part.
comments has the most huge data among them.
So other fields returns right data but comments return ‘null’.
I don’t know why as having same data of comments between 1st query and 2nd query, only 2nd query returns null.
And When I check statement_timeout
with query show statement_timeout
it is 2min.
Should I extend it more?