At the moment I am using a MySQL database where I have the following
definitions:
CREATE TABLE IF NOT EXISTS userProcesses (
`id` int(11) NOT NULL auto_increment,
`dateTime` varchar(25) NOT NULL,
`user` varchar(25) NOT NULL,
`noOfProcesses` varchar(25) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `dateUser` (`dateTime`, `user`),
);
CREATE OR REPLACE VIEW totalProcesses AS
SELECT
dateTime,
SUM(noOfProcesses) AS total
FROM
userProcesses
GROUP BY
dateTime
;
The problem is that in the view the index from userProcesses is not used
because the GROUP BY. (I now do not use the view, makes my query about 40
times faster.) Would H2 not have this problem? That would be a good excuse
to migrate from MySQL to H2.
--
Cecil Westerhof
--
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 http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.