a quick question

A place general forum talk, not related to ingame discussions.
User avatar
The Doctor
Time Lord
Posts: 3409
Joined: Sat Oct 21, 2006 3:04 am
Race: Time Lord

Honours and Awards

a quick question

OK, so I'm running an SQL statement on a 903,000 row table in a clients database:

Code: Select all

UPDATE customer
SET Email = null
WHERE Email is NOT NULL
.

It's taken over 3.5 hours now and still going... can anyone give an estimation on how much longer this statement should run?
Formerly known as Haz

Nine out of ten doctors recommend going to an amusement park this weekend.
The Tenth Doctor doesn't want to go.
Spoiler
CC Leader: n haz thsi time it wasnt ur fault
Bralor wrote:hey haz how long do you estimate until someone blames you and masses HVE again?
Field Marshall wrote:On a seperate issue - where is Haz? He's the glue we really need right now!
SuperSaiyan wrote:I'm a staff member so naturally I'm used to unjustified abusive commentary, so really I don't mind ;)
Zeratul wrote:
Ĕɱƿŷ wrote:So I heard that when becoming a moderator you are subjected to hours and hours of "The Forum is good, the Forum is great, we surrender our will as of this date".

that is incorrect... nothing resembling prostration...

Forced labor on the other hand........ :sge
SuperSaiyan says (2:04 PM):
*that was kernal potter
*colonel
*wow I just made that typo

SuperSaiyan says (2:05 PM):
*no one will speak of this
*or I take muff's veggies away
*and he starves
Hope says (2:59 AM):
*hypothetically, how bad would it be if i descended someone... but forgot to Godquest them first, and they're active, and in an active alliance...
Hope says (3:00 AM):
*hypothetically...
Murris says (3:00 AM):
*ah **Filtered** why am i descended....
Angnoch Freddie says:
i hate being a mod...
i just wanted the blue color XD
User avatar
Sol
Forum Addict
Posts: 3807
Joined: Sat Apr 11, 2009 9:09 pm
ID: 0

Re: a quick question

What SQL are you using? And no, simplex queries like that should take only a few secs for a mill or so rows (for ref I can set NULL to a column for any condition and execute it at a rate of 1k rows per 0.0197 secs at worst).
Now, whether you have a heavy load on the server your messing around with or not is a question you should ask yourself, it would have to be a **Filtered** of a load to slow it by a few hours though.
Field Marshall wrote:
Sol wrote:It's not going to destroy your life :P
Really?
I think this is sig worthy in fact.
Image
User avatar
The Doctor
Time Lord
Posts: 3409
Joined: Sat Oct 21, 2006 3:04 am
Race: Time Lord

Honours and Awards

Re: a quick question

Sol wrote:What SQL are you using? And no, simplex queries like that should take only a few secs for a mill or so rows.
Database was migrated from SQL Server 2003 to SQL Server 2012 R2 x64. I'm setting up their test server from a recent migration from their production server, and before I upgrade the database, I have to remove customer communications so customers aren't getting spammed by the companies testing... it should not take 3.5+ hours!
Formerly known as Haz

Nine out of ten doctors recommend going to an amusement park this weekend.
The Tenth Doctor doesn't want to go.
Spoiler
CC Leader: n haz thsi time it wasnt ur fault
Bralor wrote:hey haz how long do you estimate until someone blames you and masses HVE again?
Field Marshall wrote:On a seperate issue - where is Haz? He's the glue we really need right now!
SuperSaiyan wrote:I'm a staff member so naturally I'm used to unjustified abusive commentary, so really I don't mind ;)
Zeratul wrote:
Ĕɱƿŷ wrote:So I heard that when becoming a moderator you are subjected to hours and hours of "The Forum is good, the Forum is great, we surrender our will as of this date".

that is incorrect... nothing resembling prostration...

Forced labor on the other hand........ :sge
SuperSaiyan says (2:04 PM):
*that was kernal potter
*colonel
*wow I just made that typo

SuperSaiyan says (2:05 PM):
*no one will speak of this
*or I take muff's veggies away
*and he starves
Hope says (2:59 AM):
*hypothetically, how bad would it be if i descended someone... but forgot to Godquest them first, and they're active, and in an active alliance...
Hope says (3:00 AM):
*hypothetically...
Murris says (3:00 AM):
*ah **Filtered** why am i descended....
Angnoch Freddie says:
i hate being a mod...
i just wanted the blue color XD
User avatar
Sol
Forum Addict
Posts: 3807
Joined: Sat Apr 11, 2009 9:09 pm
ID: 0

Re: a quick question

I want to say your query is wrong :P but... I'm not entirely sure regarding SQL 2012. If you know the server isn't flooded with capacity due to something, then it's probably the query, I would recommend trying something different like...(and I'm no pro in sql 2012)

Code: Select all

for transact sql

USE AdventureWorks2012;
GO
UPDATE database.Customer 
SET database.Customer.Email = NULL
WHERE database.Customer.Email IS NOT NULL;
GO

or...

UPDATE database.Customer 
SET database.Customer.Email = NULL
WHERE database.Customer.Email IS NOT NULL;
Either way, that execution time is abnormal.
Field Marshall wrote:
Sol wrote:It's not going to destroy your life :P
Really?
I think this is sig worthy in fact.
Image
User avatar
The Doctor
Time Lord
Posts: 3409
Joined: Sat Oct 21, 2006 3:04 am
Race: Time Lord

Honours and Awards

Re: a quick question

Sol wrote:I want to say your query is wrong :P but... I'm not entirely sure regarding SQL 2012. If you know the server isn't flooded with capacity due to something, then it's probably the query, I would recommend trying something different like...(and I'm no pro in sql 2012)

Code: Select all

for transact sql

USE AdventureWorks2012;
GO
UPDATE database.Customer 
SET database.Customer.Email = NULL
WHERE database.Customer.Email IS NOT NULL;
GO

or...

UPDATE database.Customer 
SET database.Customer.Email = NULL
WHERE database.Customer.Email IS NOT NULL;
Either way, that execution time is abnormal.
Database isn't being flooded, I'm the only one who can access it atm, and I've turned off all of our software which can communicate with it... I'm wondering whether it may be due to the relationships set by PKs and FKs, or the fact the database I'm upgrading from (in regards to our software) is quite old...

I won't be home for another two hours, so I'll check then, but if it still isn't done by then... I'm not sure what I can do, coz if I cancel the query, it will rollback the changes, which will take even longer >.<
Formerly known as Haz

Nine out of ten doctors recommend going to an amusement park this weekend.
The Tenth Doctor doesn't want to go.
Spoiler
CC Leader: n haz thsi time it wasnt ur fault
Bralor wrote:hey haz how long do you estimate until someone blames you and masses HVE again?
Field Marshall wrote:On a seperate issue - where is Haz? He's the glue we really need right now!
SuperSaiyan wrote:I'm a staff member so naturally I'm used to unjustified abusive commentary, so really I don't mind ;)
Zeratul wrote:
Ĕɱƿŷ wrote:So I heard that when becoming a moderator you are subjected to hours and hours of "The Forum is good, the Forum is great, we surrender our will as of this date".

that is incorrect... nothing resembling prostration...

Forced labor on the other hand........ :sge
SuperSaiyan says (2:04 PM):
*that was kernal potter
*colonel
*wow I just made that typo

SuperSaiyan says (2:05 PM):
*no one will speak of this
*or I take muff's veggies away
*and he starves
Hope says (2:59 AM):
*hypothetically, how bad would it be if i descended someone... but forgot to Godquest them first, and they're active, and in an active alliance...
Hope says (3:00 AM):
*hypothetically...
Murris says (3:00 AM):
*ah **Filtered** why am i descended....
Angnoch Freddie says:
i hate being a mod...
i just wanted the blue color XD
User avatar
Sol
Forum Addict
Posts: 3807
Joined: Sat Apr 11, 2009 9:09 pm
ID: 0

Re: a quick question

Haz wrote:
Sol wrote:I want to say your query is wrong :P but... I'm not entirely sure regarding SQL 2012. If you know the server isn't flooded with capacity due to something, then it's probably the query, I would recommend trying something different like...(and I'm no pro in sql 2012)

Code: Select all

for transact sql

USE AdventureWorks2012;
GO
UPDATE database.Customer 
SET database.Customer.Email = NULL
WHERE database.Customer.Email IS NOT NULL;
GO

or...

UPDATE database.Customer 
SET database.Customer.Email = NULL
WHERE database.Customer.Email IS NOT NULL;
Either way, that execution time is abnormal.
Database isn't being flooded, I'm the only one who can access it atm, and I've turned off all of our software which can communicate with it... I'm wondering whether it may be due to the relationships set by PKs and FKs, or the fact the database I'm upgrading from (in regards to our software) is quite old...

I won't be home for another two hours, so I'll check then, but if it still isn't done by then... I'm not sure what I can do, coz if I cancel the query, it will rollback the changes, which will take even longer >.<
Hmmm...it could be due to compatibility I guess, 2003-2012 is a fair jump, but to screw over a fairly basic query...
I feel like either way you look at it the query will have to be terminated :P
Field Marshall wrote:
Sol wrote:It's not going to destroy your life :P
Really?
I think this is sig worthy in fact.
Image
User avatar
Field Marshall
Forum Zombie
Posts: 6108
Joined: Tue Sep 13, 2005 10:30 pm

Re: a quick question

I'd say the replicators have something to do with it.

Not sure. Though those bugs do give me the creeps.
Sol wrote:
Field Marshall wrote:
Sol wrote:It's not going to destroy your life :P
Really?

I think this is sig worthy in fact.
:o my first sigging. I sigged you too. <3
High Empty wrote:however people shouldn't have lvl 33 and 200mil spies and try to be in the top 10, it's unhealthy.
User avatar
The Doctor
Time Lord
Posts: 3409
Joined: Sat Oct 21, 2006 3:04 am
Race: Time Lord

Honours and Awards

Re: a quick question

Sol wrote:
Haz wrote:
Sol wrote:I want to say your query is wrong :P but... I'm not entirely sure regarding SQL 2012. If you know the server isn't flooded with capacity due to something, then it's probably the query, I would recommend trying something different like...(and I'm no pro in sql 2012)

Code: Select all

for transact sql

USE AdventureWorks2012;
GO
UPDATE database.Customer 
SET database.Customer.Email = NULL
WHERE database.Customer.Email IS NOT NULL;
GO

or...

UPDATE database.Customer 
SET database.Customer.Email = NULL
WHERE database.Customer.Email IS NOT NULL;
Either way, that execution time is abnormal.
Database isn't being flooded, I'm the only one who can access it atm, and I've turned off all of our software which can communicate with it... I'm wondering whether it may be due to the relationships set by PKs and FKs, or the fact the database I'm upgrading from (in regards to our software) is quite old...

I won't be home for another two hours, so I'll check then, but if it still isn't done by then... I'm not sure what I can do, coz if I cancel the query, it will rollback the changes, which will take even longer >.<
Hmmm...it could be due to compatibility I guess, 2003-2012 is a fair jump, but to screw over a fairly basic query...
I feel like either way you look at it the query will have to be terminated :P
It's going on 7 hours now!... and if I cancel it, it will rollback the changes, taking as much time, if not more than it has been currently using...
Formerly known as Haz

Nine out of ten doctors recommend going to an amusement park this weekend.
The Tenth Doctor doesn't want to go.
Spoiler
CC Leader: n haz thsi time it wasnt ur fault
Bralor wrote:hey haz how long do you estimate until someone blames you and masses HVE again?
Field Marshall wrote:On a seperate issue - where is Haz? He's the glue we really need right now!
SuperSaiyan wrote:I'm a staff member so naturally I'm used to unjustified abusive commentary, so really I don't mind ;)
Zeratul wrote:
Ĕɱƿŷ wrote:So I heard that when becoming a moderator you are subjected to hours and hours of "The Forum is good, the Forum is great, we surrender our will as of this date".

that is incorrect... nothing resembling prostration...

Forced labor on the other hand........ :sge
SuperSaiyan says (2:04 PM):
*that was kernal potter
*colonel
*wow I just made that typo

SuperSaiyan says (2:05 PM):
*no one will speak of this
*or I take muff's veggies away
*and he starves
Hope says (2:59 AM):
*hypothetically, how bad would it be if i descended someone... but forgot to Godquest them first, and they're active, and in an active alliance...
Hope says (3:00 AM):
*hypothetically...
Murris says (3:00 AM):
*ah **Filtered** why am i descended....
Angnoch Freddie says:
i hate being a mod...
i just wanted the blue color XD
User avatar
The Doctor
Time Lord
Posts: 3409
Joined: Sat Oct 21, 2006 3:04 am
Race: Time Lord

Honours and Awards

Re: a quick question

I did notice that earlier when running a 'sp_who2' its status was set as suspended... coinciding with a few SQL Agent jobs running... may have contributed to the amount of time it has taken to run this.

Either that, or as FM said... the damn replicators :P
Formerly known as Haz

Nine out of ten doctors recommend going to an amusement park this weekend.
The Tenth Doctor doesn't want to go.
Spoiler
CC Leader: n haz thsi time it wasnt ur fault
Bralor wrote:hey haz how long do you estimate until someone blames you and masses HVE again?
Field Marshall wrote:On a seperate issue - where is Haz? He's the glue we really need right now!
SuperSaiyan wrote:I'm a staff member so naturally I'm used to unjustified abusive commentary, so really I don't mind ;)
Zeratul wrote:
Ĕɱƿŷ wrote:So I heard that when becoming a moderator you are subjected to hours and hours of "The Forum is good, the Forum is great, we surrender our will as of this date".

that is incorrect... nothing resembling prostration...

Forced labor on the other hand........ :sge
SuperSaiyan says (2:04 PM):
*that was kernal potter
*colonel
*wow I just made that typo

SuperSaiyan says (2:05 PM):
*no one will speak of this
*or I take muff's veggies away
*and he starves
Hope says (2:59 AM):
*hypothetically, how bad would it be if i descended someone... but forgot to Godquest them first, and they're active, and in an active alliance...
Hope says (3:00 AM):
*hypothetically...
Murris says (3:00 AM):
*ah **Filtered** why am i descended....
Angnoch Freddie says:
i hate being a mod...
i just wanted the blue color XD
User avatar
Drought
Forum Expert
Posts: 1142
Joined: Wed Oct 12, 2011 11:52 am
ID: 0
Location: dde

Re: a quick question

why not just set the entire column to null instead of checking each entry if it isnt already ?

update table.column set email = NULL


concerning the lengthy time, any chance your using locking methods on the column ?
Image
a very bad hairdo
Image
User avatar
Field Marshall
Forum Zombie
Posts: 6108
Joined: Tue Sep 13, 2005 10:30 pm

Re: a quick question

Drought wrote:why not just set the entire column to null instead of checking each entry if it isnt already ?

update table.column set email = NULL


concerning the lengthy time, any chance your using locking methods on the column ?
Pssh.

Script0rz
Sol wrote:
Field Marshall wrote:
Sol wrote:It's not going to destroy your life :P
Really?

I think this is sig worthy in fact.
:o my first sigging. I sigged you too. <3
High Empty wrote:however people shouldn't have lvl 33 and 200mil spies and try to be in the top 10, it's unhealthy.
User avatar
Drought
Forum Expert
Posts: 1142
Joined: Wed Oct 12, 2011 11:52 am
ID: 0
Location: dde

Re: a quick question

Field Marshall wrote: Pssh.

Script0rz
:smt043


Shouldnt you be pestering people who like gay folks ?


oh wait ...


I could sum you up with a few words :-D
Traitor ...
Thief ...
Multi ...
Image
a very bad hairdo
Image
User avatar
The Doctor
Time Lord
Posts: 3409
Joined: Sat Oct 21, 2006 3:04 am
Race: Time Lord

Honours and Awards

Re: a quick question

Just checked on it after waking up... 14+ hours!!!!!! Next time I might just go with the statement Drought mentioned. I originally went with the check for if it is already null, but thats probably what is locking it up.
Formerly known as Haz

Nine out of ten doctors recommend going to an amusement park this weekend.
The Tenth Doctor doesn't want to go.
Spoiler
CC Leader: n haz thsi time it wasnt ur fault
Bralor wrote:hey haz how long do you estimate until someone blames you and masses HVE again?
Field Marshall wrote:On a seperate issue - where is Haz? He's the glue we really need right now!
SuperSaiyan wrote:I'm a staff member so naturally I'm used to unjustified abusive commentary, so really I don't mind ;)
Zeratul wrote:
Ĕɱƿŷ wrote:So I heard that when becoming a moderator you are subjected to hours and hours of "The Forum is good, the Forum is great, we surrender our will as of this date".

that is incorrect... nothing resembling prostration...

Forced labor on the other hand........ :sge
SuperSaiyan says (2:04 PM):
*that was kernal potter
*colonel
*wow I just made that typo

SuperSaiyan says (2:05 PM):
*no one will speak of this
*or I take muff's veggies away
*and he starves
Hope says (2:59 AM):
*hypothetically, how bad would it be if i descended someone... but forgot to Godquest them first, and they're active, and in an active alliance...
Hope says (3:00 AM):
*hypothetically...
Murris says (3:00 AM):
*ah **Filtered** why am i descended....
Angnoch Freddie says:
i hate being a mod...
i just wanted the blue color XD
User avatar
Field Marshall
Forum Zombie
Posts: 6108
Joined: Tue Sep 13, 2005 10:30 pm

Re: a quick question

Drought wrote:
Field Marshall wrote: Pssh.

Script0rz
:smt043


Shouldnt you be pestering people who like gay folks ?


oh wait ...


I could sum you up with a few words :-D
Traitor ...
Thief ...
Multi ...
eh bro? u mad?
Sol wrote:
Field Marshall wrote:
Sol wrote:It's not going to destroy your life :P
Really?

I think this is sig worthy in fact.
:o my first sigging. I sigged you too. <3
High Empty wrote:however people shouldn't have lvl 33 and 200mil spies and try to be in the top 10, it's unhealthy.
User avatar
Sol
Forum Addict
Posts: 3807
Joined: Sat Apr 11, 2009 9:09 pm
ID: 0

Re: a quick question

Drought wrote:why not just set the entire column to null instead of checking each entry if it isnt already ?

update table.column set email = NULL


concerning the lengthy time, any chance your using locking methods on the column ?
Can be technically excessive, if it's already NULL you're resetting it. But either way, the actual query time should be insignificant.
Field Marshall wrote:
Sol wrote:It's not going to destroy your life :P
Really?
I think this is sig worthy in fact.
Image
Post Reply

Return to “This, That, Those, and Them”