Skip to main content
Participant
August 7, 2013
解決済み

CF_SQL_INTEGER v/s CF_SQL_NUMERIC ?

  • August 7, 2013
  • 返信数 1.
  • 3914 ビュー

Hello everyone,

Two months back, in my project I had changed CF_SQL_INTEGER to CF_SQL_NUMERIC for entire application. Now I am noticing significant perfromance degradation. Page are taking more time to load than before.

Any idea/information on this will really help me a lot.

Thanks in advance !

Sonu

このトピックへの返信は締め切られました。
解決に役立った回答 Adam Cameron.

I think you'll find JDBC might be converting your integers to decimals or floats, passing it to the DB and then the DB's gonna be coercing it back to an integer before using it. Which will probably add unnecessary overhead.

Did you check whether CF_SQL_BIGINT would work? It seems to support up to 9223372036854776832 (which is 2^63 + 2 ^10, which is a weird number), which is quite a lot...

--

Adam

返信数 1

Inspiring
August 7, 2013

in my project I had changed CF_SQL_INTEGER to CF_SQL_NUMERIC for entire application.

Why'd you do that? You didn't change all your data from using ints to using floats/decimals, did you?

Without basis for saying so, I would think that integers would perform a lot faster than floats or decimals if for no other reason than they're simpler data types, and require a lot less monkeying around to get them into a state the computer can work with (ie: binary).

--

Adam

sonu_agarwal作成者
Participant
August 7, 2013

Hi Adam,

Thanks for your quick response. Actually sql type was changed because there was a high possibility that  data could extend the integer limit in CF. I assumed that cf_sql_numeric would behave exactly as cf_sql_integer with more larger value limit.

Sonu

Adam Cameron.解決!
Inspiring
August 7, 2013

I think you'll find JDBC might be converting your integers to decimals or floats, passing it to the DB and then the DB's gonna be coercing it back to an integer before using it. Which will probably add unnecessary overhead.

Did you check whether CF_SQL_BIGINT would work? It seems to support up to 9223372036854776832 (which is 2^63 + 2 ^10, which is a weird number), which is quite a lot...

--

Adam