I'm running a script to see who the most ignored user is ...

I understand but its a lot easier for me just to make a script although its fun to think about this I guess.
I realized that you probably know your database a lot better than TrImp. I don't know why he has such a hardon for SQL.

I mean SQL is nifty and all, but you have to use the best tool for the job.
 
I understand but its a lot easier for me just to make a script although its fun to think about this I guess.

If you can write something in all SQL without using cursors its generally much faster.

You can just save the query in a sproc and then next month you just come along and type EXEC sp_get_most_ignored_users and there it is.
 
If you can write something in all SQL without using cursors its generally much faster.

You can just save the query in a sproc and then next month you just come along and type EXEC sp_get_most_ignored_users and there it is.
or you could just write a view and save it, then call the view up once a month...
 
I realized that you probably know your database a lot better than TrImp. I don't know why he has such a hardon for SQL.

I mean SQL is nifty and all, but you have to use the best tool for the job.

It took his script over 20 minutes to run. There are only about (edit) 50,000 rows in this table (one for each user). Hardly the best tool for the job.
 
or you could just write a view and save it, then call the view up once a month...

Sure. I just hesitate to put that kind of thing in a view since its computationally intensive... you dont want people writing queries against it without realizing what they are doing and calling on it all the time.
 
It took his script over 20 minutes to run. There are only about (edit) 50,000 rows in this table (one for each user). Hardly the best tool for the job.
maybe his priority was how easy/fast he could create it, not how efficient it would be?

don't think of this as a computer science problem. think of this as a business problem. he wants to maximize the use of his time and be as efficient as possible.


edit: this includes hyperventilating.
 
Sure. I just hesitate to put that kind of thing in a view since its computationally intensive... you dont want people writing queries against it without realizing what they are doing and calling on it all the time.
mm, good point.
 
the script runs in less than a second, I just had to find it.

Ok, that's a lot better.

I actually would have been pretty impressed if your script unintentionally took 20 minutes to run when its going against 50,000 rows and parsing up to 300 space separated values per row.
 
strangely I decided to ignore absent earlier today, which is rare for me

I guess it paid off
 
Last edited:
Back
Top