mirror of
https://github.com/postgres/postgres.git
synced 2025-05-02 11:44:50 +03:00
Doc: remove obsolete example.
The documentation for ts_headline() recommends using a sub-select to avoid extra evaluations of ts_headline() in a query with ORDER BY+LIMIT. Since commit 9118d03a8 this contortionism is unnecessary, so remove the recommendation. Noted by Oleg Bartunov. Discussion: <CAF4Au4w6rrH_j1bvVhzpOsRiHCog7sGJ3LSX0tY8ZdwhHT88LQ@mail.gmail.com>
This commit is contained in:
parent
b7292a8670
commit
d5d8a0b7e5
@ -1290,19 +1290,7 @@ query.',
|
||||
<para>
|
||||
<function>ts_headline</> uses the original document, not a
|
||||
<type>tsvector</type> summary, so it can be slow and should be used with
|
||||
care. A typical mistake is to call <function>ts_headline</function> for
|
||||
<emphasis>every</emphasis> matching document when only ten documents are
|
||||
to be shown. <acronym>SQL</acronym> subqueries can help; here is an
|
||||
example:
|
||||
|
||||
<programlisting>
|
||||
SELECT id, ts_headline(body, q), rank
|
||||
FROM (SELECT id, body, q, ts_rank_cd(ti, q) AS rank
|
||||
FROM apod, to_tsquery('stars') q
|
||||
WHERE ti @@ q
|
||||
ORDER BY rank DESC
|
||||
LIMIT 10) AS foo;
|
||||
</programlisting>
|
||||
care.
|
||||
</para>
|
||||
|
||||
</sect2>
|
||||
|
Loading…
x
Reference in New Issue
Block a user