Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
indexes-collations.html31 linesDownload Raw Back to html
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>11.11. Indexes and Collations</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="indexes-opclass.html" title="11.10. Operator Classes and Operator Families" /><link rel="next" href="indexes-examine.html" title="11.12. Examining Index Usage" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">11.11. Indexes and Collations</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="indexes-opclass.html" title="11.10. Operator Classes and Operator Families">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="indexes.html" title="Chapter 11. Indexes">Up</a></td><th width="60%" align="center">Chapter 11. Indexes</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 16.3 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="indexes-examine.html" title="11.12. Examining Index Usage">Next</a></td></tr></table><hr /></div><div class="sect1" id="INDEXES-COLLATIONS"><div class="titlepage"><div><div><h2 class="title" style="clear: both">11.11. Indexes and Collations <a href="#INDEXES-COLLATIONS" class="id_link">#</a></h2></div></div></div><p>3   An index can support only one collation per index column.4   If multiple collations are of interest, multiple indexes may be needed.5  </p><p>6   Consider these statements:7</p><pre class="programlisting">8CREATE TABLE test1c (9    id integer,10    content varchar COLLATE "x"11);12 13CREATE INDEX test1c_content_index ON test1c (content);14</pre><p>15   The index automatically uses the collation of the16   underlying column.  So a query of the form17</p><pre class="programlisting">18SELECT * FROM test1c WHERE content &gt; <em class="replaceable"><code>constant</code></em>;19</pre><p>20   could use the index, because the comparison will by default use the21   collation of the column.  However, this index cannot accelerate queries22   that involve some other collation.  So if queries of the form, say,23</p><pre class="programlisting">24SELECT * FROM test1c WHERE content &gt; <em class="replaceable"><code>constant</code></em> COLLATE "y";25</pre><p>26   are also of interest, an additional index could be created that supports27   the <code class="literal">"y"</code> collation, like this:28</p><pre class="programlisting">29CREATE INDEX test1c_content_y_index ON test1c (content COLLATE "y");30</pre><p>31  </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="indexes-opclass.html" title="11.10. Operator Classes and Operator Families">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="indexes.html" title="Chapter 11. Indexes">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="indexes-examine.html" title="11.12. Examining Index Usage">Next</a></td></tr><tr><td width="40%" align="left" valign="top">11.10. Operator Classes and Operator Families </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 16.3 Documentation">Home</a></td><td width="40%" align="right" valign="top"> 11.12. Examining Index Usage</td></tr></table></div></body></html>
codekingpro/portable-devtools · Team Ai