Click here to Skip to main content
14,458,335 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi,
While inserting data to a temporary table inside the stored procedure in mysql database..
it is taking too long time (8-11 mins) to insert approx 1300 records..i don't understand why..please help.

my lines inside procedure are:
create temporary table mr(PageNo int,RecordNO int ,GranteeFirstName varchar(50),GranteeLastName varchar(50),GrantorFirstName varchar(50),GrantorLastName varchar(50),Deeds varchar(50),RType varchar(50),Book varchar(50),
Volume varchar(50),Page varchar(50),DocumentDate varchar(50),FiledDate varchar(50),
Region varchar(50),Sector varchar(50),Block varchar(50),Survey varchar(50),Description varchar(50)); 

insert into mr(PageNo,RecordNO,GranteeFirstName,GranteeLastName,GrantorFirstName,GrantorLastName,Deeds,RType,Book,Volume,Page,DocumentDate,FiledDate,Region,Sector,Block,Survey,Description)
select PageNo,RecordNO,GranteeFirstName,GranteeLastName,GrantorFirstName,GrantorLastName,Deeds,RType,Book,Volume,Page,DocumentDate,FiledDate,Region,Sector,Block,Survey,Description from
(select PageNo,RecordNO,GranteeFirstName,GranteeLastName,GrantorFirstName,GrantorLastName,Deeds,RType,Book,Volume,Page,DocumentDate,FiledDate,Region,Sector,Block,Survey,Description from User1DataEntryTable 
union all
select PageNo,RecordNO,GranteeFirstName,GranteeLastName,GrantorFirstName,GrantorLastName,Deeds,RType,Book,Volume,Page,DocumentDate,FiledDate,Region,Sector,Block,Survey,Description from User2DataEntryTable) as p
group by PageNo,RecordNO,GranteeFirstName,GranteeLastName,GrantorFirstName,GrantorLastName,Deeds,RType,Book,Volume,Page,DocumentDate,FiledDate,Region,Sector,Block,Survey,Description 
having count(*)>1;


any help will be appreciated.. thanks in advance.
Posted
Updated 24-Sep-11 5:18am
v2
Comments
DaveAuld 24-Sep-11 10:18am
   
Edit: SQL can be placed inside code blocks to make it easier to read you know.......

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100