Slow a question, any way to speed up

Actually, this question takes 40 sec approx to load . Is there any way to load the ticket quickly.

Here, is the query for the question.
select t.created_at,sum(count) over (order by created_at asc) as acc_count,sum(sum) over (order by created_at asc) as acc_sum,round(sum(sum) over (order by created_at asc)/sum(count) over (order by created_at asc)) as acc_avg
from (SELECT (CAST(date_trunc('week', CAST((CAST("Question 243"."created_at" AS timestamp) + (INTERVAL '1 day')) AS timestamp)) AS timestamp) + (INTERVAL '0 day')) AS "created_at", count(distinct "Question 243"."id") AS "count", sum("source"."total_score")/ count(distinct "Question 243"."id") AS "average",sum("source"."total_score") as "sum"
FROM (select linkedin_response ->>'id' as id, total_score from public.lead_scoring_prod_profiles
) "source" RIGHT JOIN (select (pc.id)::text, created_at from schema_linkedin.persons pc where pc.is_poi=true and pc.archive=false) "Question 243" ON "source"."id" = "Question 243"."id"
GROUP BY (CAST(date_trunc('week', CAST((CAST("Question 243"."created_at" AS timestamp) + (INTERVAL '1 day')) AS timestamp)) AS timestamp) + (INTERVAL '0 day'))
ORDER BY (CAST(date_trunc('week', CAST((CAST("Question 243"."created_at" AS timestamp) + (INTERVAL '1 day')) AS timestamp)) AS timestamp) + (INTERVAL '0 day')) ASC)t

Also, attached Diagnostic info-
{
"browser-info": {
"language": "en-GB",
"platform": "MacIntel",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36",
"vendor": "Google Inc."
},
"system-info": {
"file.encoding": "UTF-8",
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "11.0.12+7",
"java.vendor": "Eclipse Foundation",
"java.vendor.url": "https://adoptium.net/",
"java.version": "11.0.12",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "11.0.12+7",
"os.name": "Linux",
"os.version": "5.4.0-1057-aws",
"user.language": "en",
"user.timezone": "GMT"
},
"metabase-info": {
"databases": [
"h2",
"postgres",
"mongo"
],
"hosting-env": "unknown",
"application-database": "postgres",
"application-database-details": {
"database": {
"name": "PostgreSQL",
"version": "12.7"
},
"jdbc-driver": {
"name": "PostgreSQL JDBC Driver",
"version": "42.2.18"
}
},
"run-mode": "prod",
"version": {
"date": "2021-09-09",
"tag": "v0.40.4",
"branch": "release-x.40.x",
"hash": "16d2e53"
},
"settings": {
"report-timezone": "Asia/Calcutta"
}
}
}

Hi @varnika
You should upgrade to at least 0.40.5. Latest release is 0.41.1: https://github.com/metabase/metabase/releases
There's constantly performance improvements in most releases.
Otherwise try reading these articles:
https://www.metabase.com/learn/administration/making-dashboards-faster.html
https://www.metabase.com/learn/sql-questions/sql-best-practices.html