Skip to content

Commit

Permalink
1. Added Expression to CREATE INDEX. #2595
Browse files Browse the repository at this point in the history
2. Added support for ALTER INDEX column statistics. #6375
  • Loading branch information
anilsahoo20 committed Jul 20, 2023
1 parent 69dec1b commit ec647b4
Show file tree
Hide file tree
Showing 40 changed files with 1,247 additions and 223 deletions.
Binary file added docs/en_US/images/index_columns.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/en_US/images/index_definition.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/en_US/images/index_general.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/en_US/images/index_sql.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 18 additions & 10 deletions docs/en_US/index_dialog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Use the *Index* dialog to create an index on a specified table or materialized
view.

The *Index* dialog organizes the development of a index through the following
dialog tabs: *General* and *Definition*. The *SQL* tab displays the SQL code
dialog tabs: *General*, *Definition*, and *Columns*. The *SQL* tab displays the SQL code
generated by dialog selections.

.. image:: images/index_general.png
Expand Down Expand Up @@ -76,28 +76,36 @@ Use the fields in the *Definition* tab to define the index:
expression limits the entries in the index to those rows that satisfy the
constraint.

Use the context-sensitive fields in the *Columns* panel to specify which
column(s) the index queries. Click the *Add* icon (+) to add a column:
Click the *Columns* tab to continue.

* Use the drop-down listbox in *Column* field to select the name of the column
rom the table.
.. image:: images/index_columns.png
:alt: Index dialog columns tab
:align: center

Use the fields in the *Columns* tab to specify which column(s) or expression(s)
the index queries. Use the *Is expression ?* switch to enable
expression sql input. Use the drop-down listbox next to *Column*
to select a column. Once the *Column* is selected or the *Expression* is
entered then click the *Add* icon (+) to provide details of the action on the
column/expression:

* The *Col/Exp* field is populated with the selection made in the *Column*
drop-down listbox or the *Expression* entered.
* If enabled, use the drop-down listbox to select an available *Operator class*
to specify the type of action performed on the column.
* If enabled, move the *Sort order* switch to specify the sort order:
* If enabled, use the drop-down listbox to select *Sort order*:

* Select *ASC* to specify an ascending sort order (the default);
* Select *DESC* to specify a descending sort order.

* If enabled, move the *Nulls* switch to specify the sort order of nulls:
* If enabled, use the drop-down listbox to select *Nulls*:

* Select *First* to specify nulls sort before non-nulls;
* Select *Last* to specify nulls sort after non-nulls (the default).

* Use the drop-down listbox in the *Collation* field to select a collation to
use for the index.

Use *Include columns* field to specify columns for *INCLUDE* clause of the
index. This option is available in Postgres 11 and later.
constraint. This option is available in Postgres 11 and later.

Click the *SQL* tab to continue.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//
//////////////////////////////////////////////////////////////

import IndexSchema, { getColumnSchema } from './index.ui';
import IndexSchema from './index.ui';
import { getNodeAjaxOptions, getNodeListByName } from 'pgbrowser/node_ajax';
import _ from 'lodash';

Expand Down Expand Up @@ -46,7 +46,7 @@ define('pgadmin.node.index', [
hasSQL: true,
hasDepends: true,
hasStatistics: true,
width: pgBrowser.stdW.md + 'px',
width: pgBrowser.stdW.lg + 'px',
statsPrettifyFields: [gettext('Size'), gettext('Index size')],
url_jump_after_node: 'schema',
Init: function() {
Expand Down Expand Up @@ -124,13 +124,14 @@ define('pgadmin.node.index', [
getSchema: (treeNodeInfo, itemNodeData) => {
let nodeObj = pgAdmin.Browser.Nodes['index'];
return new IndexSchema(
()=>getColumnSchema(nodeObj, treeNodeInfo, itemNodeData),
{
tablespaceList: ()=>getNodeListByName('tablespace', treeNodeInfo, itemNodeData, {}, (m)=>{
return (m.label != 'pg_global');
}),
amnameList : ()=>getNodeAjaxOptions('get_access_methods', nodeObj, treeNodeInfo, itemNodeData, {jumpAfterNode: 'schema'}),
columnList: ()=>getNodeListByName('column', treeNodeInfo, itemNodeData, {}),
collationList: ()=>getNodeAjaxOptions('get_collations', nodeObj, treeNodeInfo, itemNodeData, {jumpAfterNode: 'schema'}),
opClassList: ()=>getNodeAjaxOptions('get_op_class', nodeObj, treeNodeInfo, itemNodeData, {jumpAfterNode: 'schema'})
},
{
node_info: treeNodeInfo
Expand Down
Loading

0 comments on commit ec647b4

Please sign in to comment.