# LogicTest: 5node-dist 5node-dist-opt 5node-dist-metadata

###################
# CREATE STATISTICS
###################

statement ok
CREATE TABLE a (id INT PRIMARY KEY, x INT, y INT, INDEX x_idx (x, y))

statement ok
CREATE STATISTICS s1 ON id FROM a

statement ok
CREATE STATISTICS __auto__ FROM a

# verify statistics creation is logged
##################
query IIT
SELECT "targetID", "reportingID", "info"
FROM system.eventlog
WHERE "eventType" = 'create_statistics'
ORDER BY "timestamp"
----
53  1  {"StatisticName":"s1","Statement":"CREATE STATISTICS s1 ON id FROM a"}
53  1  {"StatisticName":"__auto__","Statement":"CREATE STATISTICS __auto__ FROM a"}

statement ok
DROP TABLE a
