Wednesday, February 29, 2012

High speed word list searching with sqlite3

Eveything is about Qson format, and so is this. Qson exist in memory in a very efficient form. Actually, Qson exists in two forms in memory, flat, ready for io and with separate key data. The latter is very efficient for lambda, if it is a small graph, like a search graph. So we create a call back match(keyvalue,keylen) Sqlite can use this and quickly get the row values for a Qson search word.
insert into resultselect * from tablename where match(key,length(key));

That form is compiled, with table name, let it run 10,000 names, not a problem. so:


bookmark."joe bob henry pat"  becomes @bookmark,{joe,bob,henry,pat}
the later group in memory. The machine has to contain the default grammar in any case, it easily works half the equation from memory.Tables (graphs) whether square, qson, or hybrids; they all have their schema loaded into the table context. So, bookmark$name, as a query yields, in the @ variant: @bookmark,$name so schema names are loaded into the current runtime symbol set. Its expression is a combination of table type, and schema type. A bit of logic, but nothing a reckless programmer can't handle. Wer have schemas that specify everything is named, Qson already has a form for that. We have schema in which name can be converted into square col num, I have lab code for that. Nothing a 40 line if then can't handle!

Using these queries, and assuming local name space, we take some burden off of the old : ugly, the thing that makes value changes to name space entries, especially tables. Name: is a definition that gets resolved during a table run. We have a default, simple named form, a two triple bundle. We have, naturally, name:graph, where graph is a specific, nested subgraph, including theone immediately following. bookmark:{name:"joe".address:'anywhere'} is append to bookmark, in default, ok. $schema is correct in Json schema#, anyone notice? We have a new Ugly! Sure, that helps, though a default grammar, even context specific is preferable. So I will include the new ugly to make real tables, or make schema graph separately, and bind to a table of Qson, whatever makes sense.

Not a problem.

No comments: