terminator_4
asked on
Memory resident table is taking much time compared to disk resident table.......
I have created this table ....
create table Rules_horizontal (
Fragment_name varchar(20) not null,
Attribute_name varchar(20) not null,
| | |
| | |
primary key(Fragment_name,Attribut e_name),
index (Fragment_name)
) ;
and the below code snippet is taking 0.586 secs for execution
-------------------------- ---Begin Snippet------------------- ---------- ---------- ---
Line:12 while ((row1 = mysql_fetch_row(pResult)) != NULL) {
Line:13 temp = row1[0];
Line:14 sqlQuery="select * from Rules_horizontal where Fragment_name='"+temp+"'";
Line:15 qResult=get_result(sqlQuer y.c_str()) ;
}
------------------------En d Snippet------------------- ---------- ---------- ---------- ---
but when I kept the table in memory.....
create table Rules_horizontal (
Fragment_name varchar(20) not null,
| | |
primary key(Fragment_name,Attribut e_name),
index (Fragment_name)
) Type = Heap;
the above code snippet is taking 5min .456 secs ..............Line14 is taking a long time for exection.......
Memory resident Table shud take less time than disk resident table but i am getting the opposite...............
Am I doing any mistake??? ........... Plz help.
create table Rules_horizontal (
Fragment_name varchar(20) not null,
Attribute_name varchar(20) not null,
| | |
| | |
primary key(Fragment_name,Attribut
index (Fragment_name)
) ;
and the below code snippet is taking 0.586 secs for execution
--------------------------
Line:12 while ((row1 = mysql_fetch_row(pResult)) != NULL) {
Line:13 temp = row1[0];
Line:14 sqlQuery="select * from Rules_horizontal where Fragment_name='"+temp+"'";
Line:15 qResult=get_result(sqlQuer
}
------------------------En
but when I kept the table in memory.....
create table Rules_horizontal (
Fragment_name varchar(20) not null,
| | |
primary key(Fragment_name,Attribut
index (Fragment_name)
) Type = Heap;
the above code snippet is taking 5min .456 secs ..............Line14 is taking a long time for exection.......
Memory resident Table shud take less time than disk resident table but i am getting the opposite...............
Am I doing any mistake??? ........... Plz help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
RAM: 256 MB
OS: FC2
mysql Ver 11.18 Distrib 3.23.58, for redhat-linux-gnu (i386)