Poor performance after index add

View: New views
1 Messages — Rating Filter:   Alert me  

Poor performance after index add

by Breno Costa :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message

Hello everybody,

    I'm puzzled this time. I've got a container with about 1700 small xml documents, each of which have this structure:

<?xml version="1.0" encoding="UTF-8"?>
<BO>
 <cadastro>
  <id>1673</id>
  <ano>06</ano>
  <hash>dd8897c6f8556cb455ab581954e51072</hash>
  <inicio>
   <data>
    <d>07</d>
    <m>08</m>
    <a>2006</a>
    <date>2006-08-07</date>
   </data>
   <hora>
    <h>10</h>
    <m>35</m>
    <s>27</s>
    <time>10:35:27</time>
   </hora>
  </inicio>
  <fim>
   <data>
    <d>07</d>
    <m>08</m>
    <a>2006</a>
    <date>2006-08-07</date>
   </data>
   <hora>
    <h>10</h>
    <m>58</m>
    <s>23</s>
    <time>10:58:23</time>
   </hora>
  </fim>
  <numFlash/>
  <remoteAddr> 200.254.130.125</remoteAddr>
  <remotePort>1329</remotePort>
  <maquina/>
  <sispol/>
 </cadastro>
 <validacao>
  <situacao>PROCESSAMENTO</situacao>
  <validadores>
   <avaliador>
 <nome>José Lucivan Gomes de Omena</nome>
 <cpf>
  <numero>77609093491</numero>
 </cpf>
 <matricula/>
</avaliador><escrivao>
    <nome/>
    <matricula/>
    <cpf>
     <numero>00000000000</numero>
    </cpf>
   </escrivao>
   <delegado>
    <nome/>
    <matricula/>
    <cpf>
     <numero>00000000000</numero>
    </cpf>
   </delegado>
  </validadores>
  <data>
   <d>0</d>
   <m>0</m>
   <a>0</a>
   <date>0-0-0</date>
  </data>
  <hora>
   <h>00</h>
   <m>00</m>
   <s>00</s>
   <time>00:00:00</time>
  </hora>
  <maquina>
   <dhCadastro>
    <data>
     <d>0</d>
     <m>0</m>
     <a>0</a>
     <date>0-0-0</date>
    </data>
    <hora>
     <h>00</h>
     <m>00</m>
     <s>00</s>
     <time>00:00:00</time>
    </hora>
   </dhCadastro>
   <nome/>
   <descricao/>
   <ip/>
  </maquina>
  <obs/>
 </validacao>
 <fato>
  <natureza>EXTRAVIO</natureza>
  <uf>AL</uf>
  <cidade>MACEIÓ</cidade>
  <bairro>SANTA AMÉLIA</bairro>
  <lougradouro/>
  <pontoReferencia/>
  <data>
   <d>01</d>
   <m>08</m>
   <a>2006</a>
   <date>2006-08-01</date>
  </data>
  <periodo>tarde</periodo>
  <descricaoFato/>
  <outrosDocumentos/>
 </fato>
 <pessoas>
  <vitima>
   <cpf>
    <numero>01079983430</numero>
   </cpf>
   <rg>
    <orgaoEmissor>SSP</orgaoEmissor>
    <uf>AL</uf>
    <dExpedicao>
     <d>0</d>
     <m>0</m>
     <a>0</a>
     <date>0-0-0</date>
    </dExpedicao>
    <numero>1933214</numero>
   </rg>
   <nome>JAMILLE SAMPAIO CALHEIROS</nome>
   <sexo>F</sexo>
   <dNasc>
    <d>12</d>
    <m>09</m>
    <a>1982</a>
    <date>1982-09-12</date>
   </dNasc>
   <lougradouro>RUA HILDA DE MENEZES BARROS</lougradouro>
   <numero>71</numero>
   <bairro>SANTA AMÉLIA</bairro>
   <compl>CJ COLINAS</compl>
   <cidade>MACEIÓ</cidade>
   <uf>AL</uf>
   <cep>57063450</cep>
   <naturalidade>
    <cidade>MACEIÓ</cidade>
    <uf>AL</uf>
   </naturalidade>
   <filiacao>
    <pai>CICERO DA ROCHA CALHEIROS</pai>
    <mae>MARCIA MARIA SAMPAIO CALHEIROS</mae>
   </filiacao>
   <fone>
    <numResidencial>8232238810</numResidencial>
    <numCelular/>
   </fone>
   <email/>
   <estadoCivil>1</estadoCivil>
   <grauInstrucao>5</grauInstrucao>
   <turista>n</turista>
  </vitima>
 </pessoas>
 <documentos>
  <ctps>
   <numero>047758</numero>
   <serie>00019</serie>
  </ctps>
 </documentos>
 <objetos/>
 <historico>O DECLARANTE INFORMA QUE, NO LOCAL, DATA E HORA ACIMA CITADOS, FORA EXTRAVIADO O SEGUINTE DOCUMENTO: CTPS, NÚMERO 047758, SÉRIE 00019;  OBS.: ESTE BOLETIM NÃO SUBSTITUI O(S) DOCUMENTO(S) ACIMA CITADO(S).</historico>
</BO>


    This container has no index at all, and the performance is, up to now, very good. Of course this might change as the container gets bigger, so that's why I'm adding indexes now. I just did the following, from the shell:

openContainer BOs.dbxml
addIndex "" natureza node-element-equality-string
addIndex "" cpf node-element-equality-string
addIndex "" remoteAddr node-element-equality-string
addIndex "" id node-element-equality-string
addIndex "" ano node-element-equality-string
quit

    These are the most frequent searches. But after doing this, the system (which is a web app) got very, very slow, sometimes the JVM even crashes.

    So, what could be going wrong with this? I appreciate any help.

cheers,

-- Breno Jacinto