Subject | 100% CPU but no action? |
---|---|
Author | Kjell Rilbe |
Post date | 2005-03-14T14:28:38Z |
Hi,
Last night I started a set of queries using FlameRobin. I expected the
queries to take a while to execute so I closed my Remote Desktop window
and went to bed. This was about 16 hours ago. The current status is that
FlameRobin is unresponsive - apparently waiting for the query batch to
finish, and fbserver.exe is consuming almost 100% CPU but it doesn't
perform any disk I/O (according to Task Manager). None.
Any idea what might be going on?
This is the query batch:
--------------------------------------
insert into "Bolagsadress_Beslutsfattare" (
"Id", "Titel", "Namn"
)
select "Id", 'VD', substring("VD" from 1 for 25)
from "Bolagsadress"
where "VD" <> 'X' -- Implies not null
--
insert into "Bolagsadress_Beslutsfattare" (
"Id", "Titel", "Namn"
)
select "Id", 'Ekonomiansvarig', "Ekonomiansvarig"
from "Bolagsadress"
where "Ekonomiansvarig" is not null;
--
insert into "Bolagsadress_Beslutsfattare" (
"Id", "Titel", "Namn"
)
select "Id", 'Forsaljningsansvarig', "Forsaljningsansvarig"
from "Bolagsadress"
where "Forsaljningsansvarig" is not null;
--
insert into "Bolagsadress_Beslutsfattare" (
"Id", "Titel", "Namn"
)
select "Id", 'Marknadsansvarig', "Marknadsansvarig"
from "Bolagsadress"
where "Marknadsansvarig" is not null;
--
insert into "Bolagsadress_Beslutsfattare" (
"Id", "Titel", "Namn"
)
select "Id", 'ITansvarig', "ITansvarig"
from "Bolagsadress"
where "ITansvarig" is not null;
--
delete from "Bolagsadress_Beslutsfattare"
where "Id" || "Namn" in (
select "Id" || "Namn"
from "Bolagsadress_Beslutsfattare"
group by "Id", "Namn"
having count(*) = 1
);
--------------------------------------
Bolagsadress contains about 1 million records. About 7500 of them should
match "VD" <> 'X', "Ekonomiansvarig" is not null, etc. About half of
them should match "VD" = 'X' (a condition that's not used - I'm telling
you this just in case it's important for understanding of the problem).
Bolagsadress_Beslutsfattare" is empty when the batch starts. No indices
except a primary key that contains all three fields.
Just before the batch started, I created these indices:
--------------------------------------
create index "BolagsdaresVD"
on "Bolagsadress" ("VD");
--
create index "BolagsdaresEkonomi"
on "Bolagsadress" ("Ekonomiansvarig");
--
create index "BolagsdaresForsaljning"
on "Bolagsadress" ("Forsaljningsansvarig");
--
create index "BolagsdaresMarknad"
on "Bolagsadress" ("Marknadsansvarig");
--
create index "BolagsdaresIT"
on "Bolagsadress" ("ITansvarig");
--------------------------------------
I did a commit between index creation and start of query batch. No other
connections to this Firebird server during the night (first 8 hours) but
a few short connections during the day - and these connections seem to
run nicely - no unexpected delays or anything.
Any ideas? What can I do to examine the situation further?
Thanks,
Kjell
--
--------------------------------------
Kjell Rilbe
Adressmarknaden AM AB
E-post: kjell.rilbe@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64
Last night I started a set of queries using FlameRobin. I expected the
queries to take a while to execute so I closed my Remote Desktop window
and went to bed. This was about 16 hours ago. The current status is that
FlameRobin is unresponsive - apparently waiting for the query batch to
finish, and fbserver.exe is consuming almost 100% CPU but it doesn't
perform any disk I/O (according to Task Manager). None.
Any idea what might be going on?
This is the query batch:
--------------------------------------
insert into "Bolagsadress_Beslutsfattare" (
"Id", "Titel", "Namn"
)
select "Id", 'VD', substring("VD" from 1 for 25)
from "Bolagsadress"
where "VD" <> 'X' -- Implies not null
--
insert into "Bolagsadress_Beslutsfattare" (
"Id", "Titel", "Namn"
)
select "Id", 'Ekonomiansvarig', "Ekonomiansvarig"
from "Bolagsadress"
where "Ekonomiansvarig" is not null;
--
insert into "Bolagsadress_Beslutsfattare" (
"Id", "Titel", "Namn"
)
select "Id", 'Forsaljningsansvarig', "Forsaljningsansvarig"
from "Bolagsadress"
where "Forsaljningsansvarig" is not null;
--
insert into "Bolagsadress_Beslutsfattare" (
"Id", "Titel", "Namn"
)
select "Id", 'Marknadsansvarig', "Marknadsansvarig"
from "Bolagsadress"
where "Marknadsansvarig" is not null;
--
insert into "Bolagsadress_Beslutsfattare" (
"Id", "Titel", "Namn"
)
select "Id", 'ITansvarig', "ITansvarig"
from "Bolagsadress"
where "ITansvarig" is not null;
--
delete from "Bolagsadress_Beslutsfattare"
where "Id" || "Namn" in (
select "Id" || "Namn"
from "Bolagsadress_Beslutsfattare"
group by "Id", "Namn"
having count(*) = 1
);
--------------------------------------
Bolagsadress contains about 1 million records. About 7500 of them should
match "VD" <> 'X', "Ekonomiansvarig" is not null, etc. About half of
them should match "VD" = 'X' (a condition that's not used - I'm telling
you this just in case it's important for understanding of the problem).
Bolagsadress_Beslutsfattare" is empty when the batch starts. No indices
except a primary key that contains all three fields.
Just before the batch started, I created these indices:
--------------------------------------
create index "BolagsdaresVD"
on "Bolagsadress" ("VD");
--
create index "BolagsdaresEkonomi"
on "Bolagsadress" ("Ekonomiansvarig");
--
create index "BolagsdaresForsaljning"
on "Bolagsadress" ("Forsaljningsansvarig");
--
create index "BolagsdaresMarknad"
on "Bolagsadress" ("Marknadsansvarig");
--
create index "BolagsdaresIT"
on "Bolagsadress" ("ITansvarig");
--------------------------------------
I did a commit between index creation and start of query batch. No other
connections to this Firebird server during the night (first 8 hours) but
a few short connections during the day - and these connections seem to
run nicely - no unexpected delays or anything.
Any ideas? What can I do to examine the situation further?
Thanks,
Kjell
--
--------------------------------------
Kjell Rilbe
Adressmarknaden AM AB
E-post: kjell.rilbe@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64