SQL5 (bringing DBMS in correspondence to modern communication requirements).

D.Turin, dmitryturin@yandex.ru

Author see the following opportunity for business of companies, working in sphere of creating data storages:

  1. Simple man can't program via sophisticated proprietary web-server
  2. Request into several databases does not exist
  3. Notebooks need several switching-on and switching-off during transaction
  4. Distance between strings are not supported, that makes aproximate searching impossible
  5. There is no possibility to hide some (not all) records of table, granted to other users, from these users
  6. There is no methodics to present and process 3-dimensional spatial objects
  7. Simple man can't create intermediate program between database and OpenGL
Proposed solutions to these opportunities:
  1. DBMS inserts into tables and selects from tables along correlation Primary Key - Foreign Key
  2. Databases get nicknames, groups of databases get name of group. These names are used in requests
  3. Operator to freeze transaction
  4. Operator to order records on base of distance between strings
  5. Subdivide records of all tables into classes, specify class number in record
  6. Consider penultimate section of a tree as containing triangles, and last section as containing points
  7. Use 'projection', similar 'order by' and 'having'; send output directly to client
Detailed these solutions are stated in presentation:
[slides 2-13]
Problem:
Browser is very widespread client in epoch of internet. Non-programmers can master 'insert', 'select', 'update', 'delete', but are not capable to use sophisticated syntax of proprietary web-server for input of XML. It's necessary to exclude this syntax, and give possibility to install DBMS and immediately use it, like user install and use Teleport, FlashGet, browser and so on.
Solution:
DBMS itself must communicate via HTTP, accept XML, and place data from it into tables under some agreement. My proposal about agreement: If user uses simple scheme, than this is enough! An ambiguity can exist in complex scheme because of several refering fields, than user must append symbol '#' and name of necessary refering field to end of name of sending XML-tag (it looks like new tag name with symbol '#' inside name). Let's name this by term 'determination' [symbol '$' is used for list to have possibility to solve ambiguity for list simultaneously with ambiguity for enclosed XML-element, i.e. to append two refering field to name of sending XML-tag].

P.S. [slides 14-24]
Of course, we spead decision to manual 'insert'.

[slides 25-37]
Problem:
Usage of both SQL/XML-functions, and syntax of proprietary web-server give very bulky code to extract tree as XML. This makes more difficulties for contact of DBMS on CML, GML, HumanML, OPML, RCML, SBML, ebXML, MDDL, RIXML, XBRL, xCBL and other (turing all relational fields into XML-elements is suitable for browser, but not suitable for other cases).
Solution:
To avoid sophisticated programing, 'select' itself must return data to client (if only 'select' is not used inside 'insert ... select ...'). I propose laconic 'select a.b.c' to select data from tables 'a', 'b', 'c'. Let's name this by term 'XTree' - in analogy with 'XPath'. If user uses simple scheme, than this is enough! An ambiguity can exist in complex scheme because of several refering fields, than user must append symbol '#' and name of necessary refering field to end of table name (it looks like new table name with symbol '#' inside name). Let's name this by term 'refinement'.

P.S. [slides 38-45]
All possible compositions of determinations in XML-tree and all possible compositions of refinement in 'select' are considered, appropriate XML- and SQL-syntaxes are proposed.

P.S. [slides 47-55]
Examples of usage of refinement are demonstrated.

[slides 56-59-64]
Problem:
Non-predictable/non-repeated input data (XML-elements) is written into XML-field of relational table. XQuery is offered to process data in these xml-fields. But user is not capable to manipulate records by SQL and XML-elements by XQuery in one request (even in case of refusal from relational storage in favour of XML-database, that means in favour of non-relational 'engine', enclosed cycles of XQuery create very bulky code, in which user is not orientated).
Solution:
I propose to append XPath into SQL, that SQL can process XML-elements and attributes (i.e. to avoid XQuery). Thus SQL can process records and XML-elements simultaneously.

P.S. [slides 65-79]
Of course, we generalize XPath and XTree upto XLang, and consider all possible use cases.

[slides 80-91-116-125]
Problem:
SQL would more flexible and convenient for distributed request (gethering data from several databases and scattering them into several databases), than branded programs; including SQL is more convenient for replication, than branded programs. But there is no necessary syntax.
Solution:
Each database has nickname. Nicknames are specified in requests as prefix before table name. Group of databases is named society. Name of society also can be specified as prefix before table name, and means nicknames of all databases of group. Thus one SQL-statement, containing society name, means a great number of SQL-statements with nicknames. That nicknames, several societies or several mentions of one society don't specify the same database simultaneously, we place symbol '%' before them (let's name so prefix as restricted prefix). That several mentions of one society synchronously specify the same database, we place any (identical) word and symbol '%' before this mentions (let's name this word as marker, and this prefix as marked prefix). 'Default' database is database, in which all nicknames and societies are stored. And prefix 'all' means all databases, known for default database. Nickname can has numeric parameter NID (nick identifier). It is not accessable to change in requests to process data, and is designated as '%%'.

In purpose of security, distributed requests must satisfy some requirements. I propose whole mistrust to DBMS: And i also propose to expect quite simplicity of client: So DBMS-1 can't create and enter SQL-command into DBMS-2 directly or indirectly (asking client to forward command). And client can't derive SQL-command on base of entered SQL-command (all, what it has, is last SQL-command, stored in own stack). I propose to DBMS-1 to transfer XML-commands to client, which force client to make simple (string) transformation of SQL-command, stored in client stack, and send result of transformation into DBMS-2. Transformations must be so limited, that to not allow appearance of SQL-command, harm for DBMS-2. I propose to arrange these XML-commands as <?name?> to distinguish them from XML-data (traditionaly arranged as <name>).

[slide 127]
Problem:
User makes transaction from notebook, and needs to switch-off notebook without commit or rollback of transaction to continue transaction from left stage at next switching-on.
Solution:
I propose command 'freeze', similar to command 'disconnet', which save transaction in current state; and command 'unfreeze', similar to command 'connect', which continue frozen transaction (instead to start new transaction). 'Freeze' returns identifier of frozen transaction, which should be used in 'Unfreeze'.

P.S. [slide 128]
Now savepoint can be used only to rollback to it. I propose command 'commit savepoint' (commit all actions, made before savepoint), that is useful in much cases before command 'freeze'.

[slide 129]
Problem:
Commiting of distrubited transaction (being executed in several databases) is not fails in all databases at once. It's not reasonable to rollback transaction in databases, which remain healthy, to begin transaction in them from very beginning - it's reasonable to wait repearing of failed databases to commit transaction together with them. So we need to freeze command 'commit' in healthy databases in process of executing it (as well as in case of freezing transaction, let client messages will be SQL-commands, and server messages will be XML-commands).
Solution:
I propose to enter client message 'postpone' to freeze commit on second phase, and client message 'adjourn' to freeze on third phase.

[slide 133]
Problem:
At stream processing (when new records enter quickly, in much quantity), it's necessary to execute aggregate only on several last entered records (to organize slip slot), but creating index on field, sequencing records, sorting on this index with purpose to cut only needed quantity of records brakes processing of stream.
Solution:
Limit quantity of records in a table, make queue of records, automatically delete records from beginning of queue at arrival of new records - and start aggregates for all records of such specially orginized table. To save records, automatically deleted from beginning of the queue, it's possible to copy them automatically into other usual table (which will save them permanently).

[slides 134-138]
Problem:
Distance between strings are not supported, that makes search of similar strings and ordering by degree of resemblance.
Solution:
Method of calculation of distance between strings and operator, ordering records by this factor.

[slides 139-151]
Problem:
There is no datatypes or other methodics to present 3-dimensional spatial objects. Functions to process them are absent too.
Solution:
Consider the penultimate section of a tree as containing triangles, from which 3-dimensional object is built; and the last section as containing points, from which corresponding triangle is built. Use functions to check tree on identicality; on equality of space, occupied by objects (by volume and configuration); on touch, intersection, inclusion of one object into another. Shift, rotate, sprain object as united whole by operation 'update; use triggers for these operation.

[slides 152-160-163]
Problem:
Simple man can't create intermediate program, requesting spatial data from database and displaying them by OpenGL.
Solution:
Use 'projection', similar 'order by' and 'having'; send output to client directly. Receive shifts, rotations, sprains of objects, made by mouse, from client and interpret them as made by operation 'update'. Enter triggers for operations of getting focus, click and double-click.

P.S. [slides 164-165]
Example of visualization of 3-dimensional objects without intermediate program is demonstrated.
P.S. [slides 166-178]
Of course, we spead manner of coding of data to 2-dimensional case.
P.S. [slides 179-182]
Of course, we spead manner of visualization of data to 2-dimensional case.
P.S. [slides 185-188]
Of course, we allow to attach texture to surface of 3-dimensional object.

[slides 191]
Problem:
There is no possibility to hide some (not all) records from other database user
Solution:
Subdivide records of all tables into not crossing classes, specify number of class in special field of records.

Slides of presentation http://sql50.euro.ru/sql5.15.2.pdf

Partial description of slides: SQL 5.15.2

References:

  1. SQL Standard - SQL/XML Functionality. ISO/IEC JTC1/SC32 #1293, 2005-04-22. http://jtc1sc32.org/doc/N1251-1300/32N1293-WG3-Presentation-for-SC32-20050418.pdf
  2. K.Kulkarni. Overview of SQL:2003. p. 65, part 14 "SQL/XML", Silicon Valley Laboratory, IBM Corporation, San Jose, 2003-11-06. http://www.wiscorp.com/SQL2003Features.pdf
  3. Folksonomy. //Wikipedia. http://en.wikipedia.org/wiki/Folksonomy
  4. Mash-up, syndication. //Wikipedia. http://en.wikipedia.org/wiki/Web_2.0
  5. The Big List of XML Technologies. http://xmlsucks.org/xml_technologies/
  6. N.Mattos, H.Darwen, P.Cotton, P.Pistor, K.Kulkarni, S.Dessloch, K.Zeidenstein. SQL99, SQL/MM, and SQLJ: An Overview of the SQL standards. http://www.wiscorp.com/sql1999_c3.zip
  7. How to add style to XML. //W3C papers. http://www.w3.org/Style/styling-XML
  8. CSS & XSL. //W3C papers. http://www.w3.org/Style/CSS-vs-XSL
  9. XML Path Language (XPath). Version 1.0. //W3C Recommendation, 16 November 1999. http://www.w3.org/TR/xpath
  10. XML submission. //Web Forms 2.0, Working Draft, 12 October 2006. http://www.whatwg.org/specs/web-forms/current-work/#x-www-form-xml
  11. Sending of hidden tree of tags. //HTML6. http://html60.euro.ru/site/html60/en/author/hidden_eng.htm
  12. Unification of WebForms2 and XForms. //HTML6. http://html60.euro.ru/site/html60/en/author/quest_eng.htm
  13. Style of attribute (of virtual tag). //HTML6. http://html60.euro.ru/site/html60/en/author/forxml_eng.htm
  14. P.Scarponcini. SQL Multimedia and Application Packages - Part 3: Spatial. Bentley Transportation, 2000-03-26. http://www.wiscorp.com/sqlspat.zip
  15. Vector graphics in format and via protocol of X11. //HTML6. http://html60.euro.ru/site/html60/en/author/scene_eng.htm
  16. Usage of control symbols to archive XML. //Unicode7. http://unicode70.euro.ru/site/unicode70/en/author/archiving_eng.htm
  17. Dictionaries of bxml-files. //Computer2. http://computer20.euro.ru/site/computer20/en/author/dictionary_eng.htm