I have posted an early beta of the queries functionality on SqueakSource, along with some preliminary documentation on the Swiki:
http://minnow.cc.gatech.edu/squeak/5859
It is only lightly tested, but has been carefully constructed so I do expect most parts to work pretty well. To load the code, just look for the individual packages dated this week and load them on top of a MagmaServerLoader (or MagmaTesterLoader, of course).
I'm real pleased with how the implementation has shaped up. In particular, for standard queries, we have maintained complete "lazy" determination of the query result. Only when a page is requested does calculation on the query "resume" only for the page requested.
When a query can be optimized down to one clause, sorting by the attribute of that clause is provided for "free" and #sortBy: will return the receiver instantly. If sorting is needed on a different attribute or on a complex query that could not be reduced to one clause, then Magma is required to perform a full enumeration of the result. In this case, a new MagmaCollection is with an index on the sort attribute and a reader on that index is returned from #sortBy:. This occurs in the background, allowing "results as you go" and with #fractionSorted providing the progress indication.
Non-persistent object integration should be working! Some of the ugliest code in Magma related to the old way of integrated non-persistent objects has, thankfully, been deleted. Talk about addition by subtraction! It has been replaced by much cleaner and easier to understand code.
Performance seems reasonably good from my initlal tests.
There is still no provision for ommitting duplicates; if an object qualifies under two clauses it will be included twice in the result set. I appreciate any advice about this.
I have not tested #descending sorting yet.
It should work with legacy database files, I haven't tried.
====
I am leaving for an extended holiday beginning Friday evening, 6/16 to 6/26 and will be offline the entire time. I was hoping to have this work completely finished by now, but I will have to finish the test cases and other refinements after I get back. In the meantime, should you have time to try it out I, of course, appreciate your feedback.
Enjoy!
Chris
Chris Muller chris@funkyobjects.org wrote:
I have posted an early beta of the queries functionality on SqueakSource, along with some preliminary documentation on the Swiki:
Super great!
I am installing and will be trying it out ASAP. Good work Chris! Using Magma has so far been a very pleasant experience.
regards, Göran
Hi,
I ave tried out Chris complex query preview code and am very impressed: I have uploaded a small modification to SqueakSource which fixes a few glitches.
I am using a stock 3.8 image with the latest Magma1.0 monticello loaded. On top of this I loaded:
Ma special collections-cmm.66.mcz Magma client-brp.188.mcz Magma server-cmm.163.mcz
To test, I loaded the latest Lava and Lava testing monticellos.
In a workspace:
"1. Create the test repository...." LavaTestResource current.
"2. Create a complex query..." Transcript clear. youngsters := LavaTestResource current people where: [ :p | (p familyName at: 'Pinkney') & (p age < 60) ]. youngsters sortBy: #age; descend.
"3. Iterate over the query results..." youngsters do: [ :p | Transcript show: p age; tab; show: p; cr ]
It looks great so far.
Brent
Sigh, I really wish Monticello supported deletion of packages because there continues to be confusion about "Magma1.0". Magma1.0 was created when my first (failed) attempt at Magma1.1 took over the three normal loader packages (MagmaClientLoader, MagmaServerLoader and MagmaTesterLoader). Since 1.1 has been withdrawn, Client, Server and Tester reverted back to containing the 1.0 version and "Magma1.0" is (temporarily) stale. I have only been updating MagmaClientLoader, MagmaServerLoader and MagmaTesterLoader with 1.0 work since January or so.
Someday (soon) there will be, once again, two versions of Magma, 1.0 and 1.1, both supported. 1.1 is with security, 1.0 is without. The plan is for them to be file-compatible. But we need to figure out a way to handle the code/package situation where it won't be too confusing. Any suggestions?
What glitches did you find? Never mind I will look.. I just hope it is not due to having loaded Magma1.0 instead of MagmaServerLoader or MagmaTesterLoader.
Thanks.. - Chris
--- Brent Pinkney brent.pinkney@aircom.co.za wrote:
Hi,
I ave tried out Chris complex query preview code and am very impressed: I have uploaded a small modification to SqueakSource which fixes a few glitches.
I am using a stock 3.8 image with the latest Magma1.0 monticello loaded. On top of this I loaded:
Ma special collections-cmm.66.mcz Magma client-brp.188.mcz Magma server-cmm.163.mcz
To test, I loaded the latest Lava and Lava testing monticellos.
In a workspace:
"1. Create the test repository...." LavaTestResource current.
"2. Create a complex query..." Transcript clear. youngsters := LavaTestResource current people where: [ :p | (p familyName at: 'Pinkney') & (p age < 60) ]. youngsters sortBy: #age; descend.
"3. Iterate over the query results..." youngsters do: [ :p | Transcript show: p age; tab; show: p; cr ]
It looks great so far.
Brent _______________________________________________ Magma mailing list Magma@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/magma
It should work with legacy database files, I haven't tried.
Heh, that is post-midnight silly-babble there..
"Census" index files will have to be generated from the legacy index files, and the legacy files will have to renamed to include "-oids". It's a simple script, I'll make a utility method and try to post it before I leave..
magma@lists.squeakfoundation.org