Re: pg_class.reltuples of brin indexes

2023-12-30 Thread Michael Paquier
On Sun, Dec 31, 2023 at 02:08:41AM +0100, Tomas Vondra wrote: > I'm not sure. I think the current behavior is (still) wrong - I just > rediscovered it during testing BRIN. I haven't checked, but I guess GIN > is still affected too. > > What's not clear to me is if this is merely cosmetic issue (ma

Re: pg_class.reltuples of brin indexes

2023-12-30 Thread Tomas Vondra
On 11/21/23 21:48, Bruce Momjian wrote: > On Tue, Mar 27, 2018 at 08:58:11PM +0900, Masahiko Sawada wrote: >> ... >> >> If I understand correctly pg_class.reltuples of indexes should have >> the number of index tuples but especially for brin indexes it would be >> hard to estimate it in the analyze

Re: pg_class.reltuples of brin indexes

2023-11-21 Thread Bruce Momjian
On Tue, Mar 27, 2018 at 08:58:11PM +0900, Masahiko Sawada wrote: > Hi, > > I found that pg_class.reltuples of brin indexes can be either the > number of index tuples or the number of heap tuples. > > =# create table test as select generate_series(1,10) as c; > =# create index test_brin on tes

Re: pg_class.reltuples of brin indexes

2018-03-28 Thread Masahiko Sawada
On Tue, Mar 27, 2018 at 11:28 PM, Alvaro Herrera wrote: > Tom Lane wrote: >> Tomas Vondra writes: >> > I think number of index tuples makes sense, as long as that's what the >> > costing needs. That is, it's up to the index AM to define it. But it >> > clearly should not flap like this ... >> >>

Re: pg_class.reltuples of brin indexes

2018-03-27 Thread Alvaro Herrera
Tom Lane wrote: > Tomas Vondra writes: > > I think number of index tuples makes sense, as long as that's what the > > costing needs. That is, it's up to the index AM to define it. But it > > clearly should not flap like this ... > > > And it's not just BRIN. This is what I get with a GIN index: >

Re: pg_class.reltuples of brin indexes

2018-03-27 Thread Tom Lane
Tomas Vondra writes: > I think number of index tuples makes sense, as long as that's what the > costing needs. That is, it's up to the index AM to define it. But it > clearly should not flap like this ... > And it's not just BRIN. This is what I get with a GIN index: Sounds like the same kind of

Re: pg_class.reltuples of brin indexes

2018-03-27 Thread Tomas Vondra
On 03/27/2018 01:58 PM, Masahiko Sawada wrote: > Hi, > > I found that pg_class.reltuples of brin indexes can be either the > number of index tuples or the number of heap tuples. > > =# create table test as select generate_series(1,10) as c; > =# create index test_brin on test using brin (c);