Hello,

Is it possible to run an explain plan on a prepared statement (in postgres)?

Let's say I have the following setup:

ds = db['select * from my_table where id = ?', :$id]
ps = ds.prepare(:select, :my_prepared_statement)

I can do `ps.call(id: 123)` but as far as I can tell, there is no 
equivalent syntax for explain.

It is possible to do the explain manually, but there are multiple steps and 
they are a bit clunky:

# Step 1: create the prepared statement in the db - otherwise this is not 
done until the ps.call, as far as I can tell
db["prepare my_prepared_statement as #{ps.prepared_sql}"].all

# Step 2: actually run the explain
db["explain execute my_prepared_statement(123)"].all

Ideally, there would be something like `ps.explain(id: 123)`.  Any advice?

Thanks,
Rafe

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to