I've pushed a cleaned up version of the fix.
I had to make some adjustments in the backbranches, because the way we
store the analyzed statistics evolved, and RemoveStatisticsById() used
to do everything. I ended up introducing RemoveStatisticsDataById() in
the backbranches too, but only as a stat
On 11/8/23 20:58, Tom Lane wrote:
> Tomas Vondra writes:
>> On 11/8/23 16:52, Tom Lane wrote:
>>> Shouldn't DROP STATISTICS be taking a lock on the associated table
>>> that is strong enough to lock out ANALYZE?
>
>> Yes, I think that's the correct thing to do. I recall having a
>> discussion abo
Tomas Vondra writes:
> On 11/8/23 16:52, Tom Lane wrote:
>> Shouldn't DROP STATISTICS be taking a lock on the associated table
>> that is strong enough to lock out ANALYZE?
> Yes, I think that's the correct thing to do. I recall having a
> discussion about this with someone while working on the p
On 11/8/23 16:52, Tom Lane wrote:
> Tomas Vondra writes:
>> On 11/8/23 16:10, Justin Pryzby wrote:
>>> I found this in our logs, and reproduced it under v11-v16.
>>>
>>> CREATE TABLE t(a int, b int);
>>> INSERT INTO t SELECT generate_series(1,999);
>>> CREATE STATISTICS t_stats ON a,b FROM t;
>>>
Tomas Vondra writes:
> On 11/8/23 16:10, Justin Pryzby wrote:
>> I found this in our logs, and reproduced it under v11-v16.
>>
>> CREATE TABLE t(a int, b int);
>> INSERT INTO t SELECT generate_series(1,999);
>> CREATE STATISTICS t_stats ON a,b FROM t;
>>
>> while :; do psql postgres -qtxc "ANALY
On 11/8/23 16:10, Justin Pryzby wrote:
> I found this in our logs, and reproduced it under v11-v16.
>
> CREATE TABLE t(a int, b int);
> INSERT INTO t SELECT generate_series(1,999);
> CREATE STATISTICS t_stats ON a,b FROM t;
>
> while :; do psql postgres -qtxc "ANALYZE t"; done &
> while :; do psq
I found this in our logs, and reproduced it under v11-v16.
CREATE TABLE t(a int, b int);
INSERT INTO t SELECT generate_series(1,999);
CREATE STATISTICS t_stats ON a,b FROM t;
while :; do psql postgres -qtxc "ANALYZE t"; done &
while :; do psql postgres -qtxc "begin; DROP STATISTICS t_stats"; done