Re: Apparent missed query optimization with self-join and inner grouping

2020-08-01 Thread Tom Lane
Zack Weinberg writes: > For each (experiment_id, url_id) pair for some small subset of the > experiment_ids, I need to query the full_url_id corresponding to the > *largest* value of redirect_num. The query planner does something > reasonable with this SELECT: > => explain (analyze, verbose) >

Re: Apparent missed query optimization with self-join and inner grouping

2020-08-01 Thread Michael Lewis
Subqueries are evaluated separately when they include an aggregate or window function as I understand it. I agree that it would be helpful in your case if that outside qual was pushed inside. I assume this query is generated by an ORM and you don't just have the option to simply change it?

Re: 12.3 replicas falling over during WAL redo

2020-08-01 Thread Ben Chobot
Alvaro Herrera wrote on 8/1/20 9:35 AM: On 2020-Aug-01, Ben Chobot wrote: We have a few hundred postgres servers in AWS EC2, all of which do streaming replication to at least two replicas. As we've transitioned our fleet to from 9.5 to 12.3, we've noticed an alarming increase in the frequenc

Re: 12.3 replicas falling over during WAL redo

2020-08-01 Thread Alvaro Herrera
On 2020-Aug-01, Ben Chobot wrote: > We have a few hundred postgres servers in AWS EC2, all of which do streaming > replication to at least two replicas. As we've transitioned our fleet to > from 9.5 to 12.3, we've noticed an alarming increase in the frequency of a > streaming replica dying during

12.3 replicas falling over during WAL redo

2020-08-01 Thread Ben Chobot
We have a few hundred postgres servers in AWS EC2, all of which do streaming replication to at least two replicas. As we've transitioned our fleet to from 9.5 to 12.3, we've noticed an alarming increase in the frequency of a streaming replica dying during replay. Postgres will log something lik