[FIX] orm.search_count: ignore `limit`, `offset` and most importantly `order`
authorOlivier Dony <odo@openerp.com>
Fri, 1 Aug 2014 10:34:41 +0000 (12:34 +0200)
committerOlivier Dony <odo@openerp.com>
Fri, 1 Aug 2014 10:34:45 +0000 (12:34 +0200)
commite79a3675d13eacfd3d38e9725bbb354c778f0252
treeb93732d7cca713ffdb2535d382490adfdae2a78d
parentf247bdd0b66d3d467de21ed1b966713c42c886aa
[FIX] orm.search_count: ignore `limit`, `offset` and most importantly `order`

These parameters are (or should be) irrelevant for
a search_count(), and they could actually break the
result or make it significantly slower (e.g applying
`order` on large tables).
This fixes a performance regression introduced by
0f43032b.

We could also raise an error offset/limit are
passed in combination with count, but that seems
unnecessary.

Also switched to "SELECT count(1)" for the count
query, as it is simpler and just as fast.
We'd get the same perf with * or any constant value,
as in "SELECT count('me in')", but let's keep it
simple ;-)
openerp/osv/orm.py