Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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:
SQL
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 4: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, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900