Martin Virtel wrote: > Hi, > > my "Source" MiddleKit objects contain a "list of Visit" > attribute referencing > several "Visit" objects. When I try to delete one of the > "Source" objects from > the MySql store, MiddleKit retrieves the whole "Visit" table, > presumably to > look up if there are some "Visit" objects that belong to the > "Source" object > I'm trying to delete: > > SQL 0009. 2002-03-03 06:34:31 select > visitId,start,end,found,new,sourceId from Visit ; > > This takes forever, the "Visit" table contains about 30.000 > objects, and only > about 1-2% of them ever belong to the same "Source" object. > Wouldn't it be > better to query only relevant objects, something like: > > 'select visitId,start,end,found,new,sourceId from Visit where > sourceId = %s' > % source_obj_to_delete.sqlObjRef() > > or is there some special reason the whole table needs to be > read that I don't > understand?
I think you're 100% correct. I'll take the blame for this one -- I implemented the delete functionality in MiddleKit, but I never put in any effort to optimize it for speed. Hence, the dumb approach of bringing in all objects. I added this item to the WishList in the Webware Wiki. It sounds like this might be pretty easy to fix; if you want to try fixing this, be sure to run the MiddleKit test suite because it contains a number of deletion test cases. - Geoff _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss
