Hello, Everyone,
I have a problem with H2's views. During running tests some new data are
inserted to a table used by one view. This view is defined as follows:
SELECT ends.mindate + CAST(X AS INT) -1 AS day
> FROM
> (SELECT MIN (start_date) -1 AS mindate,
> MAX (end_date) +1 AS maxdate
> FROM table
> ) ends
> CROSS JOIN SYSTEM_RANGE(0,
> (SELECT MAX (end_date) +1 AS maxdate FROM table
> ) -
> (SELECT MIN (start_date) -1 AS mindate FROM table
> ) +2)
>
>
There is another view which is based on the first one:
SELECT CALENDAR_TYPE,
PERIODID,
MIN (day) AS start_date,
MAX (day)+1 AS end_date
FROM
(SELECT day,
'WEEKLY' AS calendar_type,
least((day_of_year(day) - 1) / 7 + 1, 52) AS periodid
FROM view_days
UNION
(SELECT day, 'MONTHLY' AS calendar_type, MONTH(day) AS periodid FROM
view_days
)
UNION
(SELECT day,
'QUARTERLY' AS calendar_type,
quarter(day) AS periodid
FROM view_days
)
)
GROUP BY CALENDAR_TYPE,
PERIODID,
extract (YEAR FROM day)
Unfortunately, the latter does not include new inserted data. They affect
only base view, view_days. When I stop my tests for a while, it sometimes
has refreshed data. It seems to be a cache problem but I am not sure. Could
you help me to solve it?
Best,
Pawel
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.