MonetDB / MonetDB

This is the official mirror of the MonetDB Mercurial repository. Please note that we do not accept pull requests on github. The regression test results can be found on the MonetDB Testweb https://www.monetdb.org/testweb/web/status.php .For contributions please see: https://www.monetdb.org/documentation/dev-guide/
http://www.monetdb.org
Other
380 stars 55 forks source link

ANALYZE MERGE TABLE is not persistent #7062

Open ankravch opened 3 years ago

ankravch commented 3 years ago

Describe the bug ANALYZE on merge table throws 'MERGE TABLE is not persistent'

To Reproduce

create table table t(v int);
insert into t values(1),(2),(3);

create merge table mt(v int);
alter table mt add table t;

analyze sys.mt;

Expected behavior

Software versions

yzchang commented 3 years ago

I'm not sure, but it makes sense to me that ANALYZE would only analyse a normal SQL table, i.e. persistent. The error message is a bit funny though.

ankravch commented 3 years ago

I am following MonetDB tutorial at https://www.monetdb.org/Documentation/ServerAdministration/DistributedQueryProcessing/DataPartitioning. And at the very bottom it says "To prepare these statistics, the user has to run the ANALYZE command over a MERGE TABLE".

PedroTadim commented 3 years ago

The analyze command throws error for merge tables for a long time (I found doing this as back as Mar2018 release). Also the error message has been the same before my changes (why is it funny?). This can be either a documentation mistake, because the analyze command should be applied to the children tables, or we can add support for merge tables, by applying it recursively.

yzchang commented 3 years ago

The error message is not straightforward, requires a second thought.

I was also thinking that translate an ANALYZE into ANALYZE should be easy to do. But