Skip to content
Snippets Groups Projects
Commit abafd0ac authored by Vytor Calixto's avatar Vytor Calixto :space_invader:
Browse files

:racehorse: Change /enrollment query to be faster

parent 654cbb29
No related branches found
No related tags found
2 merge requests!116Release v1.0.0,!44Feature multiple where
Pipeline #
......@@ -275,13 +275,13 @@ rqf.addField({
enrollmentApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
log.debug(req.sql.toParam());
req.sql.field('COUNT(matricula.id)', 'total')
req.sql.field('COUNT(*)', 'total')
.field("'Brasil'", 'name')
.field('matricula.ano_censo', 'year')
.from('matricula')
.group('matricula.ano_censo')
.order('matricula.ano_censo')
.where('matricula.tipo=0 OR matricula.tipo=1 OR matricula.tipo=2 OR matricula.tipo=3');
.where('matricula.tipo<=3');
next();
}, query, id2str.transform(true), response('enrollment'));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment