Subject | Update statement seems to stall |
---|---|
Author | Bob Murdoch |
Post date | 2005-09-27T23:03:16Z |
I have a table with 17 million rows, running on a dual-Xeon
hyperthread-enabled W2K3 server, with Firebird 1.5 classic and a
dialect 1 database.
The table has a single primary key, and a single foreign key. No
other indices. The table baiscally looks like this:
create table SKU_PRICE (
sku_price_id integer not null,
sku_id integer not null,
start_date date not null,
end_date date not null,
price numeric(9,2),
ins_date date,
upd_date date);
SKU_PRICE_ID is the primary key. SKU_ID is a foreign key.
The only triggers are a before insert which sets the primary key from
a generator, and a before update that sets UPD_DATE to 'now'.
I am running the following query:
update
sku_price
set
end_date = (end_date + 1) - (1/24/60/60)
which basically adds 23 hours 59 minutes and 59 seconds to end date to
deal with some queries that include time instead of just date.
The query has been running for nearly four hours now. I see no
appreciable disk or cpu activity. I'm wondering what the problem
could be, why this is taking so long?
Bob M..
hyperthread-enabled W2K3 server, with Firebird 1.5 classic and a
dialect 1 database.
The table has a single primary key, and a single foreign key. No
other indices. The table baiscally looks like this:
create table SKU_PRICE (
sku_price_id integer not null,
sku_id integer not null,
start_date date not null,
end_date date not null,
price numeric(9,2),
ins_date date,
upd_date date);
SKU_PRICE_ID is the primary key. SKU_ID is a foreign key.
The only triggers are a before insert which sets the primary key from
a generator, and a before update that sets UPD_DATE to 'now'.
I am running the following query:
update
sku_price
set
end_date = (end_date + 1) - (1/24/60/60)
which basically adds 23 hours 59 minutes and 59 seconds to end date to
deal with some queries that include time instead of just date.
The query has been running for nearly four hours now. I see no
appreciable disk or cpu activity. I'm wondering what the problem
could be, why this is taking so long?
Bob M..