Description
Bug Report
When use AbstractQuery::setParameter()
on a query with large number of parameters the preformance are getting really bad.
Q | A |
---|---|
BC Break | no |
Version | 2.6 |
Summary
I have a query that I need to build, this query contains about 8,000 parameters. I use AbstractQuery::setParameter()
method to add each one of these parameters.
Building this query takes long time.
Current behavior
The buggy behaivour happens because each time setParameter()
is called, the method checks whether the parameter is already exists. Checking that it is already exists is done by array_filter
function which basically means that call to setParameter() the code runs over all the parameters array.
How to reproduce
Very is easy. Create a ORM/Query that has 8,000 parameters (each parameter should have a different key)
Expected behavior
After a while you should see an expodential increase of the time it takes to execute setParameter()