0

I have 2 tables one with around 1m entries and other around 4m. I want to join these tables in a material view. But the material view creation time is taking too long ~4 hours.

Slow postgres query when joining large tables

i don't see the indexes being used, which is fine as per the answer in link above when join involves whole tables then indices dont help so much.

So what is the workaround? My tables have time-eries data. Would TimeScaleDB extension be of any help? Any other suggestion to improve the performance ?

6
  • Can you show the EXPLAIN (ANALYZE, BUFFERS), or at least the EXPLAIN, for the query? Commented Jul 13, 2020 at 17:06
  • It is a duplicate of the same question posted to another stackexchange community: dba.stackexchange.com/questions/270862/… Can you close one of them? Commented Jul 14, 2020 at 6:50
  • yes i posted at both places. Wasn't sure which place is the correct one. Sorry Commented Jul 14, 2020 at 7:42
  • To me it is more related to DBA than SO. So far there are no details in the question, but it seems to me there is a room for redesigning. Commented Jul 14, 2020 at 8:50
  • @k_rus, yeah I agree it is more DBA, hence i have explained the schema and the view in the other post. If you want you could mark this one as duplicate and please answer in the the other post on DBA if you suggest a redesign or some performance boost? Commented Jul 14, 2020 at 10:22

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.