[Fwd: Re: Consulta, a priori, sencilla]

From: "I(dot)N(dot)T(dot) - Programación" <dpto(dot)programacion(at)grupo-int(dot)com>
To: POSTGRESQL - Ayuda <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: [Fwd: Re: Consulta, a priori, sencilla]
Date: 2008-12-29 16:57:37
Message-ID: 49590181.80207@grupo-int.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
enviosdfa=# EXPLAIN ANALYZE SELECT * FROM envios WHERE apellidos LIKE
'BODEGAS MURUA%' ORDER BY apellidos;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; QUERY
PLAN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
---------------------------------------------------------------------------------------------------------------------<br>
&nbsp;Sort&nbsp; (cost=144384.87..144384.88 rows=1 width=650) (actual
time=34724.021..34724.040 rows=36 loops=1)<br>
&nbsp;&nbsp; Sort Key: apellidos<br>
&nbsp;&nbsp; -&gt;&nbsp; Seq Scan on envios&nbsp; (cost=0.00..144384.86 rows=1 width=650)
(actual time=1691.879..34723.437 rows=36 loops=1)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Filter: (apellidos ~~ 'BODEGAS MURUA%'::text)<br>
&nbsp;Total runtime: 34724.121 ms<br>
(5 filas)<br>
<br>
Un tiempo de consulta exagerado<br>
<br>
&iquest;Puede ser porque mi versi&oacute;n de postgres es la 7.4.7?<br>
<br>
&iquest;Acepta esta versi&oacute;n &iacute;ndices varchar_pattern_ops?<br>
<br>
-------- Mensaje original --------
<table class="moz-email-headers-table" border="0" cellpadding="0"
cellspacing="0">
<tbody>
<tr>
<th align="right" nowrap="nowrap" valign="baseline">Asunto: </th>
<td>Re: [pgsql-es-ayuda] Consulta, a priori, sencilla</td>
</tr>
<tr>
<th align="right" nowrap="nowrap" valign="baseline">Fecha: </th>
<td>Mon, 29 Dec 2008 11:15:39 -0500</td>
</tr>
<tr>
<th align="right" nowrap="nowrap" valign="baseline">De: </th>
<td>Raul Andres Duque <a class="moz-txt-link-rfc2396E" href="mailto:ra_duque(at)yahoo(dot)com(dot)mx">&lt;ra_duque(at)yahoo(dot)com(dot)mx&gt;</a></td>
</tr>
<tr>
<th align="right" nowrap="nowrap" valign="baseline">Para: </th>
<td><a class="moz-txt-link-rfc2396E" href="mailto:pgsql-es-ayuda(at)postgresql(dot)org">&lt;pgsql-es-ayuda(at)postgresql(dot)org&gt;</a>, "I.N.T. -
Programaci&oacute;n" <a class="moz-txt-link-rfc2396E" href="mailto:dpto(dot)programacion(at)grupo-int(dot)com">&lt;dpto(dot)programacion(at)grupo-int(dot)com&gt;</a></td>
</tr>
</tbody>
</table>
<br>
<br>
<pre>----- Original Message -----
From: "Raul Andres Duque" <a class="moz-txt-link-rfc2396E" href="mailto:ra_duque(at)yahoo(dot)com(dot)mx">&lt;ra_duque(at)yahoo(dot)com(dot)mx&gt;</a>
To: ""I.N.T. - Programaci&oacute;n"" <a class="moz-txt-link-rfc2396E" href="mailto:dpto(dot)programacion(at)grupo-int(dot)com">&lt;dpto(dot)programacion(at)grupo-int(dot)com&gt;</a>
Sent: Monday, December 29, 2008 11:14 AM
Subject: Re: [pgsql-es-ayuda] Consulta, a priori, sencilla

&gt;
&gt; ----- Original Message -----
&gt; From: ""I.N.T. - Programaci&oacute;n"" <a class="moz-txt-link-rfc2396E" href="mailto:dpto(dot)programacion(at)grupo-int(dot)com">&lt;dpto(dot)programacion(at)grupo-int(dot)com&gt;</a>
&gt; To: <a class="moz-txt-link-rfc2396E" href="mailto:pgsql-es-ayuda(at)postgresql(dot)org">&lt;pgsql-es-ayuda(at)postgresql(dot)org&gt;</a>
&gt; Sent: Monday, December 29, 2008 10:16 AM
&gt; Subject: [pgsql-es-ayuda] Consulta, a priori, sencilla
&gt;
&gt;
&gt;&gt; Buenas,
&gt;&gt;
&gt;&gt; Tengo una BBDD con una tabla llamada 'envios' de 1.677.229 registros
&gt;&gt;
&gt;&gt; La consulta es:
&gt;&gt;
&gt;&gt; SELECT * FROM envios WHERE apellidos LIKE 'LOQUESEA%'
&gt;&gt;
&gt;&gt; y est&aacute; creado el &iacute;ndice:
&gt;&gt;
&gt;&gt; CREATE INDEX envios_idx01 ON envios USING btree(apellidos);
&gt;&gt;
&gt;&gt; La consulta tarda casi 50seg. en ejecutarse y es un tiempo inadmisible.
&gt;&gt; Est&aacute; claro que no utiliza el &iacute;ndice &iquest;porqu&eacute;?
&gt;&gt;

recuerda que si tu locale es diferente a 'C', debes los indices con
varchar_pattern_ops. En este link encuentras la info correspondiente:
<a class="moz-txt-link-freetext" href="http://www.postgresql.org/docs/8.3/static/indexes-opclass.html">http://www.postgresql.org/docs/8.3/static/indexes-opclass.html</a>

Atentamente,

RAUL DUQUE
Bogot&aacute;, Colombia

&gt;
&gt;&gt; He realizado VACUUM FULL ANALYZE varias veces, regenerado el &iacute;ndice y
&gt;&gt; nada
&gt;&gt;
&gt;&gt; &iquest;Alguna sugerencia?
&gt;&gt;
&gt;&gt; Gracias de antemano --
&gt;&gt; TIP 4: No hagas 'kill -9' a postmaster
&gt;

</pre>
</body>
</html>

Attachment Content-Type Size
unknown_filename text/html 4.5 KB

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Emanuel Calvo Franco 2008-12-29 18:13:36 Re: [Fwd: Re: Consulta, a priori, sencilla]
Previous Message I.N.T. - Programación 2008-12-29 16:57:05 [Fwd: Re: Consulta, a priori, sencilla]