Mydac cant handle my database size
Posted: Wed 04 Jun 2008 11:40
I have a MySql 5.0 database with 10 000 records and 2.5 gb of size. Its only 2 fields, an integer and a string (the averege string is 80k). There is no index. I have 2 problems with this database:
(1) Database explorer cant open it. It times out when i choose "retrive data". I guess this have to do with the property "fetch all" witch i guess is true (on) . But i cant turn it to false.
(2) When i add records to the database Mydac consumes graduadly more and more memory until my computer runns out of memory. Is there any way to tell mydac, i dont care if u want more memory, you just have to do with what you have and let it take the time it takes.
I have the Build 5.201.15 of mydac and both the connection and query are set to default values, the only thing i changed is "fetch all" that i set to false.
The code that adds records looke like this:
begin
Locker.Acquire; // only one thread @ a time can access this
qry.Insert;
qry.FieldByName('c_id').AsInteger:=id;
qry.FieldByName('c_body').AsString:=body;
qry.Post;
Locker.Release;
end;
dfm:
object Company_connection: TMyConnection
Database = 'swedishcompanys'
Username = 'root'
Password = '******'
Server = 'localhost'
LoginPrompt = False
Left = 88
Top = 48
end
object qry: TMyQuery
SQLInsert.Strings = (
'INSERT INTO companys'
' (c_id, c_body)'
'VALUES'
' (:c_id, :c_body)')
SQLDelete.Strings = (
'DELETE FROM companys'
'WHERE'
' c_id = :Old_c_id')
SQLUpdate.Strings = (
'UPDATE companys'
'SET'
' c_id = :c_id, c_body = :c_body'
'WHERE'
' c_id = :Old_c_id')
SQLRefresh.Strings = (
'SELECT companys.c_id, companys.c_body FROM companys'
'WHERE'
' companys.c_id = :c_id')
Connection = Company_connection
SQL.Strings = (
'SELECT'
' swedishcompanys.companys.c_id,'
' swedishcompanys.companys.c_body'
'FROM'
' swedishcompanys.companys')
FetchAll = False
Left = 144
Top = 48
end
(1) Database explorer cant open it. It times out when i choose "retrive data". I guess this have to do with the property "fetch all" witch i guess is true (on) . But i cant turn it to false.
(2) When i add records to the database Mydac consumes graduadly more and more memory until my computer runns out of memory. Is there any way to tell mydac, i dont care if u want more memory, you just have to do with what you have and let it take the time it takes.
I have the Build 5.201.15 of mydac and both the connection and query are set to default values, the only thing i changed is "fetch all" that i set to false.
The code that adds records looke like this:
begin
Locker.Acquire; // only one thread @ a time can access this
qry.Insert;
qry.FieldByName('c_id').AsInteger:=id;
qry.FieldByName('c_body').AsString:=body;
qry.Post;
Locker.Release;
end;
dfm:
object Company_connection: TMyConnection
Database = 'swedishcompanys'
Username = 'root'
Password = '******'
Server = 'localhost'
LoginPrompt = False
Left = 88
Top = 48
end
object qry: TMyQuery
SQLInsert.Strings = (
'INSERT INTO companys'
' (c_id, c_body)'
'VALUES'
' (:c_id, :c_body)')
SQLDelete.Strings = (
'DELETE FROM companys'
'WHERE'
' c_id = :Old_c_id')
SQLUpdate.Strings = (
'UPDATE companys'
'SET'
' c_id = :c_id, c_body = :c_body'
'WHERE'
' c_id = :Old_c_id')
SQLRefresh.Strings = (
'SELECT companys.c_id, companys.c_body FROM companys'
'WHERE'
' companys.c_id = :c_id')
Connection = Company_connection
SQL.Strings = (
'SELECT'
' swedishcompanys.companys.c_id,'
' swedishcompanys.companys.c_body'
'FROM'
' swedishcompanys.companys')
FetchAll = False
Left = 144
Top = 48
end