Re: [Rails] How to parameterize array with activerecord

2015-10-03 Thread Walther Diechmann
well faisal, either you could http://www.sqlskills.com/blogs/kimberly/plan-cache-adhoc-workloads-and-clearing-the-single-use-plan-cache-bloat/ now and then or look at your queries and try to isolate those hurting your plan cache the most; are they recognizable and the data behind it not too d

Re: [Rails] How to parameterize array with activerecord

2015-10-02 Thread Faisal Mansoor
Thanks walt, Non parametric queries are polluting SQL Server plan cache, which is affecting overall database performance. I understand that parameter count for the IN clause can vary widely, but, parameterizing these queries will substantially reduce than number of generated plans. On Thurs

Re: [Rails] How to parameterize array with activerecord

2015-10-01 Thread Walther Diechmann
Fail to see the use case Faisal - plz elaborate - and keep in mind that Article.where id: [1,2,3,4,5,6,7,8,9,10,11, . . . , 2100] would generate one heck of a parameterized array ;) > Den 02/10/2015 kl. 04.39 skrev Faisal Mansoor : > > Activerecord generates parameterized queries for basic typ

[Rails] How to parameterize array with activerecord

2015-10-01 Thread Faisal Mansoor
Activerecord generates parameterized queries for basic types, but, it does parameterize array types. E.g. Article.where(id: 1) # generates # SELECT "articles".* FROM "articles" WHERE "articles"."id" = $1 [["id", 1]] But, Article.where(id: [1,2]) # generates # SELECT "articles".* FROM "arti