Yes, we did turn off identifier quoting in our Dataset class - Teradata 
doesn't like it at all :-)

After switching to double underscore notation with a symbol as described 
above, the two queries are no longer there - awesome.  Interested to know 
why that's working that way - I'll make sure to spend some time debugging 
to get to understand Sequel better there.

I'll also look further into the new schema_caching extension - looks 
promising.

Thanks so much for your quick response and assistance!
John

On Tuesday, November 6, 2012 11:52:27 AM UTC-5, Jeremy Evans wrote:
>
> On Tuesday, November 6, 2012 7:59:44 AM UTC-8, JD wrote:
>>
>> 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!
>>
>
> First, it looks like you aren't quoting identifiers in your database.  I'm 
> assuming you disabled that on purpose, maybe because :'db_name.table_def' 
> wouldn't work without it?  In Sequel, it's recommend that you specify 
> qualified identifiers with the double underscore notation: 
> :db_name__table_def, which should work whether or not you are quoting 
> identifiers.  This might also be affecting your duplicate queries issue.
>
> You could use the schema_caching extension to cache the schema, so Sequel 
> doesn't need to parse it from the database every time.  Of course, you need 
> to be sure to update the cache when the database schema actually changes.  
> This also depends on Sequel supporting schema parsing for the database.  
> Assuming that the JDBC Teradata adapter implements the JDBC metadata 
> methods, schema parsing should work (try DB.schema(:db_name__table_def) to 
> make sure).
>
> Thanks,
> Jeremy
>

-- 
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/-/Hikf99Xq-QwJ.
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