Hot news

Why Oracle DB?

Oracle is the most suitable DB for storing data in high- security mode, arranging BigData , implementing any idea in many applications . ...

Showing posts with label type. Show all posts
Showing posts with label type. Show all posts

2018-06-23

Indexes as quick sorting (II)

Part II – What index?

The previous part of index describing showed some examples of DML fast execution.
Now not only char columns are used in BigData. And it seems that Oracle can't work with all of them:
"
You cannot create an index on columns or attributes whose type is user-defined, LONG, LONG RAW, LOB, or REF, except that Oracle Database supports an index on REF type columns or attributes that have been defined with a SCOPE clause.
"
Don't worry. Oracle DB has a workaround. There are many types of indexes.
Note: The following screen shots are from Oracle SQL Developer and SQLDetective applications.
Oracle SQL Developer SQLDetective
Don't forget to set Storage parameters on index creating.
Not all of them are allowed for altering:
Create indexes only for frequent using statements
because the index is stored in tablespace as a table copy.

Here are some useful words from Oracle Documentation about index organizations:
* B-tree (short for balanced trees) indexes
     * Index-organized tables
          Index-organized tables are useful when related pieces of data must be stored together or data must be physically stored in a specific order. A typical use of this type of table is for information retrieval, spatial data, and OLAP applications.
          A secondary index is an index on an index-organized table.
Oracle SQL Developer SQLDetective
Table Wizards for Index-Organized table creating

     * Reverse key indexes
          The bytes of the index key are reversed.
     * Descending indexes
          Descending order of data is used.
     * B-tree cluster indexes
          Instead of pointing to a row, the key points to the block that contains rows related to the cluster key.
Oracle SQL Developer SQLDetective
There is no Cluster Wizard in Oracle SQL Developer
An index on cluster may be created by object wizard in SQLDetective only

* Bitmap and bitmap join indexes
     In a bitmap index, an index entry uses a bitmap to point to multiple rows. In contrast, a B-tree index entry points to a single row
Oracle SQL Developer SQLDetective
Only SQLDetective 4.4 allows to set joins

* Function-based indexes
     Function-based indexes are efficient for evaluating statements that contain functions in their WHERE clauses.
Oracle SQL Developer SQLDetective
Type manually your formula into "Expression" editor.
SQLDetective has a tool for generating an expression,
but it's used in Query Builder only.

* Application domain indexes
     You can encapsulate application-specific index management routines as an indextype schema object, and then define a domain index on table columns or attributes of an object type. Extensible indexing can efficiently process application-specific operators.
Oracle SQL Developer SQLDetective
An indextype in Oracle SQL Developer
you should create manually,
it's not supported by object wizard.
SQLDetective supports the Indextype Wizard.
     Extensive indexing can:
          Accommodate indexes on customized, complex data types such as documents, spatial data, images, and video clips (see "Unstructured Data")
          Make use of specialized indexing techniques

* System indexes are created automatically for table constraints except foreign key.

On index creating and modifying, please, don't fully rely on wizard UI as they support not all logical issues and some rare or not-described in Oracle Documentation clauses are not supported by the developer application.
For using index abilities you should create objects of some other types ("Create Table (index organized)", "Create Cluster", "Create Indextype", "Create Operator", "Create Type"):
Oracle SQL Developer SQLDetective
Oracle SQL Developer doesn't support Clusters and Indextypes wizards 

Read about some other index options in the next topic.

2017-12-31

Object, type, class

One pic is better then a hundred words. Conquest Software Solutions company sales products for Oracle DB and PL/SQL developers. But topics in their Facebook account say about rules or structure of other program languages. On other side all products have the intuitive interface: tree of DB objects, Code Explorer, highlighted reserved words in code editors, object wizards with auto-generating DDL.
Unfortunately, ClearSQL does not have the Icon Dictionary like in SQLDetective or Legend of Icons like in ClearDB Docu, and some of icons are the same in all products.
Referencing to the re-posted article "Programmer dictionary: Class vs Type vs Object" here is the list of useful icons and DB, object structure in all Conquest products.
Icon Dictionary in SQLDetective has the list of all used icons: object type, collection (as part of object types), in-out parameters of stored objects, types of table columns and so on:

"Icons Legend" is a part of "Docu at a Glance" page of ClearDB Docu. Note: all icons are different in SQLDetective and ClearDB.

Tree in ObjectSelector of Object Navigator in SQLDetective lists the stored object structure: subprograms, parameters. For example, the package specification structure:

ClearDB Docu lists objects in the docu tree grouped by object types:

Tree in ObjectSelector of Object Navigator in SQLDetective groups TYPES (user-defined, non-standard) in the OBJECTS and COLLECTIONS folders with their attributes (variables) and methods (subprograms, functions):

ClearDB doesn't divide COLLECTIONS from TYPES, and there is no object structure (attributes, methods, subprograms) in docu tree or page content with object properties, only global parameters may be listed:

CLASSES in Oracle DB are in Java objects. For example, SQLDetective / Object Navigator:

JAVA CLASSES in ClearDB / Docu:

SCHEDULE JOB CLASSES in SQLDetective / Object Navigator:

SCHEDULE JOB CLASSES in ClearDB / Docu:

As you see the Oracle objects have GROUPS as analog of CLASSES: REFRESH GROUPS for Materialized Views, POLICY GROUPS, RESOURCE CONSUMER GROUPS for Users, SCHEDULE GROUPS for schema or DB levels.
PL/SQL reserved words are highlighted in code editors of ClearSQL and SQLDetective, IN-OUT parameters have the same icons in Code Explorer of both applications. Unfortunately, if a variable in stored object has a type of table column then Code Explorer doesn't show the corresponding type icon, it's "unnamed" always even DB connection is alive.



Stored object may declare a type or use the user-defined one. Oracle DB has the list of standard types (numeric, char, date, etc.) for parameters or variables and special objects – TYPES – that are used in PL/SQL as user-defined types. So, Oracle distinguishes the types as standalone DB objects.