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
Mydac cant handle my database size
The dataset size is really big. To avoid the problem with out of memory, you should restrict requested records count by some conditions in the WHERE clause.
If you need to handle all records one by one in your application (caching is not required), set the Unidirectional property of your query to True.
If you need to handle all records one by one in your application (caching is not required), set the Unidirectional property of your query to True.
-
jkuiper_them
- Posts: 28
- Joined: Thu 20 Dec 2007 14:48
Unidirectional tables requires a provider and a clientdataset.kaffeburk wrote:When i change unidirectional to True i get error:
"cant modify a read only dataset"
I only need to add rows (yet)
The documanation of unidirectional does not mention that the dataset becomes "read only".
the readonly property is set to False, am i doing something wrong or bug in mydac?