First off, sorry for the tone of my emails yesterday, my work stress
has gotten retarded and I kinda went off the deep end there in a few
of my replies.

By "totally jacked" I didn't necessarily mean Sequel.  It could be the
Ruby DB driver or even C-level DB lib.  What version of Postgres is
that on? 8.4? 8.3?

I do have benchmarking data just not in front of me.  I've done a ton
of benchmarking with Oracle and the results were the exact opposite of
what you saw.  Roughly 30% faster on Oracle across the board.  I also
benchmarked Postgres, although not as extensively as Oracle.  It is
definitely possible Oracle's bind var implementation is more efficient
than PostgreSQL's.

Based on your numbers, I do agree that simple queries with integers
appear to perform better in Postgres.  I also did more complex
queries; strings, blobs, joins, etc, and the more complex the query,
the more bind vars have an advantage.  Also there's a big advantage
when reusing :named bind vars, I have a great example I thought of
last night that I actually wanted to post here.

Re: Implementation and your suggestions about overriding literal()
instead of hooking into placeholder_literal_string_sql, the problem I
saw with overriding literal() is that it's used a ton of places in
Sequel where bind variables are illegal, such as escaping columns for
CREATE TABLE, SELECT AS, etc.  Also, for bind variables, you need to
know the context you're being called in, eg, are you being asked to
bind ?,? or :name, because what you'll want to do is different (hence
why I created two callbacks).  Oracle OCI supports either positional
or named binding, for example, with different low-level calls.

So I'm not opposed to going about things differently, but we do need
to hook in at a level where you can tell the context where you're
being called.

As for this:

   Dataset.filter{id > 1}.all

I'm having a hard time tracing thru the code for that, is that
Sequel.virtual_row and SQL::VirtualRow?

-Nate




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to