On Jan 5, 2008 1:25 PM, Ted Zlatanov <[EMAIL PROTECTED]> wrote: > I realize much of this question belongs to database-specific domains, > but here goes: I want RDBO insert operations to be faster. I need to > load thousands of records per second into a database.
The first thing to investigate is using plain DBI. If that's not fast enough, then RDBO will never be any faster so you'll have to look elsewhere. The second thing to consider is bulk loading rather than INSERT statements. You can perhaps use RDBO to produce the (usually db-specific) bulk-load files themselves, then point the database at the files using DBI and whatever the "load from file" syntax is for your db. > For example, say I have an order O100 with a single product P100 named > "car." If I say (in pseudocode) load(O100).product("car"), and we've > already seen that P100 is "car," the extra SELECT RDBO will normally do > here should not happen. If we don't know P100 is "car" yet, RDBO can do > the normal SELECT+INSERT cycle, of course. I have not seen a way to do > this automatically in RDBO, and I think it is a common case. I don't think I follow your example. Give me a non-psuedocode example and I can probably tell you how to avoid any unnecessary SELECt statements. > I think this optimization would save me at least 10 SELECTs per record > because the products repeat very often. You can always make your product class inherit from Rose::DB::Object::Cached, so each product will only be SELECTed once. (This assumes you're actually load()ing the products, as opposed to getting them with a JOIN via with => ... etc.) -John ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Rose-db-object mailing list Rose-db-object@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rose-db-object