Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5fdae77

Browse files
committed
Add mention of functional indexes for case-insensitive comparisons.
1 parent465cf16 commit5fdae77

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

‎doc/src/FAQ/FAQ.html

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ <H2>Operational Questions</H2>
112112
<Ahref="#4.11">4.11</A>) What is an R-tree index?<BR>
113113
<Ahref="#4.12">4.12</A>) What is the Genetic Query Optimizer?<BR>
114114
<Ahref="#4.13">4.13</A>) How do I perform regular expression
115-
searches and case-insensitive regular expression searches?<BR>
115+
searches and case-insensitive regular expression searches? How do I
116+
use an index for case-insensitive searches?<BR>
116117
<Ahref="#4.14">4.14</A>) In a query, how do I detect if a field
117118
is<SMALL>NULL</SMALL>?<BR>
118119
<Ahref="#4.15">4.15</A>) What is the difference between the
@@ -957,13 +958,29 @@ <H4><A name="4.12">4.12</A>) What is the Genetic Query
957958
search.</P>
958959

959960
<H4><Aname="4.13">4.13</A>) How do I perform regular expression
960-
searches and case-insensitive regular expression searches?</H4>
961+
searches and case-insensitive regular expression searches? How do I
962+
use an index for case-insensitive searches?</H4>
961963

962964
<P>The<I>~</I> operator does regular expression matching, and
963965
<I>~*</I> does case-insensitive regular expression matching. The
964966
case-insensitive variant of<SMALL>LIKE</SMALL> is called
965967
<SMALL>ILIKE</SMALL> in PostgreSQL 7.1 and later.</P>
966968

969+
<P>Case-insensitive equality comparisons are normally expressed as:
970+
971+
<PRE>
972+
SELECT *
973+
FROM tab
974+
WHERE lower(col) = 'abc'
975+
</PRE>
976+
977+
This will not use an standard index. However, if you create a
978+
functional index, it will be used:
979+
980+
<PRE>
981+
CREATE INDEX tabindex on tab (lower(col));
982+
</PRE>
983+
967984
<H4><Aname="4.14">4.14</A>) In a query, how do I detect if a field
968985
is<SMALL>NULL</SMALL>?</H4>
969986

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp