Timeline for Nokogiri crawler
Current License: CC BY-SA 3.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 5, 2014 at 12:12 | comment | added | RubberDuck | Yes. I don't know how MySQL handles it, but some RDBMS will cache as hoc queries like this and only reuse them if the text matches exactly. It causes cache bloat and extra overhead to calculate a new query plan every time it's executed. You're answer doesn't suffer from this @200_success, because you're using a prepared query. There are other reasons to use sprocs rather than prepared queries though. Like I said, it could be debated endlessly. I say let the database dev do the database development. | |
Jul 5, 2014 at 11:53 | comment | added | 200_success | A cached plan for a single-table insert? | |
Jul 5, 2014 at 11:52 | comment | added | RubberDuck | @200_success this could be debated endlessly, but using a sproc guarantees a cached plan will be used. Otherwise, depending on the db's config, it may or may not use a cached plan. | |
Jul 5, 2014 at 10:30 | comment | added | Phrancis | Simplify the Ruby script, if nothing else. But I think it is good practice to use a stored procedure for repeat operations. | |
Jul 5, 2014 at 10:28 | comment | added | 200_success | It's a simple insert into a single table. Why complicate it by creating a stored procedure to do the same thing? | |
Jul 4, 2014 at 16:43 | history | answered | Phrancis | CC BY-SA 3.0 |