Timeline for How can I improve the performance of this query?
Current License: CC BY-SA 4.0
15 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 14, 2021 at 17:24 | answer | added | Brian | timeline score: 2 | |
Jun 14, 2021 at 17:23 | comment | added | Brian | Using WHERE EXISTS() instead of a JOIN so you can get rid of DISTINCT is one option since you are not returning anything from the joined table. | |
Jun 14, 2021 at 17:08 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
May 12, 2021 at 11:41 | answer | added | Phill W. | timeline score: 1 | |
May 11, 2021 at 23:03 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Jan 11, 2021 at 1:01 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Feb 3, 2020 at 17:23 | comment | added | jjanes | It is not clear to me that you are going to get much faster than one of the two plans you already have. You could still turn off JIT, and maybe get more parallel workers to be thrown at it, if you have enough CPUs to warrant that. | |
Jan 30, 2020 at 21:37 | comment | added | rodney757 | @jjanes It is run pretty often so faster is better. I added the results of your suggestions to the OP | |
Jan 30, 2020 at 21:35 | history | edited | rodney757 | CC BY-SA 4.0 |
edit based on comments
|
Jan 30, 2020 at 17:08 | comment | added | jjanes |
Using the primary key index on "record" might be better than the hash join. What happens if you do set enable_seqscan = off before running the query? Please do EXPLAIN (ANALYZE, BUFFERS) . And turn track_io_timing to on first if you can.
|
|
Jan 30, 2020 at 17:01 | comment | added | jjanes | How fast do you need it to be? | |
Jan 30, 2020 at 17:01 | comment | added | jjanes | JIT is likely to be slowing you down more than speeding you up. Try turning that off. | |
Jan 30, 2020 at 15:25 | answer | added | zsheep | timeline score: 0 | |
Jan 30, 2020 at 15:03 | comment | added | Laurenz Albe | I think that is pretty good for a query like that. | |
Jan 30, 2020 at 14:31 | history | asked | rodney757 | CC BY-SA 4.0 |