Hacker News new | ask | show | jobs
by orcadk 5139 days ago
He already is using prepared statements, that happens under the hood when you use parameterized queries. Problem is the lack of type definition (in the first revision), causing a new compilation for each length of the varchar column.
1 comments

I'm not following... Could you explain a little further? My understanding is that prepared statements will be added to the plan cache, in the same way that stored procs have associated plans for each query on the proc.

One warning about this is that at times you should consider having a new plan generated - especially if the data changes over time.