Re: Travamento na criação de ín dices

Ilton Junior <[email protected]>
Newsgroups gmane.comp.db.postgresql.brasil
Message-ID <CAPZ4b91n0FA-vnyQS9Vw5FKueqMm5YLxAe7T7ygnhwbCSDA-SA__41904.1971596473$1507802031$gmane$org@mail.gmail.com>
Legal, fique monitorando o processo com top ou strace.

Em 11 de out de 2017 10:29 PM, "Neto pr" <[email protected]> escreveu:

>
>
> Em 11 de outubro de 2017 20:46, Ilton Junior <[email protected]>
> escreveu:
>
>> Amigão! Utilize da seguinte forma:
>> "Create index concurrently..."
>>
>
> Eu estou usando linux, mas esse comando é executado dentro de uma
> aplicacao JAVA e deverá continuar assim, pela regras internas.
>
> Eu testei a criacão usando o concurrency e pelo que vi o índice já
> apareceu no resultado da consulta, pois antes, o indice nem aparecia no
> resultado, somente a tabela Lineitem:
>
> SELECT
>       L.mode, c.relname, locktype,  l.GRANTED, l.transactionid,
> virtualtransaction
> FROM   pg_locks l, pg_class   c
> where  c.oid = l.relation
>
> tela resultado apos concurrency:    https://i.stack.imgur.com/htzIY.jpg
>
> Agora, estou aguardando terminar a criacão do índice.
>
>
>
>> Se estiver usando Linux indico você a executar tal comando diretamente do
>> bash do seu servidor, dessa forma as tabelas não são bloqueadas, estamos
>> falando de um índice relativamente grande, então, vale também fazer um
>> tunning, da uma lida sobre "indice condicional", dependendo dos dados seja
>> o seu caso.
>>
>> Obs:
>> CONCURRENTLY
>>
>> When this option is used, PostgreSQL will build the index without taking
>> any locks that prevent concurrent inserts, updates, or deletes on the
>> table; whereas a standard index build locks out writes (but not reads) on
>> the table until it's done. There are several caveats to be aware of when
>> using this option — see Building Indexes Concurrently
>> <https://www.postgresql.org/docs/9.1/static/sql-createindex.html#SQL-CREATEINDEX-CONCURRENTLY>
>>
>> [ ]`s Neto
>
>
>> Em 11 de out de 2017 8:20 PM, "Euler Taveira" <euler-hNsCO/[email protected]>
>> escreveu:
>>
>>> Em 11 de outubro de 2017 20:04, Neto pr <[email protected]> escreveu:
>>>
>>>>
>>>> A linha do comando CREATE INDEX está identificada com o fundo laranja.
>>>> EU verifiquei que o comando está com estado Ativo, mas não sei se está
>>>> aguardando algo, podem me ajudar a análisar o resultado anexo.
>>>>
>>>> Você não informou o sistema operacional mas se for Linux:
>>>
>>> # strace -p 1234
>>>
>>> onde 1234 é o PID da conexão (que você pode obter no pg_stat_activity).
>>> Se for outro sistema operacional tais como FreeBSD, AIX ou Solaris, use
>>> truss.
>>>
>>>
>>> --
>>>    Euler Taveira                                   Timbira -
>>> http://www.timbira.com.br/
>>>    PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento
>>> <http://www.timbira.com.br>
>>>
>>> _______________________________________________
>>> pgbr-geral mailing list
>>> pgbr-geral-b/[email protected]
>>> https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral
>>>
>>
>> _______________________________________________
>> pgbr-geral mailing list
>> pgbr-geral-b/[email protected]
>> https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral
>>
>
>
> _______________________________________________
> pgbr-geral mailing list
> pgbr-geral-b/[email protected]
> https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral
>

_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.