How to figure out how long a postgres sql query will take

Sorry for the vague q, but I find myself having to write alot of custom sql queries these days to make zapier "be our backend". Zapier will fail the zap if a query times out. But I dont know a good way to gauge at what scale we will reach 30 seconds. Here is a query in question:
SELECT "proposalId", string_agg("ProposalDateRanges"."from" || ',' || "ProposalDateRanges"."to", ';') FROM "public"."ProposalDateRanges" WHERE "ProposalDateRanges"."proposalId" = '{{169303871__id}}' GROUP by "ProposalDateRanges"."proposalId"
SELECT "proposalId", string_agg("ProposalDateRanges"."from" || ',' || "ProposalDateRanges"."to", ';') FROM "public"."ProposalDateRanges" WHERE "ProposalDateRanges"."proposalId" = '{{169303871__id}}' GROUP by "ProposalDateRanges"."proposalId"
So string_agg will scale with the number of ProposalDateRanges per Proposal, and the whole query depends on how many ProposalDateRanges there are in total Sorry my DB knowledge is rather weak
1 Reply
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server