Summary of LightDB-A Features
This section provides a high-level overview of the system requirements and feature set of LightDB-A Database. It contains the following topics:
LightDB-A SQL Standard Conformance
The SQL language was first formally standardized in 1986 by the American National Standards Institute (ANSI) as SQL 1986. Subsequent versions of the SQL standard have been released by ANSI and as International Organization for Standardization (ISO) standards: SQL 1989, SQL 1992, SQL 1999, SQL 2003, SQL 2006, and finally SQL 2008, which is the current SQL standard. The official name of the standard is ISO/IEC 9075-14:2008. In general, each new version adds more features, although occasionally features are deprecated or removed.
It is important to note that there are no commercial database systems that are fully compliant with the SQL standard. LightDB-A Database is almost fully compliant with the SQL 1992 standard, with most of the features from SQL 1999. Several features from SQL 2003 have also been implemented (most notably the SQL OLAP features).
This section addresses the important conformance issues of LightDB-A Database as they relate to the SQL standards. For a feature-by-feature list of LightDB-A’s support of the latest SQL standard, see SQL 2008 Optional Feature Compliance.
Core SQL Conformance
In the process of building a parallel, shared-nothing database system and query optimizer, certain common SQL constructs are not currently implemented in LightDB-A Database. The following SQL constructs are not supported:
- Some set returning subqueries in
EXISTS
orNOT EXISTS
clauses that LightDB-A’s parallel optimizer cannot rewrite into joins. - Backwards scrolling cursors, including the use of
FETCH PRIOR
,FETCH FIRST
,FETCH ABSOLUTE
, andFETCH RELATIVE
. - In
CREATE TABLE
statements (on hash-distributed tables): aUNIQUE
orPRIMARY KEY
clause must include all of (or a superset of) the distribution key columns. Because of this restriction, only oneUNIQUE
clause orPRIMARY KEY
clause is allowed in aCREATE TABLE
statement.UNIQUE
orPRIMARY KEY
clauses are not allowed on randomly-distributed tables. CREATE UNIQUE INDEX
statements that do not contain all of (or a superset of) the distribution key columns.CREATE UNIQUE INDEX
is not allowed on randomly-distributed tables.Note that
UNIQUE INDEXES
(but notUNIQUE CONSTRAINTS
) are enforced on a part basis within a partitioned table. They guarantee the uniqueness of the key within each part or sub-part.VOLATILE
orSTABLE
functions cannot run on the segments, and so are generally limited to being passed literal values as the arguments to their parameters.Triggers are not generally supported because they typically rely on the use of
VOLATILE
functions. PostgreSQL Event Triggers are supported because they capture only DDL events.Referential integrity constraints (foreign keys) are not enforced in LightDB-A Database. Users can declare foreign keys and this information is kept in the system catalog, however.
Sequence manipulation functions
CURRVAL
andLASTVAL
.
SQL 1992 Conformance
The following features of SQL 1992 are not supported in LightDB-A Database:
-
NATIONAL CHARACTER
(NCHAR
) andNATIONAL CHARACTER VARYING
(NVARCHAR
). Users can declare theNCHAR
andNVARCHAR
types, however they are just synonyms forCHAR
andVARCHAR
in LightDB-A Database. -
CREATE ASSERTION
statement. -
INTERVAL
literals are supported in LightDB-A Database, but do not conform to the standard. -
GET DIAGNOSTICS
statement. -
GLOBAL TEMPORARY TABLE
s andLOCAL TEMPORARY TABLE
s. LightDB-ATEMPORARY TABLE
s do not conform to the SQL standard, but many commercial database systems have implemented temporary tables in the same way. LightDB-A temporary tables are the same asVOLATILE TABLE
s in Teradata. -
UNIQUE
predicate. -
MATCH PARTIAL
for referential integrity checks (most likely will not be implemented in LightDB-A Database).
SQL 1999 Conformance
The following features of SQL 1999 are not supported in LightDB-A Database:
- Large Object data types:
BLOB
,CLOB
,NCLOB
. However, theBYTEA
andTEXT
columns can store very large amounts of data in LightDB-A Database (hundreds of megabytes). -
MODULE
(SQL client modules). CREATE PROCEDURE
(SQL/PSM
). This can be worked around in LightDB-A Database by creating aFUNCTION
that returnsvoid
, and invoking the function as follows:SELECT *myfunc*(*args*);
The PostgreSQL/LightDB-A function definition language (
PL/PGSQL
) is a subset of Oracle’sPL/SQL
, rather than being compatible with theSQL/PSM
function definition language. LightDB-A Database also supports function definitions written in Python, Perl, Java, and R.BIT
andBIT VARYING
data types (intentionally omitted). These were deprecated in SQL 2003, and replaced in SQL 2008.LightDB-A supports identifiers up to 63 characters long. The SQL standard requires support for identifiers up to 128 characters long.
Prepared transactions (
PREPARE TRANSACTION
,COMMIT PREPARED
,ROLLBACK PREPARED
). This also means LightDB-A does not supportXA
Transactions (2 phase commit coordination of database transactions with external transactions).CHARACTER SET
option on the definition ofCHAR()
orVARCHAR()
columns.Specification of
CHARACTERS
orOCTETS
(BYTES
) on the length of aCHAR()
orVARCHAR()
column. For example,VARCHAR(15 CHARACTERS)
orVARCHAR(15 OCTETS)
orVARCHAR(15 BYTES)
.CREATE DISTINCT TYPE
statement.CREATE DOMAIN
can be used as a work-around in LightDB-A.The explicit table construct.
SQL 2003 Conformance
The following features of SQL 2003 are not supported in LightDB-A Database:
-
MERGE
statements. -
IDENTITY
columns and the associatedGENERATED ALWAYS/GENERATED BY DEFAULT
clause. TheSERIAL
orBIGSERIAL
data types are very similar toINT
orBIGINT GENERATED BY DEFAULT AS IDENTITY
. -
MULTISET
modifiers on data types. -
ROW
data type. - LightDB-A Database syntax for using sequences is non-standard. For example,
nextval('seq')
is used in LightDB-A instead of the standardNEXT VALUE FOR seq
. -
GENERATED ALWAYS AS
columns. Views can be used as a work-around. - The sample clause (
TABLESAMPLE
) onSELECT
statements. Therandom()
function can be used as a work-around to get random samples from tables. - The partitioned join tables construct (
PARTITION BY
in a join). - LightDB-A array data types are almost SQL standard compliant with some exceptions. Generally customers should not encounter any problems using them.
SQL 2008 Conformance
The following features of SQL 2008 are not supported in LightDB-A Database:
-
BINARY
andVARBINARY
data types.BYTEA
can be used in place ofVARBINARY
in LightDB-A Database. The
ORDER BY
clause is ignored in views and subqueries unless aLIMIT
clause is also used. This is intentional, as the LightDB-A optimizer cannot determine when it is safe to avoid the sort, causing an unexpected performance impact for suchORDER BY
clauses. To work around, you can specify a really largeLIMIT
. For example:SELECT * FROM mytable ORDER BY 1 LIMIT 9999999999
The row subquery construct is not supported.
TRUNCATE TABLE
does not accept theCONTINUE IDENTITY
andRESTART IDENTITY
clauses.
LightDB-A and PostgreSQL Compatibility
LightDB-A Database is based on PostgreSQL 9.4. To support the distributed nature and typical workload of a LightDB-A Database system, some SQL commands have been added or modified, and there are a few PostgreSQL features that are not supported. LightDB-A has also added features not found in PostgreSQL, such as physical data distribution, parallel query optimization, external tables, resource queues, and enhanced table partitioning. For full SQL syntax and references, see the SQL Commands.
Note LightDB-A Database does not support the PostgreSQL large object facility for streaming user data that is stored in large-object structures.
Note VMware does not support using
WITH OIDS
oroids=TRUE
to assign an OID system column when creating or altering a table. This syntax is deprecated and will be removed in a future LightDB-A release.
SQL Command | Supported in LightDB-A | Modifications, Limitations, Exceptions |
---|---|---|
ALTER AGGREGATE |
YES | |
ALTER CONVERSION |
YES | |
ALTER DATABASE |
YES | |
ALTER DOMAIN |
YES | |
ALTER EVENT TRIGGER |
YES | |
ALTER EXTENSION |
YES | Changes the definition of a LightDB-A Database extension - based on PostgreSQL 9.6. |
ALTER FUNCTION |
YES | |
ALTER GROUP |
YES | An alias for ALTER ROLE |
ALTER INDEX |
YES | |
ALTER LANGUAGE |
YES | |
ALTER OPERATOR |
YES | |
ALTER OPERATOR CLASS |
YES | |
ALTER OPERATOR FAMILY |
YES | |
ALTER PROTOCOL |
YES | |
ALTER RESOURCE QUEUE |
YES | LightDB-A Database resource management feature - not in PostgreSQL. |
ALTER ROLE |
YES | LightDB-A Database Clauses:
|
ALTER SCHEMA |
YES | |
ALTER SEQUENCE |
YES | |
ALTER SYSTEM |
NO | |
ALTER TABLE |
YES | Unsupported Clauses / Options:
LightDB-A Database Clauses:
|
ALTER TABLESPACE |
YES | |
ALTER TRIGGER |
NO | |
ALTER TYPE |
YES | LightDB-A Database Clauses:
|
ALTER USER |
YES | An alias for ALTER ROLE |
ALTER VIEW |
YES | |
ANALYZE |
YES | |
BEGIN |
YES | |
CHECKPOINT |
YES | |
CLOSE |
YES | |
CLUSTER |
YES | |
COMMENT |
YES | |
COMMIT |
YES | |
COMMIT PREPARED |
NO | |
COPY |
YES | Modified Clauses:
LightDB-A Database Clauses:
|
CREATE AGGREGATE |
YES | Unsupported Clauses / Options:
LightDB-A Database Clauses:
Limitations: The functions used to implement the
aggregate must be |
CREATE CAST |
YES | |
CREATE CONSTRAINT TRIGGER |
NO | |
CREATE CONVERSION |
YES | |
CREATE DATABASE |
YES | |
CREATE DOMAIN |
YES | |
CREATE EVENT TRIGGER |
YES | |
CREATE EXTENSION |
YES | Loads a new extension into LightDB-A Database - based on PostgreSQL 9.6. |
CREATE EXTERNAL TABLE |
YES | LightDB-A Database parallel ETL feature - not in PostgreSQL 9.4. |
CREATE FUNCTION |
YES | Limitations: Functions defined as
|
CREATE GROUP |
YES | An alias for CREATE ROLE |
CREATE INDEX |
YES | LightDB-A Database Clauses:
Limitations:
|
CREATE LANGUAGE |
YES | |
CREATE MATERIALIZED VIEW |
YES | Based on PostgreSQL 9.4. |
CREATE OPERATOR |
YES | Limitations: The function used to implement the
operator must be an |
CREATE OPERATOR CLASS |
YES | |
CREATE OPERATOR FAMILY |
YES | |
CREATE PROTOCOL |
YES | |
CREATE RESOURCE QUEUE |
YES | LightDB-A Database resource management feature - not in PostgreSQL 9.4. |
CREATE ROLE |
YES | LightDB-A Database Clauses:
|
CREATE RULE |
YES | |
CREATE SCHEMA |
YES | |
CREATE SEQUENCE |
YES | Limitations: The The
|
CREATE TABLE |
YES | Unsupported Clauses / Options:
Limited Clauses:
LightDB-A Database Clauses:
|
CREATE TABLE AS |
YES | See CREATE TABLE |
CREATE TABLESPACE |
YES | LightDB-A Database Clauses: Specify host file system locations for specific segment instances.
|
CREATE TRIGGER |
NO | |
CREATE TYPE |
YES | LightDB-A Database Clauses:
Limitations: The functions
used to implement a new base type must be |
CREATE USER |
YES | An alias for CREATE ROLE |
CREATE VIEW |
YES | |
DEALLOCATE |
YES | |
DECLARE |
YES | Unsupported Clauses /
Options:
Limitations: Cursors cannot be backward-scrolled. Forward scrolling is supported. PL/pgSQL does not have support for updatable cursors. |
DELETE |
YES | |
DISCARD |
YES |
Limitation:
|
DO |
YES | PostgreSQL 9.0 feature |
DROP AGGREGATE |
YES | |
DROP CAST |
YES | |
DROP CONVERSION |
YES | |
DROP DATABASE |
YES | |
DROP DOMAIN |
YES | |
DROP EVENT TRIGGER |
YES | |
DROP EXTENSION |
YES | Removes an extension from LightDB-A Database – based on PostgreSQL 9.6. |
DROP EXTERNAL TABLE |
YES | LightDB-A Database parallel ETL feature - not in PostgreSQL 9.4. |
DROP FUNCTION |
YES | |
DROP GROUP |
YES | An alias for DROP ROLE |
DROP INDEX |
YES | |
DROP LANGUAGE |
YES | |
DROP OPERATOR |
YES | |
DROP OPERATOR CLASS |
YES | |
DROP OPERATOR FAMILY |
YES | |
DROP OWNED |
NO | |
DROP PROTOCOL |
YES | |
DROP RESOURCE QUEUE |
YES | LightDB-A Database resource management feature - not in PostgreSQL 9.4. |
DROP ROLE |
YES | |
DROP RULE |
YES | |
DROP SCHEMA |
YES | |
DROP SEQUENCE |
YES | |
DROP TABLE |
YES | |
DROP TABLESPACE |
YES | |
DROP TRIGGER |
NO | |
DROP TYPE |
YES | |
DROP USER |
YES | An alias for DROP ROLE |
DROP VIEW |
YES | |
END |
YES | |
EXECUTE |
YES | |
EXPLAIN |
YES | |
FETCH |
YES | Unsupported Clauses /
Options:
Limitations: Cannot fetch rows in a nonsequential fashion; backward scan is not supported. |
GRANT |
YES | |
INSERT |
YES | |
LATERAL Join Type |
NO | |
LISTEN |
YES | |
LOAD |
YES | |
LOCK |
YES | |
MOVE |
YES | See FETCH |
NOTIFY |
YES | |
PREPARE |
YES | |
PREPARE TRANSACTION |
NO | |
REASSIGN OWNED |
YES | |
REFRESH MATERIALIZED VIEW |
YES | Based on PostgreSQL 9.4. |
REINDEX |
YES | |
RELEASE SAVEPOINT |
YES | |
RESET |
YES | |
RETRIEVE |
YES | LightDB-A Database parallel retrieve cursor - not in PostgreSQL 9.4. |
REVOKE |
YES | |
ROLLBACK |
YES | |
ROLLBACK PREPARED |
NO | |
ROLLBACK TO SAVEPOINT |
YES | |
SAVEPOINT |
YES | |
SELECT |
YES | Limitations: Limited use of Text search ( LightDB-A Database Clauses (OLAP):
|
SELECT INTO |
YES | See SELECT |
SET |
YES | |
SET CONSTRAINTS |
NO | In PostgreSQL, this only applies to foreign key constraints, which are currently not enforced in LightDB-A Database. |
SET ROLE |
YES | |
SET SESSION AUTHORIZATION |
YES | Deprecated as of PostgreSQL 8.1 - see SET ROLE |
SET TRANSACTION |
YES | Limitations:
|
SHOW |
YES | |
START TRANSACTION |
YES | |
TRUNCATE |
YES | |
UNLISTEN |
YES | |
UPDATE |
YES | Limitations:
|
VACUUM |
YES | Limitations:
|
VALUES |
YES |