| Author |
Topic  |
|
whitefang
Enterprise-Level Plonker Who's Not Wrong
272 Posts |
Posted - 04/21/2009 : 11:57:17
|
quote: Originally posted by Peso
And your data analysis is still being done with your application object? And the proper UPSERT is still being done with your application object?
Oh man, those network roundtrips.
E 12°55'05.63" N 56°04'39.26"
TSQL doesn't support upserts but we can package the check, insert, and update into a batch statement from the application object.
At what point are you going to realize that the DB and the AppServer are located in the same datacenter and have massive amounts of bandwidth and very low latencies between them? Network roundtrips are costly if you are using CISCO routers from 1980s. |
 |
|
|
spirit1
Cybernetic Yak Master
Slovenia
11741 Posts |
Posted - 04/21/2009 : 11:59:20
|
no, not better nor more intelligent, just different way of doing things. 
___________________________________________________________________________ Causing trouble since 1980 Blog: http://weblogs.sqlteam.com/mladenp Speed up SSMS development: www.ssmstoolspack.com <- version 1.5 out! |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
Sweden
29156 Posts |
Posted - 04/21/2009 : 12:03:35
|
What are you so afraid of?quote: Originally posted by whitefang
I'm not wrong.
I have never said nor written that everything should be done on DB side. You're dead wrong with that argument. Again. Most of the things you talk about I think should be done DB side.
Heavy duty things like file import should be done DB side. Data cleansing and rinsing should be done DB side.
Why? Beacuse the database server is made for serving you (the client) with the proper data depending on what you want. If you think a database is only storage, why don't you use textfiles as storage in your enterprise application? Why only use the database for half the capacity? Release the database's full potential, deliver data to you. And use database server to handle the external imports. Distribute the load from your application object.
Then the business logic can be handled in your application object. You can also look at it this way. Where should xyz be handled for most performance for the customer? After all, it is the customer who ultimately pays your salary.
E 12°55'05.63" N 56°04'39.26" |
 |
|
|
robvolk
Most Valuable Yak
USA
15566 Posts |
Posted - 04/21/2009 : 12:05:12
|
quote: So you are doing 50 million records inserts with FULL logging AND recovery model in 12 minutes? Your database must be running on the IBM Roadrunner supercomputer.
I do this all the time on a 3 year old DL 585, although it's bulk-logged. I do a number of 100 million row inserts in about 20-25 minutes. The new DL 585 does 100 million rows in under 15 minutes.
Then there's always SSIS:
http://msdn.microsoft.com/en-us/library/dd537533.aspxquote: I'm not wrong. I have a different way of doings things, the better intelligent way.
Yeah, call us back about that when your way can load 1 TB in under 30 minutes. |
 |
|
|
robvolk
Most Valuable Yak
USA
15566 Posts |
Posted - 04/21/2009 : 12:06:34
|
quote: TSQL doesn't support upserts...
It's called the MERGE statement, it's new in SQL 2008. |
 |
|
|
whitefang
Enterprise-Level Plonker Who's Not Wrong
272 Posts |
Posted - 04/21/2009 : 12:08:09
|
That is my point, I've always said a database should be a database and used for CRUD only that includes imports. You're the one polluting with SPs containing business logic and unnecessary crap. I've always said business logic should be handled by application object which you always disagree on.
There's several ways to do imports, I prefer using the application layer to do the import. It's my way, and I find it better for my applications. |
 |
|
|
whitefang
Enterprise-Level Plonker Who's Not Wrong
272 Posts |
Posted - 04/21/2009 : 12:11:29
|
| Anyways, the topic poster got several solutions and chose to implement mine, argument closed. |
 |
|
|
cat_jesus
Aged Yak Warrior
547 Posts |
Posted - 04/21/2009 : 12:23:23
|
quote: Originally posted by whitefang
TSQL doesn't support upserts
I guess I better stop implementing upserts then.
__________________________________________
An infinite universe is the ultimate cartesian product. |
 |
|
|
blindman
Flowing Fount of Yak Knowledge
USA
2365 Posts |
Posted - 04/21/2009 : 12:45:29
|
quote: Originally posted by whitefang
Triggers are bad for debugging (in a properly written application, triggers are not needed. It's just a tool for lazy developers/dbas)
A totally ignorant statement. Do you have any knowledge you haven't picked up reading other developer's blogs?
quote: Originally posted by dineshrajan_it
I have 120 tables so using trigger for all 120 tables will be i dont know?
Not a problem. Run the code in the link below, and it will generate a script for creating all your archive tables and all the necessary triggers to maintain them. Total time for your DB, probably under 15 minutes. http://sqlblindman.pastebin.com/f3b20af45
________________________________________________ If it is not practically useful, then it is practically useless. ________________________________________________ |
 |
|
|
DonAtWork
Flowing Fount of Yak Knowledge
2113 Posts |
|
|
whitefang
Enterprise-Level Plonker Who's Not Wrong
272 Posts |
|
|
robvolk
Most Valuable Yak
USA
15566 Posts |
|
|
whitefang
Enterprise-Level Plonker Who's Not Wrong
272 Posts |
|
|
cat_jesus
Aged Yak Warrior
547 Posts |
Posted - 04/21/2009 : 13:15:44
|
quote: Originally posted by whitefang
If you read the article, you would know that it would apply to triggers in both MS SQL and Oracle. The problems it outlines are present in MS SQL, not only in Oracle. You must have a intelligence level of NULL.
That book is 15 years old.
Why would he take advice for caveman 90's databases?
_____________________________________________
An infinite universe is the ultimate cartesian product. |
 |
|
|
whitefang
Enterprise-Level Plonker Who's Not Wrong
272 Posts |
Posted - 04/21/2009 : 13:17:38
|
quote: Originally posted by cat_jesus
quote: Originally posted by whitefang
If you read the article, you would know that it would apply to triggers in both MS SQL and Oracle. The problems it outlines are present in MS SQL, not only in Oracle. You must have a intelligence level of NULL.
That book is 15 years old.
Why would he take advice for caveman 90's databases?
_____________________________________________
An infinite universe is the ultimate cartesian product.
Yes, but the problems it outlines are still present today. |
 |
|
|
blindman
Flowing Fount of Yak Knowledge
USA
2365 Posts |
Posted - 04/21/2009 : 13:20:12
|
quote: Originally posted by DonAtWork
Not a bad little script for an entry level DBA there blindman. Too bad those triggers are not needed, you lazy entry level DBA.
It was for an extra-credit assignment back in kindergarten. ;)
Can I get a "Lazy DBA" as my sqlteam title????
________________________________________________ If it is not practically useful, then it is practically useless. ________________________________________________ |
 |
|
|
cat_jesus
Aged Yak Warrior
547 Posts |
Posted - 04/21/2009 : 13:26:51
|
quote: Originally posted by whitefang
Yes, but the problems it outlines are still present today.
Really? Which problems are those exactly?
_____________________________________________________________
An infinite universe is the ultimate cartesian product. |
 |
|
|
whitefang
Enterprise-Level Plonker Who's Not Wrong
272 Posts |
|
|
SwePeso
Patron Saint of Lost Yaks
Sweden
29156 Posts |
Posted - 04/21/2009 : 13:31:28
|
quote: Originally posted by whitefang
If you read the article, you would know that it would apply to triggers in both MS SQL and Oracle.
And triggers are implemented the exact same way with both vendors? Just a all cars a exact matches of eachother? Diesel, V6, wankel; they are all the same?
E 12°55'05.63" N 56°04'39.26" |
 |
|
|
whitefang
Enterprise-Level Plonker Who's Not Wrong
272 Posts |
Posted - 04/21/2009 : 13:35:01
|
quote: Originally posted by Peso
quote: Originally posted by whitefang
If you read the article, you would know that it would apply to triggers in both MS SQL and Oracle.
And triggers are implemented the exact same way with both vendors? Just a all cars a exact matches of eachother? Diesel, V6, wankel; they are all the same?
E 12°55'05.63" N 56°04'39.26"
They both have the same problems, read the article above (directly from a MS SQL MVP, that guy has a lot of authority and credit) instead of anecdotal crap. |
Edited by - whitefang on 04/21/2009 13:36:39 |
 |
|
Topic  |
|