Hi,

Our team has just started down the path of replacing the ActiveRecord gem 
with Sequel for our project.  We are currently using a Teradata database, 
and as such have had to create a few minor extensions to get things working 
correctly (creating a JDBC::Teradata::Dataset class to house extensions).  
Things seem to be working well so far, however we have noticed that every 
time we initialize a model, it appears to execute the exact same query 
twice while fetching metadata, before executing our actual queries.  We 
have occasional problems with latency in our environment, so we are trying 
to do anything we can to reduce the number of calls.  Any insight would be 
helpful - thanks in advance!


Please see the code below for more details...

executing:

module ABC
  class DEF < Sequel::Model(:'db_name.table_def')
    set_primary_key [:col1, :col2]
  end
end

results in the following:

SELECT TOP 1 * FROM DB_NAME.TABLE_DEF
SELECT TOP 1 * FROM DB_NAME.TABLE_DEF

FYI: Please note that in order to get the "TOP 1" syntax to generate 
instead of the usual "LIMIT 1" (necessary for Teradata), we've overriden 
the SELECT_CLAUSE_METHODS within our new Dataset class and provided the 
appropriate code.

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sequel-talk/-/qBhu77UxdGkJ.
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