Sybase’s main DBMS product was originally marketed as Sybase SQL Server and was co-developed for PC by Sybase, Microsoft, and Ashton-Tate. In 1993, the co-development licensing agreement terminated, and Sybase and Microsoft continued developing their respective products. In 1996, Sybase changed the name of its product to Adaptive Server Enterprise (ASE) as a means to differentiate its SQL Server product from Microsoft SQL Server.
Nested Loop Join Hash Join Sort-Merge Join
Sybase ASE provides four main joins: NESTED LOOP JOIN
, MERGE JOIN
, HASH JOIN
, and NARY NESTED LOOP JOIN
.
NESTED LOOP JOIN is a binary operator where the left child and right child form the outer data stream and inner data stream, respectively.
MERGE JOIN is a binary operator where the left and right children are also the outer and inner data streams, respectively. Both streams are sorted on the key of the MERGE JOIN. MERGE JOIN is usually effective when most of the rows must be processed and when large input streams are already sorted on join keys.
HASH JOIN is a binary operator such that the left child creates the build input stream and the right child creates the probe input stream. From the input stream, each row is read and hashed into a bucket.
NARY NESTED LOOP JOIN is created during code generation and is never evaluated or chosen by the optimizer. NARY NESTED LOOP JOIN execution has a performance benefit over the execution of a series of NESTED LOOP JOIN operators, as the next row fetched comes from the scan that produced the failing searchable argument value, reducing unnecessary I/O's.
ASE uses B tree indexing, and indexes provided are either clustered or non-clustered and can have a root level, leaf level, and/or intermediate level. Only one clustered index can be created on a table, but up to 249 non-clustered indexes can be created per table. Index entries are stored as rows on index pages and contain key and value pointers to lower levels of the index, data pages, or individual data rows. An index on a 15-byte field has around 100 rows per index page.
Table data is physically stored in the order of the keys on the index. For allpages-locked tables, rows are stored in key order on pages that are linked in key order. For data-only-locked tables, indexes are used to handle data storage on rows and pages, but key ordering is not preserved.
Storage order of data is unrelated to index keys.
The root level is the index's highest level and corresponds to one root page. If an allpages-locked table is small enough such that one page can fit the whole index, then intermediate or leaf levels are not used, and the root page stores pointers to data pages. Data-only-locked tables always have a leaf level between the root and data pages. Otherwise, for larger tables, the root page stores pointers to intermediate or leaf-level pages.
Any level between the root level and leaf level is an intermediate level; many such levels may exist.
The leaf level is lowest level of the index. It contains a key value for every table row (which is stored in sorted order by index key). For clustered indexes on allpages-locked tables, the leaf level is the data. For nonclustered indexes and clustered indexes on data-only-locked tables, the leaf level is a level above the data and contains an index row per data row. The leaf level has the index key value for each row, a pointer to the page where the row is stored, and a pointer to the rows on the data page. Storage for index rows is done in key value order.
Multi-version Concurrency Control (MVCC)
Sybase ASE uses multi-version concurrency control where all transactions are performed in the in-memory row storage or on disk MVCC, which enables the server to lock rows for writing in one session while granting access to unaltered rows in another session.
The database runs entirely in the Adaptive Server memory space (cache), so neither log nor data is ever written to disk, and I/O is not required. Its performance can be better than a disk-oriented database, at the cost of durability. In the event of memory failure, the database cannot be recovered.