Re: [HACKERS] ALTER INDEX .. SET STATISTICS ... behaviour - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] ALTER INDEX .. SET STATISTICS ... behaviour
Date
Msg-id 22858.1496246029@sss.pgh.pa.us
Whole thread Raw
In response to [HACKERS] ALTER INDEX .. SET STATISTICS ... behaviour  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
Responses Re: [HACKERS] ALTER INDEX .. SET STATISTICS ... behaviour  (Alexander Korotkov <a.korotkov@postgrespro.ru>)
List pgsql-hackers
Alexander Korotkov <a.korotkov@postgrespro.ru> writes:
> I've discovered that PostgreSQL is able to run following kind of queries in
> order to change statistic-gathering target for an indexed expression.

> ALTER INDEX index_name ALTER COLUMN expr SET STATISTICS stat_target;

> It's been previously discussed in [1].

> I think this should be fixed not just in docs.  This is why I've started
> thread in pgsql-hackers.  For me usage of internal column names "expr",
> "expr1", "expr2" etc. looks weird.  And I think we should replace it with a
> better syntax.  What do you think about these options?

> ALTER INDEX index_name ALTER EXPRESSION 0 SET STATISTICS stat_target; --
> Refer expression by its number
> ALTER INDEX index_name ALTER EXPRESSION (x + y) SET STATISTICS stat_target;
> -- Refer expression by its definition

Don't like either of those particularly, but what about just targeting
a column by column number, independently of whether it's an expression?
ALTER INDEX myindex ALTER COLUMN 4 SET STATISTICS 1000;
        regards, tom lane



pgsql-hackers by date:

Previous
From: Alexander Korotkov
Date:
Subject: [HACKERS] ALTER INDEX .. SET STATISTICS ... behaviour
Next
From: Alvaro Herrera
Date:
Subject: Re: [HACKERS] [PATCH] relocation truncated to fit: citus buildfailure on s390x