<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="-1"><font face="Trebuchet MS">hi all,<br>
<br>
During the execution of the following requests, INSERT does not finish
except if it is carried out a few minutes after the <br>
creation of the table. How to explain this latency time?<br>
<br>
CREATE produces a table with the number of events of a product (id1)
for a customer (id2) having attribute “ABCD”. <br>
INSERT adds a row for each product a client did not buy whereas others
of group "ABCD" did. That is done by selecting the <br>
Cartesian product between the attributes id1 and id2 then removing
(EXCEPT) lines whose couple (id1, id2) is already in… <br>
<br>
-----------------------------------------<br>
drop table maTable;<br>
<br>
create table maTable as (<br>
select id1,id2,count(*)<br>
from table1<br>
where cle = 'ABCD'<br>
group by id1, id2<br>
order by id2,id1);<br>
<br>
insert into maTable (select * from<br>
((select a.id1 ,b.id2 ,0<br>
from maTable a, maTable b<br>
group by a.id1,b.id2<br>
order by b.id2,a.id1)<br>
EXCEPT<br>
(select c.id1 ,c.id2 ,0<br>
from maTable c<br>
))as tt;<br>
-----------------------------------------<br>
<br>
DROP and CREATE do their job but INSERT does not finish if it is
carried out immediately after the CREATE. On the other hand <br>
<br>
if it is carried out a few minutes (~5min) later then INSERT commits in
a few seconds. <br>
<br>
Rq: If drop/create/insert is replaced by delete/insert/insert then it's
ok.<br>
Finally the creation of a “Temporary” table leads to the same
problem. <br>
<br>
Thank you for your assistance,<br>
<br>
Mat<br>
</font></font><br>
</body>
</html>