Re: Slow Query - PostgreSQL 9.2

Поиск
Список
Период
Сортировка
От Vitaly Burovoy
Тема Re: Slow Query - PostgreSQL 9.2
Дата
Msg-id CAKOSWNkX=D=kk9+jb6O=DSjy5ueq8+j8wh35rK4wNpZ4jkUY0w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Slow Query - PostgreSQL 9.2  (Saulo Merlo <smerlo50@outlook.com>)
Ответы Re: Slow Query - PostgreSQL 9.2  (Saulo Merlo <smerlo50@outlook.com>)
Список pgsql-general
On 1/11/16, Saulo Merlo <smerlo50@outlook.com> wrote:
> Ok, thanks Vitaly.
> I need to create a TEXT or VARCHAR index.
> and another one with timestamptz
> How can I do?Thanks

How to create indexes of different types is written at [1].
But I thing you need something else. You have to create index on the
specified column(s). Type of data will be recognized by a column type.
Your primary goal is to avoid sequence scan of big tables. It is
important to read explain[2] and find _tables_ and _columns_ (or
_expressions_) where they appears in the "seq scan/filter" blocks to
decide whether it worth to create an index or not.
You can create index on expression[3] where column(s) of the table or
constants are involved, but keep in mind it is impossible to create an
index using columns of different tables or using non-constants (e.g.
"now()").

Note that your two last posts doesn't have information what columns you need.

[1] http://www.postgresql.org/docs/9.2/static/indexes-types.html
[2] http://www.postgresql.org/docs/9.2/static/using-explain.html
[3] http://www.postgresql.org/docs/9.2/static/indexes-expressional.html


P.S.: please, delete old (irrelevant) information which is not
necessary for answering.

>
> From: smerlo50@outlook.com
> To: clavadetscher@swisspug.org; vitaly.burovoy@gmail.com
> CC: pgsql-general@postgresql.org
> Subject: Re: [GENERAL] Slow Query - PostgreSQL 9.2
> Date: Mon, 11 Jan 2016 21:37:43 +0000
>
> Hey guys..
> How could I create a timestampandtz index?
> CREATE TABLE gorfs.inode_segments
> (
>  <<overquoting>>
> )

--
Best regards,
Vitaly Burovoy


В списке pgsql-general по дате отправления:

Предыдущее
От: James Keener
Дата:
Сообщение: Re: WIP: CoC
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: WIP: CoC