I'm using the ODBC driver with FreeTDS by Brainman (http://code.google.com/p/odbc), and I'm noticing that my initial DB stored procedure call is slow, and the other ones are as fast.
Here are the results of a test:
=== RUN TestLoadElitePartner
ELAPSED TrafficCheck: 456.0261ms
ELAPSED LoadEliteInfo: 123.0071ms
ELAPSED LiveFeed: 128.0073ms
--- PASS: TestLoadElitePartner (0.71 seconds)
PASS
The first call is 456ms, and the subsequent calls are more realistic, at ~125ish each, but still a bit slow. If I SWAP the order that these three db queries are called, the first one is always slow (~450ms) and the subsequent ones faster (~125ms), assumedly due to connection pooling.
Is there a way to FIX the initial call being THAT slow? 450ms does not seem reasonable to me.
My DB connection string is directly to an IP address, so this is not a DNS issue. I've read on http://freetds.schemamania.org/userguide/seemtooslow.htm that DNS and logging are the main issues that FreeTDS can be slow, but I do not have logging enabled and I am going directly off IP. Is there anything else I can do to optimize my ODBC/FreeTDS?