468,544 Members | 1,810 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,544 developers. It's quick & easy.

Should floating point calculations be doing in sql or C#?

Hi,

I would like to know, if I need to do some floting point operations
(mainly multiplication and division) on each roll of a table, should I
read the data out from the DB and do the calculation with a programming
language, say C#, or should I just use sql to do it on the sql server.

An obvious advantage of doing it in the sql server is that you dont
need to transfer the data between the sql server and he application
server.

But I am not sure if there are any other factors that will override
this advantage: like the performance of doing lots of floting point
operations in sql server.

How is the performance of doing floting point operations in sql server
comparing to C# or other languages?

Also are there any other factors that should be considered for this
case and
are there any other advantages to do this is sql server or in c#?

Thanks
Benny

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #1
1 3082
Benny wrote:
Hi,
I would like to know, if I need to do some floting point operations
(mainly multiplication and division) on each roll of a table, should I
read the data out from the DB and do the calculation with a programming
language, say C#, or should I just use sql to do it on the sql server.

An obvious advantage of doing it in the sql server is that you dont
need to transfer the data between the sql server and he application
server.
That's it. The biggest performance mistake with RDBMSes is to treat
them like dumb filing systems. If you can define your operation so
the DBMS can process the table using standard SQL, with set-based
processing, you will be using what DBMSes are designed to do fast.
You build your sawmill where the trees are. The floating point operations
*will* be done in C/C++. That's what the DBMS is written in, and they don't
re-invent the wheel to multiply IEEE floats... If your calculation SQL
is in a stored procedure, it's query plan will be pre-compiled and
ready to re-use.
Joe Weinstein at BEA
But I am not sure if there are any other factors that will override
this advantage: like the performance of doing lots of floting point
operations in sql server.

How is the performance of doing floting point operations in sql server
comparing to C# or other languages?

Also are there any other factors that should be considered for this
case and
are there any other advantages to do this is sql server or in c#?

Thanks
Benny

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by anagai | last post: by
687 posts views Thread by cody | last post: by
9 posts views Thread by Klaus Bonadt | last post: by
9 posts views Thread by David Veeneman | last post: by
39 posts views Thread by rembremading | last post: by
6 posts views Thread by fred8865 | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by UniDue | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.