Re: Deceiding which index to use

From: Mezei Zoltán <mezei(dot)zoltan(at)telefor(dot)hu>
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Deceiding which index to use
Date: 2007-03-09 15:44:18
Message-ID: 45F180D2.5080201@telefor.hu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Richard Huxton wrote:
<blockquote cite="mid:45F17B70(dot)60001(at)archonet(dot)com" type="cite">
<meta http-equiv="Content-Type" content="text/html; ">
<meta name="Generator" content="MS Exchange Server version 6.5.7226.0">
<title>Re: [PERFORM] Deceiding which index to use</title>
<!-- Converted from text/plain format -->
<p><font size="2">OK - so the next place to look is the distribution
of values for<br>
subscriber_id on the output_message_log. Does that have some subscribers<br>
with many rows and lots with hardly any?</font></p>
</blockquote>
<small>Hmm... There are about 1.5k subscribers with 100-200 messages
each - all the other 19k has an average of 8.9 messages, most of them
having only 1 message. I think that's exactly the situation you
mention...</small><br>
<blockquote cite="mid:45F17B70(dot)60001(at)archonet(dot)com" type="cite">
<p><font size="2">If so, you might need to<br>
increase the stats on that column:<br>
<br>
ALTER TABLE output_message_log ALTER COLUMN subscriber_id SET STATISTICS<br>
&lt;num&gt;;<br>
ANALYSE output_message_log (subscriber_id);<br>
<br>
The &lt;num&gt; defaults to 10, but can be set as high as 1000. You
want to<br>
try and capture the "big" subscribers.<br>
</font></p>
</blockquote>
<small>So if I'm correct: this statistics gathering can be fine tuned,
and if i set the &lt;num&gt; to 1000 then not only the first 10
subsribers (with most messages) will be stored in pg_stats, but the
first 1000? Is 1000 a hard-coded highest-possible-value? I think it
would be best to set that to simething like 1800-1900 as I have about
that many subscibers with high message count.<br>
<br>
Zizi<br>
</small>
</body>
</html>

Attachment Content-Type Size
unknown_filename text/html 1.8 KB

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Richard Huxton 2007-03-09 15:52:23 Re: Deceiding which index to use
Previous Message Richard Huxton 2007-03-09 15:21:20 Re: Deceiding which index to use