Re: Why Postgres doesn't use TID scan?

2018-12-19 Thread Vladimir Ryabtsev
> The fundamental issue is that "ANY" has two meanings in PG, one of them following the SQL standard and one not: Oh yes, I was aware about two forms but it did not come into my mind, I was thinking I use the same form in both cases since my query returns only one row and column. Thanks for pointi

Re: Why Postgres doesn't use TID scan?

2018-12-19 Thread Andrew Gierth
> "Vladimir" == Vladimir Ryabtsev writes: >> The workaround is to do it like this instead: Vladimir> Strange, I tried to do like this, but the first thing came Vladimir> into my mind was array_agg() not array(): Vladimir> delete from log Vladimir> where ctid = any( Vladimir> selec

Re: Why Postgres doesn't use TID scan?

2018-12-19 Thread Vladimir Ryabtsev
> The workaround is to do it like this instead: Strange, I tried to do like this, but the first thing came into my mind was array_agg() not array(): delete from log where ctid = any( select array_agg(ctid) from ( select ctid from log where timestamp < now() at time zone 'pst'

Re: Why Postgres doesn't use TID scan?

2018-12-19 Thread Andrew Gierth
> "Vladimir" == Vladimir Ryabtsev writes: Vladimir> I can't believe it. Vladimir> I see some recommendations in Internet to do like this well, 90% of what you read on the Internet is wrong. Vladimir> Did it really work in 2011? Are you saying they broke it? Vladimir> It's a shame... Th