Closed nuko-yokohama closed 5 years ago
I fixed this and confirmed that your test case was passed.
===
issue25=# CREATE TABLE table_a (id int primary key, data interval, dummy text);
CREATE TABLE
issue25=# INSERT INTO table_a VALUES (generate_series(1, 100000), ( ROUND(random()::numeric,3)::text || ' year')::interval, repeat(' ', 80));
INSERT 0 100000
issue25=# CREATE VIEW table_a_v AS SELECT COUNT(id), MAX(data), MIN(data), SUM(data), AVG(data) FROM table_a;
CREATE VIEW
issue25=# CREATE MATERIALIZED VIEW table_a_mv AS SELECT COUNT(id), MAX(data), MIN(data), SUM(data), AVG(data) FROM table_a;
SELECT 1
issue25=# CREATE INCREMENTAL MATERIALIZED VIEW table_a_ivm AS SELECT COUNT(id), MAX(data), MIN(data), SUM(data), AVG(data) FROM table_a;
SELECT 1
issue25=#
issue25=# \d
List of relations
Schema | Name | Type | Owner
--------+-------------+-------------------+--------
public | table_a | table | yugo-n
public | table_a_ivm | materialized view | yugo-n
public | table_a_mv | materialized view | yugo-n
public | table_a_v | view | yugo-n
(4 rows)
issue25=# SELECT 'v' as "view type", * FROM table_a_v
issue25-# UNION
issue25-# SELECT 'mv' as "view type", * FROM table_a_mv
issue25-# UNION
issue25-# SELECT 'imv' as "view type", * FROM table_a_ivm
issue25-# ;
view type | count | max | min | sum | avg
-----------+--------+--------+----------+--------------------+----------------------------
imv | 100000 | 1 year | 00:00:00 | 45743 years 2 mons | 5 mons 14 days 16:12:34.56
mv | 100000 | 1 year | 00:00:00 | 45743 years 2 mons | 5 mons 14 days 16:12:34.56
v | 100000 | 1 year | 00:00:00 | 45743 years 2 mons | 5 mons 14 days 16:12:34.56
(3 rows)
issue25=#
issue25=# INSERT INTO table_a VALUES (generate_series(100001, 100010), ( ROUND(random()::numeric, 3)::text || ' year')::interval, repeat(' ', 80));
INSERT 0 10
issue25=# REFRESH MATERIALIZED VIEW table_a_mv;
REFRESH MATERIALIZED VIEW
issue25=#
issue25=# \d
List of relations
Schema | Name | Type | Owner
--------+-------------+-------------------+--------
public | table_a | table | yugo-n
public | table_a_ivm | materialized view | yugo-n
public | table_a_mv | materialized view | yugo-n
public | table_a_v | view | yugo-n
(4 rows)
issue25=# SELECT 'v' as "view type", * FROM table_a_v
issue25-# UNION
issue25-# SELECT 'mv' as "view type", * FROM table_a_mv
issue25-# UNION
issue25-# SELECT 'imv' as "view type", * FROM table_a_ivm
issue25-# ;
view type | count | max | min | sum | avg
-----------+--------+--------+----------+--------------------+------------------------------
imv | 100010 | 1 year | 00:00:00 | 45746 years 7 mons | 5 mons 14 days 16:06:34.5312
mv | 100010 | 1 year | 00:00:00 | 45746 years 7 mons | 5 mons 14 days 16:06:34.5312
v | 100010 | 1 year | 00:00:00 | 45746 years 7 mons | 5 mons 14 days 16:06:34.5312
(3 rows)
@nuko-yokohama Could you please confirm this and close this issue if there is no problem?
I confirmed that it was fixed. Thank you for the response.
Thank you. I'll close this.
Use SELECT to search a table containing an Interval type, and set CREATE INCREMENTAL MATERIALIZED VIEW. After that, if an INSERT is executed for that table, an error occurs in the internal management table of IVM.
Execution exsample.
Execution SQL text.