Example: SHOW HASH INDEX in XML Format - Analytics Database - Teradata Vantage

SQL Data Definition Language Syntax and Examples

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-10-04
dita:mapPath
jco1628111346878.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
mdr1472255012272
lifecycle
latest
Product Category
Teradata Vantage™

Assume you alter the hash index to use a sparse map:

ALTER HASH INDEX ord_cust_hidx, MAP=SmallTableMap;

This example returns the create text for hash index ord_cust_hidx in XML format:

SHOW IN XML HASH INDEX ord_cust_hidx;

The XML document generated reports all of the information required to recreate the hash index:

     <?xml version="1.0" encoding="UTF-8" standalone="no" ?><TeradataDBObjectSet version="1.0" xmlns="http://schemas.teradata.com/dbobject" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.teradata.com/dbobject http://schemas.teradata.com/dbobject/DBObject.xsd">
<HashIndex baseDBName="YourDB" baseTableName="orders" checkSumLevel="Default" colocateName="YourDB_ord_cust_hidx" dbName="YourDB" fallback="false" map="SmallTableMap" map_kind="sparse" name="ord_cust_hidx" objId="0:3655" objVer="2"><IndexColumnList><Column name="o_date" order="1"/></IndexColumnList><DistributeColumnList><Column name="o_date" order="1"/></DistributeColumnList><OrderBy mode="Value"/>
<SQLText><![CDATA[CREATE HASH INDEX YourDB.ord_cust_hidx ,NO FALLBACK 
,CHECKSUM = DEFAULT, 
MAP = SmallTableMap COLOCATE USING YourDB_ord_cust_hidx
(o_date )
 ON YourDB.orders 
 BY (o_date )
 ORDER BY VALUES
;]]></SQLText></HashIndex><Environment><Server dbRelease="16.10" dbVersion="16.10" hostName="localhost"/><User userId="00000704" userName="User"/><Session charset="UTF8" dateTime="2017-03-24T17:22:48"/></Environment></TeradataDBObjectSet>