[ic] Memory problem

Peter Jakl interchange-users@interchange.redhat.com
Tue Jan 15 15:16:00 2002


Thanks for the reply. This is not what is going on. I am using mysql
which supports LIMIT. There is a clear intent on interchange to load the
whole database since it's calling import_database(). The exact code in
Vend::Data.pm::tie_database() is:

  if ($data->{type} > 6 or $data->{HOT})
	import_database(...);

IC identifies any database using DBI as a type == 8 and therefore calls
import_database to do a select * from table.

I am using version 4.6.5. Can anyone check the sub tie_database to see
if the code is different in later versions?

Also, a simple change on the if () to if (0) to stop the import causes
it to happen when loading the first page. Somehow, IC thinks the
database is to be stored in memory for fast access, yet all subsequent
accesses still use DBI and go out to the database server.

Peter


> > I've traced thru the interchange server program and found out my
memory
> > problem but need help as to why it is doing this. Without going into
> > great detail, a startup function attempts to load the database into
> > memory (opendatabase() ultimately calls import_database() for each
table
> > including products). The problem is that my products table has over
> > 150,000 products and the interchange server is loading all the
products
> > into memory. How do I stop this?
> 
> You may have mentioned which database you're using in a previous
message,
> but I don't remember right now. Using MySQL on an already-imported
> database, here are the SQL commands Interchange issues at IC daemon
> startup time:
> 
> SHOW TABLES
> select * from country limit 1
> select * from gift_certs limit 1
> select * from userdb limit 1
> select * from options limit 1
> select * from affiliate limit 1
> select * from cat limit 1
> select * from pricing limit 1
> select * from state limit 1
> select * from area limit 1
> select * from merchandising limit 1
> select * from orderline limit 1
> select * from inventory limit 1
> select * from order_returns limit 1
> select * from transactions limit 1
> select * from products limit 1
> 
> This lets IC get all the column names, but LIMIT 1 keeps the database
from
> wasting any effort collecting a large result set.
> 
> Not all databases support LIMIT, so that may be the problem you're
having.
> 
> Jon
> 
> _______________________________________________
> interchange-users mailing list
> interchange-users@interchange.redhat.com
> http://interchange.redhat.com/mailman/listinfo/interchange-users