473,505 Members | 14,686 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3242
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3845
by: anagai | last post by:
hi Isnt it true that floating type can generate rounding errors if the values are rounded to like the 10th decimal. Since currency is rounded only to the 2nd decimal why must i worry about using...
687
22814
by: cody | last post by:
no this is no trollposting and please don't get it wrong but iam very curious why people still use C instead of other languages especially C++. i heard people say C++ is slower than C but i can't...
9
2219
by: Klaus Bonadt | last post by:
I have found strange behaviour in casting floating point values in C++ 6.0 to int: If I enter in the watch window while debugging in version 6.0 the following term: (1.4 - 1.0) * 10.0 the...
7
1961
by: Hiten | last post by:
Hi please check ffollowing conditon variable float1 and float2 holds user entered value..... Answer=float1 * float2; //output must be 8.5 output must to be 8.5 but it has 8.500002, i am...
9
1768
by: David Veeneman | last post by:
I'm working on a project that uses floating-point values (doubles), and I'm being driven crazy by something pretty basic. I understand that it's in the nature of floating-point calculations to...
3
311
by: alex | last post by:
hi friends ... i am facing a problem while detecting floating point operations in my project, please help me. i want to find out the places in my C/C++ project where i am doing floating...
39
3519
by: rembremading | last post by:
Hi all! The following piece of code has (for me) completely unexpected behaviour. (I compile it with gcc-Version 4.0.3) Something goes wrong with the integer to float conversion. Maybe somebody...
6
17033
by: Matthew | last post by:
Hi, I want to change the precision level of floating point variables and calculations which is done in php.ini. However the server I rent for my domain does not give me access to php.ini,...
6
1489
by: fred8865 | last post by:
Hi all, I understand that due to different arithmetic used in floating points they are just approximations. Hence, 180/100=1 in my python interpreter. How can I tackle this problem of inaccurate...
0
7216
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7018
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
4699
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1528
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
407
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.