<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
					xmlns:content="http://purl.org/rss/1.0/modules/content/"
					xmlns:wfw="http://wellformedweb.org/CommentAPI/"
					xmlns:atom="http://www.w3.org/2005/Atom"
				  >
<channel>
<atom:link rel="self"  type="application/rss+xml"  href="http://rulinux.net/rss_from_sect_4_subsect_7_thread_34821"  />
<title>rulinux.net - Форум - Rulinux.net - Ну так чо там с апгрейдом постгреса?</title>
<link>http://rulinux.net/</link>
<description><![CDATA[Портал о GNU/Linux и не только]]></description>
<image><title>rulinux.net - Форум - Rulinux.net - Ну так чо там с апгрейдом постгреса?</title>
<link>http://rulinux.net/</link>
<url>http://rulinux.net/rss_icon.png</url>
</image>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=2#111670</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=2#111670</guid>
<pubDate>Sat, 22 Oct 2011 15:48:43 +0400</pubDate>
<description><![CDATA[<p>А сколько он реально потребляет-то сейчас, в пиковое время?</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=2#109998</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=2#109998</guid>
<pubDate>Tue, 11 Oct 2011 14:23:40 +0400</pubDate>
<description><![CDATA[<p><i>>&gt;Ах-да на серваке 2 ксеона и гиг оперативы.</i><br> Вообще-то, оперативы 2 гига. Но могу добавить, если есть необходимость. CPU тоже до 8 штук могу сделать. Ну и учитывай, что 100% CPU - это показатель конкретного CPU, а не суммарно.</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=2#109211</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=2#109211</guid>
<pubDate>Thu, 06 Oct 2011 11:46:21 +0400</pubDate>
<description><![CDATA[<p><i>> это что, мы за это время написали 150 мегов текста? )))</i><br> Нет, в дампе 100К сообщений, всего пользователями набито 30 миллионов букв:<br><br><fieldset><legend>text</legend><code><br />
long_temp=# select count(1), sum(char_length(subject)+char_length(raw_comment)) from comments;<br />
<br />
&nbsp;count &nbsp;| &nbsp; sum<br />
--------+----------<br />
&nbsp;108442 | 31208523<br />
(1 row)<br />
<br />
&nbsp;</code></fieldset></p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=2#109210</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=2#109210</guid>
<pubDate>Thu, 06 Oct 2011 11:30:06 +0400</pubDate>
<description><![CDATA[<p><i>> Если верно влияние секунд в запросах на кэш, то надо их убрать и на трекере.</i><br> Не, потестировал локально - не увидел разницы. Флуктуации в производительности одного и того же запроса от запуска к запуску выше чем разница средних значений между запросами с секундами и без. <br><br></p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=2#109209</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=2#109209</guid>
<pubDate>Thu, 06 Oct 2011 11:26:33 +0400</pubDate>
<description><![CDATA[<p>Подтверждаю! Оптимизация делает своё дело.</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=2#109207</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=2#109207</guid>
<pubDate>Thu, 06 Oct 2011 11:22:31 +0400</pubDate>
<description><![CDATA[<p>НИХУЯ СЕБЕ! у меня галлюцинации, или рулинукс в самом деле стал работать с приемлимой скоростью?</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=2#109204</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=2#109204</guid>
<pubDate>Thu, 06 Oct 2011 11:18:56 +0400</pubDate>
<description><![CDATA[<p><i>> без индекса &lt;!--Страница сгенерировалась за 0.599535 сек.--&gt;</i><br> <i>> с индексом &lt;!--Страница сгенерировалась за 0.542951 сек.--&gt;</i><br> 56 мсек - хорошая разница, оставляй индекс.<br><br><i>> Они полюбомы не были вытащены ибо эти данные тянутся к списку тредов. А он уникален.</i><br> Это правильный подход</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=2#109201</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=2#109201</guid>
<pubDate>Thu, 06 Oct 2011 11:15:00 +0400</pubDate>
<description><![CDATA[<p><i>> Вообще сейчас дамп базы составляет 150 метров</i><br><br><br>это что, мы за это время написали 150 мегов текста? )))</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=2#109200</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=2#109200</guid>
<pubDate>Thu, 06 Oct 2011 11:11:34 +0400</pubDate>
<description><![CDATA[<p><i>> Тоже верно. Правда остаётся трекер, который только по timest-у и ищет.</i><br> Кстати да. Хоть это и однократный запрос на страницу, но со временем тоже начнёт привносить тормоза. Тут можно извратиться и ограничить поиск по мессажам, принадлежащим только тем тредам, которые менялись в течение заданного периода. <br><br>Вообще сейчас дамп базы составляет 150 метров и она должна бы помещаться в файловый кеш вся вместе со всеми индексами, так что большой разницы мы не заметим ни так ни так ни этак, а вот когда оно разрастётся раза в четыре - там уже будет интересно. Надеюсь к тому времени уже кеширование будет реализовано. </p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109199</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109199</guid>
<pubDate>Thu, 06 Oct 2011 11:11:02 +0400</pubDate>
<description><![CDATA[<p><i>>А какова получилась разница с индексом по timest и без него?</i><br> без индекса &lt;!--Страница сгенерировалась за 0.599535 сек.--&gt;<br><br>с индексом &lt;!--Страница сгенерировалась за 0.542951 сек.--&gt;<br><br><i>>Ещё вопрос - по старому коду мне показалось ты вызываешь эти запросы для каждого мессажа, попавшего в выблоку, безотносительно того, не были ли те же данные уже вытащены из базы для одного из предыдухи сообщений.. Это так? </i><br> Они полюбомы не были вытащены ибо эти данные тянутся к списку тредов. А он уникален. Один и тот-же тред в списке не встречается более одного раза.</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109196</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109196</guid>
<pubDate>Thu, 06 Oct 2011 10:59:57 +0400</pubDate>
<description><![CDATA[<p>Как это нет? Целых 6 миллисекунд! И это на выборке за 3 часа небось? А если кто за больший период смотрит?<br><br> А какова получилась разница с индексом по timest и без него?<br><br> Ещё вопрос - по старому коду мне показалось ты вызываешь эти запросы для каждого мессажа, попавшего в выблоку, безотносительно того, не были ли те же данные уже вытащены из базы для одного из предыдухи сообщений.. Это так? </p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109194</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109194</guid>
<pubDate>Thu, 06 Oct 2011 10:58:32 +0400</pubDate>
<description><![CDATA[<p><i>>Лучше ограничиться tid пока: на каждый тред приходится не так уж много каментов и дополнительно их индексировать ни к чему.</i><br> Тоже верно. Правда остаётся трекер, который только по timest-у и ищет. <br><br>Если верно влияние секунд в запросах на кэш, то надо их убрать и на трекере.</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109189</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109189</guid>
<pubDate>Thu, 06 Oct 2011 10:44:36 +0400</pubDate>
<description><![CDATA[<p><i>>слей всё в один запрос, посмотри разницу, обрежь секунды - снова посмотри.</i><br> как было &lt;!--Страница сгенерировалась за 0.243588 сек.--&gt;<br><br>заменил &lt;!--Страница сгенерировалась за 0.236126 сек.--&gt;<br><br>Разницы почти нет.</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109188</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109188</guid>
<pubDate>Thu, 06 Oct 2011 10:30:38 +0400</pubDate>
<description><![CDATA[<p>Попробуй теперь убей индекс на timest, убедись что разница ничтожна, потом остальное реализуй тоже: слей всё в один запрос, посмотри разницу, обрежь секунды - снова посмотри.<br><br>У тебя ведь эта группа запросов выполняется многократно, так что каждая сэкономленная миллисекунда даст 10-50 сэкономленных миллисекунд на страницу.</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109187</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109187</guid>
<pubDate>Thu, 06 Oct 2011 10:27:05 +0400</pubDate>
<description><![CDATA[<p><i>> Мне кажется, что тебе надо сделать индексы по timest и tid.</i><br> Лучше ограничиться tid пока: на каждый тред приходится не так уж много каментов и дополнительно их индексировать ни к чему.  А памяти на хосте не вагон - в результате эти индексы со временем перестанут помещаться в системном кеше и из-за лишних индексов, те индексы что действительно необходимы могут оказаться сброшены и за ними придётся ходить на диск.<br><br></p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109186</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109186</guid>
<pubDate>Thu, 06 Oct 2011 10:26:46 +0400</pubDate>
<description><![CDATA[<p>Создал индексы на внешние ключи и на timest и tid. Отпустило. </p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109184</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109184</guid>
<pubDate>Thu, 06 Oct 2011 10:19:06 +0400</pubDate>
<description><![CDATA[<p>Фантастика какая-то. И именно в этом порядке? <br><br> Попробуй заменить эти три запроса одним (запуск запроса тоже стоит времени сам по себе):<br><br><fieldset><legend>sql</legend><code><br />
<span style="color: #993333; font-weight: bold;">SELECT</span> count<span style="color: #66cc66;">&#40;</span>1<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> cnt_all<span style="color: #66cc66;">,</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp;sum<span style="color: #66cc66;">&#40;</span>CASE WHEN timest <span style="color: #66cc66;">&gt;</span> <span style="color: #ff0000;">'2011-10-05 07:37'</span> THEN 1 ELSE 0 END<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> cnt_24h<span style="color: #66cc66;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;sum<span style="color: #66cc66;">&#40;</span>CASE WHEN timest <span style="color: #66cc66;">&gt;</span> <span style="color: #ff0000;">'2011-10-06 06:37'</span> THEN 1 ELSE 0 END<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> cnt_1h<br />
<span style="color: #993333; font-weight: bold;">FROM</span> comments <span style="color: #993333; font-weight: bold;">WHERE</span> tid <span style="color: #66cc66;">=</span><span style="color: #ff0000;">'34799'</span> <br />
&nbsp;</code></fieldset><br><br> Обрати внимание, я ещё секунды из даты убрал. Не знаю осмысленно ли это в случае с постгресом, судя по докам он не должен перепаршивать запросы при изменении параметров, но возможно это позволит ему брать данные прямо из его кеша (от предыдущего такого же запроса) в течение той же минуты. Может есть смысл попробовать и так и так для сравнения.. По функционалу небольшая неточность не должна быть фатальной. <br><br>Так же проиндексируй каменты по TID. У тебя выборка каментов обычно идёт в привязке к треду, поэтому такой индекс будет много где полезен, к тому же он обладает хорошей селективностью. Если сейчас РДБМС не имеет никакого представления о каментах и делает фулл-скан по таблице (т.е. перебирает все записи в поисках ну максимум 100 каментов с данным tid, то при наличии индекса объём данных которые ей надо просмотреть уменьшится на порядки). <br><br></p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109179</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109179</guid>
<pubDate>Thu, 06 Oct 2011 10:03:11 +0400</pubDate>
<description><![CDATA[<p><i>>Думаю теперь чем заменить эти 3 запроса.</i><br> Мне кажется, что тебе надо сделать индексы по timest и tid. Обе эти колонки довольно активно используются в запросах (особенно tid).<br><br>Я проверил на глаз, на паре запросов, время заметно уменьшилось.</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109176</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109176</guid>
<pubDate>Thu, 06 Oct 2011 08:14:23 +0400</pubDate>
<description><![CDATA[<p><i>>это флуктуация или разница от раза к разу такая?</i><br> От раза к разу. <br><br><i>>А для чего тебе эти запросы?</i><br> Это число ответов всего/день/час в списке тредов. http://rulinux.net/forum_10_page_1<br><br><i>>Если считаешь сообщения после какого-то заданного, то лучше ориентироваться на ИДы, они в индексе сидят. </i><br> Тогда придется усложнять запрос еще одной агрегирующей функцией что только замедлит его.</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109174</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109174</guid>
<pubDate>Thu, 06 Oct 2011 08:01:47 +0400</pubDate>
<description><![CDATA[<p>Второй и третий запросы практически одинаковы, а третий исполнялся втрое дольше - это флуктуация или разница от раза к разу такая?<br><br>А для чего тебе эти запросы? Если считаешь сообщения после какого-то заданного, то лучше ориентироваться на ИДы, они в индексе сидят. </p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109172</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109172</guid>
<pubDate>Thu, 06 Oct 2011 07:39:06 +0400</pubDate>
<description><![CDATA[<p>Думаю теперь чем заменить эти 3 запроса. <br /> &lt;!-- Запрос SELECT count(*) AS cnt FROM comments WHERE tid ='34799' выполнен за 0.137907 сек.--&gt; <br /> &lt;!-- Запрос SELECT ALL count(*) AS cnt FROM comments WHERE timest &gt; '2011-10-05 07:37:21' AND tid = '34799' выполнен за 0.049257 сек.--&gt; <br /> &lt;!-- Запрос SELECT ALL count(*) AS cnt FROM comments WHERE timest &gt; '2011-10-06 06:37:21' AND tid = '34799' выполнен за 0.140391 сек.--&gt;</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109171</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109171</guid>
<pubDate>Thu, 06 Oct 2011 07:36:10 +0400</pubDate>
<description><![CDATA[<p>Заменил запрос <br><br><fieldset><legend>sql</legend><code><br />
<span style="color: #993333; font-weight: bold;">SELECT</span> t<span style="color: #66cc66;">.</span>id<span style="color: #66cc66;">,</span> t<span style="color: #66cc66;">.</span>attached<span style="color: #66cc66;">,</span> c<span style="color: #66cc66;">.</span>subject<span style="color: #66cc66;">,</span> c<span style="color: #66cc66;">.</span>changing_timest<span style="color: #66cc66;">,</span> c<span style="color: #66cc66;">.</span>timest <span style="color: #993333; font-weight: bold;">FROM</span> threads t <span style="color: #993333; font-weight: bold;">INNER</span> <span style="color: #993333; font-weight: bold;">JOIN</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> tm<span style="color: #66cc66;">.</span>tid<span style="color: #66cc66;">,</span> tm<span style="color: #66cc66;">.</span>subject<span style="color: #66cc66;">,</span> tm<span style="color: #66cc66;">.</span>timest<span style="color: #66cc66;">,</span> max<span style="color: #66cc66;">&#40;</span>ch<span style="color: #66cc66;">.</span>changing_timest<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> changing_timest <span style="color: #993333; font-weight: bold;">FROM</span> comments ch <span style="color: #993333; font-weight: bold;">INNER</span> <span style="color: #993333; font-weight: bold;">JOIN</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> tid<span style="color: #66cc66;">,</span> timest<span style="color: #66cc66;">,</span> subject <span style="color: #993333; font-weight: bold;">FROM</span> comments <span style="color: #993333; font-weight: bold;">WHERE</span> timest <span style="color: #993333; font-weight: bold;">IN</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> min<span style="color: #66cc66;">&#40;</span>timest<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">FROM</span> comments <span style="color: #993333; font-weight: bold;">WHERE</span> tid <span style="color: #993333; font-weight: bold;">IN</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> id <span style="color: #993333; font-weight: bold;">FROM</span> threads <span style="color: #993333; font-weight: bold;">WHERE</span> section<span style="color: #66cc66;">=</span><span style="color: #ff0000;">'4'</span> <span style="color: #993333; font-weight: bold;">AND</span> subsection<span style="color: #66cc66;">=</span><span style="color: #ff0000;">'10'</span><span style="color: #66cc66;">&#41;</span> &nbsp;<span style="color: #993333; font-weight: bold;">GROUP</span> <span style="color: #993333; font-weight: bold;">BY</span> tid<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> tm <span style="color: #993333; font-weight: bold;">ON</span> ch<span style="color: #66cc66;">.</span>tid <span style="color: #66cc66;">=</span> tm<span style="color: #66cc66;">.</span>tid <span style="color: #993333; font-weight: bold;">WHERE</span> ch<span style="color: #66cc66;">.</span>tid <span style="color: #993333; font-weight: bold;">IN</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> id <span style="color: #993333; font-weight: bold;">FROM</span> threads <span style="color: #993333; font-weight: bold;">WHERE</span> section<span style="color: #66cc66;">=</span><span style="color: #ff0000;">'4'</span> <span style="color: #993333; font-weight: bold;">AND</span> subsection<span style="color: #66cc66;">=</span><span style="color: #ff0000;">'10'</span><span style="color: #66cc66;">&#41;</span> &nbsp;<span style="color: #993333; font-weight: bold;">GROUP</span> <span style="color: #993333; font-weight: bold;">BY</span> ch<span style="color: #66cc66;">.</span>tid<span style="color: #66cc66;">,</span> tm<span style="color: #66cc66;">.</span>timest<span style="color: #66cc66;">,</span> tm<span style="color: #66cc66;">.</span>subject<span style="color: #66cc66;">,</span> tm<span style="color: #66cc66;">.</span>tid<span style="color: #66cc66;">&#41;</span> c <span style="color: #993333; font-weight: bold;">ON</span> t<span style="color: #66cc66;">.</span>id <span style="color: #66cc66;">=</span> c<span style="color: #66cc66;">.</span>tid <span style="color: #993333; font-weight: bold;">WHERE</span> t<span style="color: #66cc66;">.</span>section <span style="color: #66cc66;">=</span><span style="color: #ff0000;">'4'</span> <span style="color: #993333; font-weight: bold;">AND</span> t<span style="color: #66cc66;">.</span>subsection <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'10'</span> <span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> t<span style="color: #66cc66;">.</span>attached <span style="color: #66cc66;">&lt;&gt;</span>true <span style="color: #993333; font-weight: bold;">ASC</span><span style="color: #66cc66;">,</span> c<span style="color: #66cc66;">.</span>timest <span style="color: #993333; font-weight: bold;">DESC</span> <span style="color: #993333; font-weight: bold;">LIMIT</span> <span style="color: #cc66cc;">30</span> OFFSET <span style="color: #cc66cc;">0</span><br />
&nbsp;</code></fieldset><br><br>на <br><br><fieldset><legend>sql</legend><code><br />
<span style="color: #993333; font-weight: bold;">SELECT</span> t<span style="color: #66cc66;">.</span>id<span style="color: #66cc66;">,</span> t<span style="color: #66cc66;">.</span>attached<span style="color: #66cc66;">,</span> c<span style="color: #66cc66;">.</span>subject<span style="color: #66cc66;">,</span> t<span style="color: #66cc66;">.</span>changing_timest<span style="color: #66cc66;">,</span> t<span style="color: #66cc66;">.</span>timest<span style="color: #66cc66;">,</span> c<span style="color: #66cc66;">.</span>uid <span style="color: #993333; font-weight: bold;">FROM</span> threads t <span style="color: #993333; font-weight: bold;">INNER</span> <span style="color: #993333; font-weight: bold;">JOIN</span> comments c <span style="color: #993333; font-weight: bold;">ON</span> t<span style="color: #66cc66;">.</span>cid <span style="color: #66cc66;">=</span> c<span style="color: #66cc66;">.</span>id <span style="color: #993333; font-weight: bold;">WHERE</span> t<span style="color: #66cc66;">.</span>section <span style="color: #66cc66;">=</span><span style="color: #ff0000;">'4'</span> <span style="color: #993333; font-weight: bold;">AND</span> t<span style="color: #66cc66;">.</span>subsection <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'10'</span> <span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> t<span style="color: #66cc66;">.</span>attached <span style="color: #66cc66;">&lt;&gt;</span>true <span style="color: #993333; font-weight: bold;">ASC</span><span style="color: #66cc66;">,</span> c<span style="color: #66cc66;">.</span>timest <span style="color: #993333; font-weight: bold;">DESC</span> <span style="color: #993333; font-weight: bold;">LIMIT</span> <span style="color: #cc66cc;">30</span> OFFSET <span style="color: #cc66cc;">0</span><br />
&nbsp;</code></fieldset><br><br>и триггер <fieldset><legend>sql</legend><code><br />
<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">OR</span> <span style="color: #993333; font-weight: bold;">REPLACE</span> <span style="color: #993333; font-weight: bold;">FUNCTION</span> <span style="color: #ff0000;">&quot;THREAD_CH_TIMEST_UPDATE&quot;</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; RETURNS <span style="color: #993333; font-weight: bold;">TRIGGER</span> <span style="color: #993333; font-weight: bold;">AS</span><br />
$BODY$<br />
DECLARE<br />
ch_timest timestamp without time zone <span style="color: #66cc66;">=</span> NEW<span style="color: #66cc66;">.</span>changing_timest;<br />
tid INTEGER <span style="color: #66cc66;">=</span> NEW<span style="color: #66cc66;">.</span>tid;<br />
BEGIN<br />
<span style="color: #993333; font-weight: bold;">IF</span> <span style="color: #993333; font-weight: bold;">EXISTS</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> threads <span style="color: #993333; font-weight: bold;">WHERE</span> id <span style="color: #66cc66;">=</span> tid<span style="color: #66cc66;">&#41;</span><br />
THEN<br />
<span style="color: #993333; font-weight: bold;">UPDATE</span> threads <span style="color: #993333; font-weight: bold;">SET</span> changing_timest <span style="color: #66cc66;">=</span> ch_timest <span style="color: #993333; font-weight: bold;">WHERE</span> id <span style="color: #66cc66;">=</span> tid;<br />
END <span style="color: #993333; font-weight: bold;">IF</span>;<br />
<span style="color: #993333; font-weight: bold;">RETURN</span> NEW;<br />
END<br />
$BODY$<br />
<span style="color: #993333; font-weight: bold;">LANGUAGE</span> <span style="color: #ff0000;">'plpgsql'</span> VOLATILE;<br />
<br />
<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TRIGGER</span> <span style="color: #ff0000;">&quot;THREAD_CH_TIMEST_UPDATE_TRIGGER&quot;</span><br />
BEFORE <span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">OR</span> <span style="color: #993333; font-weight: bold;">UPDATE</span><br />
<span style="color: #993333; font-weight: bold;">ON</span> comments<br />
<span style="color: #993333; font-weight: bold;">FOR</span> EACH ROW<br />
EXECUTE PROCEDURE <span style="color: #ff0000;">&quot;THREAD_CH_TIMEST_UPDATE&quot;</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp;</code></fieldset><br><br>и время генерации странички со списком тредов сократилось в 2 раза.</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109144</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109144</guid>
<pubDate>Wed, 05 Oct 2011 19:39:41 +0400</pubDate>
<description><![CDATA[<p>... хотя на своей машине не вижу никакого улучшения производительности от задания большего кеша, да и shared_buffers не хочет подниматься выше 27Мб..</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109130</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109130</guid>
<pubDate>Wed, 05 Oct 2011 17:54:02 +0400</pubDate>
<description><![CDATA[<p>Вобщем посмотрел настройки - практически всё тоже что и у меня по дефолту..<br><br>Но:<br><br>1. shared_buffers=24MB - это в мане советуют выставить в 25% оперативки, но в каком-то референсе по тьюнингу вычитал что увлекаться не стоит и лучше поставить поменьше, например 64MB, и полагаться на кеш, см.ниже:<br><br>2. effective_cache_size=128MB - этот параметр советуют выставить в честное значение, обозначающее количество памяти доступной для файлового кеша ОС. Если для твоей домашней машины такое значение более-менее честно, то тут я думаю полгига где-то надо выставить. Ибо &quot;PostgreSQL counts a lot on the OS to cache data files and hence does not bother with duplicating its file caching effort. The shared buffers parameter assumes that OS is going to cache a lot of files and hence it is generally very low compared with system RAM.&quot;<br><br> </p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109125</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109125</guid>
<pubDate>Wed, 05 Oct 2011 17:30:59 +0400</pubDate>
<description><![CDATA[<p>Делал полностью REINDEX DATABASE не помогло.</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109116</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109116</guid>
<pubDate>Wed, 05 Oct 2011 16:39:51 +0400</pubDate>
<description><![CDATA[<p>Если в CPU тогда мож где не прописал индексы и оно скатилось до линейного поиска?</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109085</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109085</guid>
<pubDate>Wed, 05 Oct 2011 13:25:46 +0400</pubDate>
<description><![CDATA[<p>Алсо, воткнул глобальный счётчик времени запросов в движок, убедился, что почти 90% времени таки занимают запросы, и пхп совсем не виноват. Если, конечно, с кодом не ошибся.<br><br>Вообще там есть простор для денормализации, например для того же самого количества сообщений. Ведь запись тут намного реже чтения, а значит лучше один раз при записи увеличивать счётчик, а не считать его при каждом выводе.<br><br></p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109084</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109084</guid>
<pubDate>Wed, 05 Oct 2011 13:20:02 +0400</pubDate>
<description><![CDATA[<p><i>>Кстати там я наткнулся на такой ужаснейший запрос с 2 иннер джойнами и вложенными подзапросами аж 4 уровня выполняющийся больше секунды.</i><br> Жуть. У меня на 9.1 оно аж 2,5 сек отрабатывает. Попробовал 8.3 на lenny с сильно загруженным процом - около 3 сек, может оптимизатор со временем урежет. А вообще, конечно, надо на explain смотреть, но я в этом не силён.</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109082</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109082</guid>
<pubDate>Wed, 05 Oct 2011 13:18:42 +0400</pubDate>
<description><![CDATA[<p>угу. Абсолютно такой-же. Я его уже заменил. Но сам запрос меня сейчас позабавил. Походу я его по пьяни писал.</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109080</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109080</guid>
<pubDate>Wed, 05 Oct 2011 13:13:01 +0400</pubDate>
<description><![CDATA[<p>Этот похож на то, что рассматривали вчера.</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109079</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109079</guid>
<pubDate>Wed, 05 Oct 2011 13:10:01 +0400</pubDate>
<description><![CDATA[<p>У меня 9.0.4, а сайт сегодня скачать и поставить наверное не смогу.</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109077</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109077</guid>
<pubDate>Wed, 05 Oct 2011 13:07:33 +0400</pubDate>
<description><![CDATA[<p>Кстати там я наткнулся на такой ужаснейший запрос с 2 иннер джойнами и вложенными подзапросами аж 4 уровня выполняющийся больше секунды. <br><br><fieldset><legend>sql</legend><code><br />
<span style="color: #993333; font-weight: bold;">SELECT</span> t<span style="color: #66cc66;">.</span>id<span style="color: #66cc66;">,</span> t<span style="color: #66cc66;">.</span>attached<span style="color: #66cc66;">,</span> c<span style="color: #66cc66;">.</span>subject<span style="color: #66cc66;">,</span> c<span style="color: #66cc66;">.</span>changing_timest<span style="color: #66cc66;">,</span> c<span style="color: #66cc66;">.</span>timest <span style="color: #993333; font-weight: bold;">FROM</span> threads t <span style="color: #993333; font-weight: bold;">INNER</span> <span style="color: #993333; font-weight: bold;">JOIN</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> tm<span style="color: #66cc66;">.</span>tid<span style="color: #66cc66;">,</span> tm<span style="color: #66cc66;">.</span>subject<span style="color: #66cc66;">,</span> tm<span style="color: #66cc66;">.</span>timest<span style="color: #66cc66;">,</span> max<span style="color: #66cc66;">&#40;</span>ch<span style="color: #66cc66;">.</span>changing_timest<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> changing_timest <span style="color: #993333; font-weight: bold;">FROM</span> comments ch <span style="color: #993333; font-weight: bold;">INNER</span> <span style="color: #993333; font-weight: bold;">JOIN</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> tid<span style="color: #66cc66;">,</span> timest<span style="color: #66cc66;">,</span> subject <span style="color: #993333; font-weight: bold;">FROM</span> comments <span style="color: #993333; font-weight: bold;">WHERE</span> timest <span style="color: #993333; font-weight: bold;">IN</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> min<span style="color: #66cc66;">&#40;</span>timest<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">FROM</span> comments <span style="color: #993333; font-weight: bold;">WHERE</span> tid <span style="color: #993333; font-weight: bold;">IN</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> id <span style="color: #993333; font-weight: bold;">FROM</span> threads <span style="color: #993333; font-weight: bold;">WHERE</span> section<span style="color: #66cc66;">=</span><span style="color: #ff0000;">'4'</span> <span style="color: #993333; font-weight: bold;">AND</span> subsection<span style="color: #66cc66;">=</span><span style="color: #ff0000;">'10'</span><span style="color: #66cc66;">&#41;</span> &nbsp;<span style="color: #993333; font-weight: bold;">GROUP</span> <span style="color: #993333; font-weight: bold;">BY</span> tid<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> tm <span style="color: #993333; font-weight: bold;">ON</span> ch<span style="color: #66cc66;">.</span>tid <span style="color: #66cc66;">=</span> tm<span style="color: #66cc66;">.</span>tid <span style="color: #993333; font-weight: bold;">WHERE</span> ch<span style="color: #66cc66;">.</span>tid <span style="color: #993333; font-weight: bold;">IN</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> id <span style="color: #993333; font-weight: bold;">FROM</span> threads <span style="color: #993333; font-weight: bold;">WHERE</span> section<span style="color: #66cc66;">=</span><span style="color: #ff0000;">'4'</span> <span style="color: #993333; font-weight: bold;">AND</span> subsection<span style="color: #66cc66;">=</span><span style="color: #ff0000;">'10'</span><span style="color: #66cc66;">&#41;</span> &nbsp;<span style="color: #993333; font-weight: bold;">GROUP</span> <span style="color: #993333; font-weight: bold;">BY</span> ch<span style="color: #66cc66;">.</span>tid<span style="color: #66cc66;">,</span> tm<span style="color: #66cc66;">.</span>timest<span style="color: #66cc66;">,</span> tm<span style="color: #66cc66;">.</span>subject<span style="color: #66cc66;">,</span> tm<span style="color: #66cc66;">.</span>tid<span style="color: #66cc66;">&#41;</span> c <span style="color: #993333; font-weight: bold;">ON</span> t<span style="color: #66cc66;">.</span>id <span style="color: #66cc66;">=</span> c<span style="color: #66cc66;">.</span>tid <span style="color: #993333; font-weight: bold;">WHERE</span> t<span style="color: #66cc66;">.</span>section <span style="color: #66cc66;">=</span><span style="color: #ff0000;">'4'</span> <span style="color: #993333; font-weight: bold;">AND</span> t<span style="color: #66cc66;">.</span>subsection <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'10'</span> <span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> t<span style="color: #66cc66;">.</span>attached <span style="color: #66cc66;">&lt;&gt;</span>true <span style="color: #993333; font-weight: bold;">ASC</span><span style="color: #66cc66;">,</span> c<span style="color: #66cc66;">.</span>timest <span style="color: #993333; font-weight: bold;">DESC</span> <span style="color: #993333; font-weight: bold;">LIMIT</span> <span style="color: #cc66cc;">30</span> OFFSET <span style="color: #cc66cc;">0</span><br />
&nbsp;</code></fieldset></p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109069</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109069</guid>
<pubDate>Wed, 05 Oct 2011 12:45:46 +0400</pubDate>
<description><![CDATA[<p>Ох ты ж. Список сообщений в толксах: <br><br>Страница сгенерировалась за 8.81644 сек</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109068</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109068</guid>
<pubDate>Wed, 05 Oct 2011 12:43:52 +0400</pubDate>
<description><![CDATA[<p>Ну и у меня на локалке главная за секунду генерится.</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109065</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109065</guid>
<pubDate>Wed, 05 Oct 2011 12:35:50 +0400</pubDate>
<description><![CDATA[<p><i>> Да, и я не верю что разница в производительности в 200 раз связана с версией СУБД :) Этого просто не может быть.</i><br> может. Блокировки и оптимизатор. Собственно за это ынтырпрайзу бабло и плотят, за умение написать оптимизированный запрос. Не тестируйте скорость на одном запросе, это бессмысленно. Надо сделать хотя бы десяток одновременно и смотреть тогда. Алсо иннер джоины и вложеные запросы суксь.</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109063</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109063</guid>
<pubDate>Wed, 05 Oct 2011 12:30:55 +0400</pubDate>
<description><![CDATA[<p><i>>Ты там вроде на каждый запрос ещё делаешь &quot;UPDATE users SET last_visit&quot; - он не тормозит на анонимусах?</i><br> Не делаю. last_visit обновляется при загрузке страницы. &lt;!-- Запрос UPDATE users SET last_visit='2011-10-05 12:28:22' WHERE id='7'  выполнен за 0.061698 сек.--&gt; А тормозят именно запросы к таблице comments</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109061</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109061</guid>
<pubDate>Wed, 05 Oct 2011 12:27:10 +0400</pubDate>
<description><![CDATA[<p><i>>Ну чо, втянул базу..</i><br> Почти такие же цифры, постгрес 9.1.1. Главная генерится за ~1 сек, список форумов - за 1,5 сек.<br><br>Попозже доберусь до постгреса 8.3 и 8.4.</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109059</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109059</guid>
<pubDate>Wed, 05 Oct 2011 12:21:46 +0400</pubDate>
<description><![CDATA[<p>У меня он 50 мсек дает.. Чему там набигать, если у тебя запросов штук десять на страницу, не больше. <br><br>Ты там вроде на каждый запрос ещё делаешь &quot;UPDATE users SET last_visit&quot; - он не тормозит на анонимусах?</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109058</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109058</guid>
<pubDate>Wed, 05 Oct 2011 12:21:08 +0400</pubDate>
<description><![CDATA[<p><fieldset><legend>text</legend><code><br />
# -----------------------------<br />
# PostgreSQL configuration file<br />
# -----------------------------<br />
#<br />
# This file consists of lines of the form:<br />
#<br />
# &nbsp; name = value<br />
#<br />
# (The &quot;=&quot; is optional.) &nbsp;Whitespace may be used. &nbsp;Comments are introduced with<br />
# &quot;#&quot; anywhere on a line. &nbsp;The complete list of parameter names and allowed<br />
# values can be found in the PostgreSQL documentation.<br />
#<br />
# The commented-out settings shown in this file represent the default values.<br />
# Re-commenting a setting is NOT sufficient to revert it to the default value;<br />
# you need to reload the server.<br />
#<br />
# This file is read on server startup and when the server receives a SIGHUP<br />
# signal. &nbsp;If you edit the file on a running system, you have to SIGHUP the<br />
# server for the changes to take effect, or use &quot;pg_ctl reload&quot;. &nbsp;Some<br />
# parameters, which are marked below, require a server shutdown and restart to<br />
# take effect.<br />
#<br />
# Any parameter can also be given as a command-line option to the server, e.g.,<br />
# &quot;postgres -c log_connections=on&quot;. &nbsp;Some paramters can be changed at run time<br />
# with the &quot;SET&quot; SQL command.<br />
#<br />
# Memory units: &nbsp;kB = kilobytes MB = megabytes GB = gigabytes<br />
# Time units: &nbsp; &nbsp;ms = milliseconds s = seconds min = minutes h = hours d = days<br />
<br />
<br />
#------------------------------------------------------------------------------<br />
# FILE LOCATIONS<br />
#------------------------------------------------------------------------------<br />
<br />
# The default values of these variables are driven from the -D command-line<br />
# option or PGDATA environment variable, represented here as ConfigDir.<br />
<br />
data_directory = '/var/lib/postgresql/8.3/main' &nbsp; &nbsp; &nbsp; &nbsp; # use data in another directory<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # (change requires restart)<br />
hba_file = '/etc/postgresql/8.3/main/pg_hba.conf' &nbsp; &nbsp; &nbsp; # host-based authentication file<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # (change requires restart)<br />
ident_file = '/etc/postgresql/8.3/main/pg_ident.conf' &nbsp; # ident configuration file<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # (change requires restart)<br />
<br />
# If external_pid_file is not explicitly set, no extra PID file is written.<br />
external_pid_file = '/var/run/postgresql/8.3-main.pid'&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # write an extra PID file<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # (change requires restart)<br />
<br />
<br />
#------------------------------------------------------------------------------<br />
# CONNECTIONS AND AUTHENTICATION<br />
#------------------------------------------------------------------------------<br />
<br />
# - Connection Settings -<br />
<br />
#listen_addresses = 'localhost' &nbsp; &nbsp; &nbsp; &nbsp; # what IP address(es) to listen on;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # comma-separated list of addresses;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # defaults to 'localhost', '*' = all<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # (change requires restart)<br />
port = 5432 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # (change requires restart)<br />
max_connections = 120 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # (change requires restart)<br />
# Note: &nbsp;Increasing max_connections costs ~400 bytes of shared memory per <br />
# connection slot, plus lock space (see max_locks_per_transaction). &nbsp;You might<br />
# also need to raise shared_buffers to support more connections.<br />
#superuser_reserved_connections = 3 &nbsp; &nbsp; # (change requires restart)<br />
unix_socket_directory = '/var/run/postgresql' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # (change requires restart)<br />
#unix_socket_group = '' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # (change requires restart)<br />
#unix_socket_permissions = 0777 &nbsp; &nbsp; &nbsp; &nbsp; # begin with 0 to use octal notation<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # (change requires restart)<br />
#bonjour_name = ''&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # defaults to the computer name<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # (change requires restart)<br />
<br />
# - Security and Authentication -<br />
<br />
#authentication_timeout = 1min&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # 1s-600s<br />
ssl = true&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # (change requires restart)<br />
#ssl_ciphers = 'ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH'&nbsp; &nbsp; &nbsp; # allowed SSL ciphers<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # (change requires restart)<br />
#ssl_renegotiation_limit = 512MB&nbsp; &nbsp; &nbsp; &nbsp; # amount of data between renegotiations<br />
#password_encryption = on<br />
#db_user_namespace = off<br />
<br />
# Kerberos and GSSAPI<br />
#krb_server_keyfile = ''&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # (change requires restart)<br />
#krb_srvname = 'postgres' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # (change requires restart, Kerberos only)<br />
#krb_server_hostname = '' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # empty string matches any keytab entry<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # (change requires restart, Kerberos only)<br />
#krb_caseins_users = off&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # (change requires restart)<br />
#krb_realm = '' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # (change requires restart)<br />
<br />
# - TCP Keepalives -<br />
# see &quot;man 7 tcp&quot; for details<br />
<br />
#tcp_keepalives_idle = 0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # TCP_KEEPIDLE, in seconds;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # 0 selects the system default<br />
#tcp_keepalives_interval = 0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # TCP_KEEPINTVL, in seconds;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # 0 selects the system default<br />
#tcp_keepalives_count = 0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # TCP_KEEPCNT;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # 0 selects the system default<br />
<br />
<br />
#------------------------------------------------------------------------------<br />
# RESOURCE USAGE (except WAL)<br />
#------------------------------------------------------------------------------<br />
<br />
# - Memory -<br />
<br />
shared_buffers = 24MB &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # min 128kB or max_connections*16kB<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # (change requires restart)<br />
temp_buffers = 8MB&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # min 800kB<br />
#max_prepared_transactions = 5&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # can be 0 or more<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # (change requires restart)<br />
# Note: &nbsp;Increasing max_prepared_transactions costs ~600 bytes of shared memory<br />
# per transaction slot, plus lock space (see max_locks_per_transaction).<br />
work_mem = 256MB&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # min 64kB<br />
maintenance_work_mem = 8MB&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # min 1MB<br />
max_stack_depth = 2MB &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # min 100kB<br />
<br />
# - Free Space Map -<br />
<br />
max_fsm_pages = 153600&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # min max_fsm_relations*16, 6 bytes each<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # (change requires restart)<br />
#max_fsm_relations = 1000 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # min 100, ~70 bytes each<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # (change requires restart)<br />
<br />
# - Kernel Resource Usage -<br />
<br />
#max_files_per_process = 1000 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # min 25<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # (change requires restart)<br />
#shared_preload_libraries = ''&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # (change requires restart)<br />
<br />
# - Cost-Based Vacuum Delay -<br />
<br />
#vacuum_cost_delay = 0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # 0-1000 milliseconds<br />
#vacuum_cost_page_hit = 1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # 0-10000 credits<br />
#vacuum_cost_page_miss = 10 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # 0-10000 credits<br />
#vacuum_cost_page_dirty = 20&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # 0-10000 credits<br />
#vacuum_cost_limit = 200&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # 1-10000 credits<br />
<br />
# - Background Writer -<br />
<br />
#bgwriter_delay = 200ms &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # 10-10000ms between rounds<br />
#bgwriter_lru_maxpages = 100&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # 0-1000 max buffers written/round<br />
#bgwriter_lru_multiplier = 2.0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # 0-10.0 multipler on buffers scanned/round<br />
<br />
<br />
#------------------------------------------------------------------------------<br />
# WRITE AHEAD LOG<br />
#------------------------------------------------------------------------------<br />
<br />
# - Settings -<br />
<br />
#fsync = on &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # turns forced synchronization on or off<br />
#synchronous_commit = on&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # immediate fsync at commit<br />
#wal_sync_method = fsync&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # the default is the first option <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # supported by the operating system:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; open_datasync<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; fdatasync<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; fsync<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; fsync_writethrough<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; open_sync<br />
#full_page_writes = on&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # recover from partial page writes<br />
#wal_buffers = 64kB &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # min 32kB<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # (change requires restart)<br />
#wal_writer_delay = 200ms &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # 1-10000 milliseconds<br />
<br />
#commit_delay = 0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # range 0-100000, in microseconds<br />
#commit_siblings = 5&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # range 1-1000<br />
<br />
# - Checkpoints -<br />
<br />
#checkpoint_segments = 3&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # in logfile segments, min 1, 16MB each<br />
#checkpoint_timeout = 5min&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # range 30s-1h<br />
#checkpoint_completion_target = 0.5 &nbsp; &nbsp; # checkpoint target duration, 0.0 - 1.0<br />
#checkpoint_warning = 30s &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # 0 is off<br />
<br />
# - Archiving -<br />
<br />
#archive_mode = off &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # allows archiving to be done<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # (change requires restart)<br />
#archive_command = '' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # command to use to archive a logfile segment<br />
#archive_timeout = 0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # force a logfile segment switch after this<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # time; 0 is off<br />
<br />
<br />
#------------------------------------------------------------------------------<br />
# QUERY TUNING<br />
#------------------------------------------------------------------------------<br />
<br />
# - Planner Method Configuration -<br />
<br />
enable_bitmapscan = on<br />
enable_hashagg = on<br />
enable_hashjoin = on<br />
enable_indexscan = on<br />
enable_mergejoin = on<br />
enable_nestloop = on<br />
enable_seqscan = on<br />
enable_sort = on<br />
enable_tidscan = on<br />
<br />
# - Planner Cost Constants -<br />
<br />
#seq_page_cost = 1.0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # measured on an arbitrary scale<br />
#random_page_cost = 4.0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # same scale as above<br />
cpu_tuple_cost = 0.01 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # same scale as above<br />
cpu_index_tuple_cost = 0.005&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # same scale as above<br />
cpu_operator_cost = 0.0025&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # same scale as above<br />
effective_cache_size = 128MB<br />
<br />
# - Genetic Query Optimizer -<br />
<br />
#geqo = on<br />
#geqo_threshold = 12<br />
#geqo_effort = 5&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # range 1-10<br />
#geqo_pool_size = 0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # selects default based on effort<br />
#geqo_generations = 0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # selects default based on effort<br />
#geqo_selection_bias = 2.0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # range 1.5-2.0<br />
<br />
# - Other Planner Options -<br />
<br />
#default_statistics_target = 10 &nbsp; &nbsp; &nbsp; &nbsp; # range 1-1000<br />
#constraint_exclusion = off<br />
#from_collapse_limit = 8<br />
#join_collapse_limit = 8&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # 1 disables collapsing of explicit <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # JOIN clauses<br />
<br />
<br />
#------------------------------------------------------------------------------<br />
# ERROR REPORTING AND LOGGING<br />
#------------------------------------------------------------------------------<br />
<br />
# - Where to Log -<br />
<br />
#log_destination = 'stderr' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # Valid values are combinations of<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # stderr, csvlog, syslog and eventlog,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # depending on platform. &nbsp;csvlog<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # requires logging_collector to be on.<br />
<br />
# This is used when logging to stderr:<br />
#logging_collector = off&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # Enable capturing of stderr and csvlog<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # into log files. Required to be on for<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # csvlogs.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # (change requires restart)<br />
<br />
# These are only used if logging_collector is on:<br />
#log_directory = 'pg_log' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # directory where log files are written,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # can be absolute or relative to PGDATA<br />
#log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'&nbsp; &nbsp; &nbsp; &nbsp; # log file name pattern,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # can include strftime() escapes<br />
#log_truncate_on_rotation = off &nbsp; &nbsp; &nbsp; &nbsp; # If on, an existing log file of the<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # same name as the new log file will be<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # truncated rather than appended to.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # But such truncation only occurs on<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # time-driven rotation, not on restarts<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # or size-driven rotation. &nbsp;Default is<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # off, meaning append to existing files<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # in all cases.<br />
#log_rotation_age = 1d&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # Automatic rotation of logfiles will<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # happen after that time. &nbsp;0 to disable.<br />
#log_rotation_size = 10MB &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # Automatic rotation of logfiles will <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # happen after that much log output.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # 0 to disable.<br />
<br />
# These are relevant when logging to syslog:<br />
#syslog_facility = 'LOCAL0'<br />
#syslog_ident = 'postgres'<br />
<br />
<br />
# - When to Log -<br />
<br />
#client_min_messages = notice &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # values in order of decreasing detail:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; debug5<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; debug4<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; debug3<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; debug2<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; debug1<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; log<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; notice<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; warning<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; error<br />
<br />
#log_min_messages = notice&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # values in order of decreasing detail:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; debug5<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; debug4<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; debug3<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; debug2<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; debug1<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; info<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; notice<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; warning<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; error<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; log<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; fatal<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; panic<br />
<br />
#log_error_verbosity = default&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # terse, default, or verbose messages<br />
<br />
#log_min_error_statement = error&nbsp; &nbsp; &nbsp; &nbsp; # values in order of decreasing detail:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; debug5<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; debug4<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; debug3<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; debug2<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; debug1<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; info<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; notice<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; warning<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; error<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; log<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; fatal<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; panic (effectively off)<br />
<br />
#log_min_duration_statement = -1&nbsp; &nbsp; &nbsp; &nbsp; # -1 is disabled, 0 logs all statements<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # and their durations, &gt; 0 logs only<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # statements running at least this time.<br />
<br />
#silent_mode = off&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # DO NOT USE without syslog or<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # logging_collector<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # (change requires restart)<br />
<br />
# - What to Log -<br />
<br />
#debug_print_parse = off<br />
#debug_print_rewritten = off<br />
#debug_print_plan = off<br />
#debug_pretty_print = off<br />
#log_checkpoints = off<br />
#log_connections = off<br />
#log_disconnections = off<br />
#log_duration = off<br />
#log_hostname = off<br />
log_line_prefix = '%t ' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # special values:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; %u = user name<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; %d = database name<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; %r = remote host and port<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; %h = remote host<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; %p = process ID<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; %t = timestamp without milliseconds<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; %m = timestamp with milliseconds<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; %i = command tag<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; %c = session ID<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; %l = session line number<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; %s = session start timestamp<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; %v = virtual transaction ID<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; %x = transaction ID (0 if none)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; %q = stop here in non-session<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;processes<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; %% = '%'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # e.g. '&lt;%u%%%d&gt; '<br />
#log_lock_waits = off &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # log lock waits &gt;= deadlock_timeout<br />
#log_statement = 'none' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # none, ddl, mod, all<br />
#log_temp_files = -1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # log temporary files equal or larger<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # than specified size;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # -1 disables, 0 logs all temp files<br />
#log_timezone = unknown &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # actually, defaults to TZ environment<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # setting<br />
<br />
<br />
#------------------------------------------------------------------------------<br />
# RUNTIME STATISTICS<br />
#------------------------------------------------------------------------------<br />
<br />
# - Query/Index Statistics Collector -<br />
<br />
#track_activities = on<br />
#track_counts = on<br />
#update_process_title = on<br />
<br />
<br />
# - Statistics Monitoring -<br />
<br />
#log_parser_stats = off<br />
#log_planner_stats = off<br />
#log_executor_stats = off<br />
#log_statement_stats = off<br />
<br />
<br />
#------------------------------------------------------------------------------<br />
# AUTOVACUUM PARAMETERS<br />
#------------------------------------------------------------------------------<br />
<br />
#autovacuum = on&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # Enable autovacuum subprocess? &nbsp;'on' <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # requires track_counts to also be on.<br />
#log_autovacuum_min_duration = -1 &nbsp; &nbsp; &nbsp; # -1 disables, 0 logs all actions and<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # their durations, &gt; 0 logs only<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # actions running at least that time.<br />
#autovacuum_max_workers = 3 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # max number of autovacuum subprocesses<br />
#autovacuum_naptime = 1min&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # time between autovacuum runs<br />
#autovacuum_vacuum_threshold = 50 &nbsp; &nbsp; &nbsp; # min number of row updates before<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # vacuum<br />
#autovacuum_analyze_threshold = 50&nbsp; &nbsp; &nbsp; # min number of row updates before <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # analyze<br />
#autovacuum_vacuum_scale_factor = 0.2 &nbsp; # fraction of table size before vacuum<br />
#autovacuum_analyze_scale_factor = 0.1&nbsp; # fraction of table size before analyze<br />
#autovacuum_freeze_max_age = 200000000&nbsp; # maximum XID age before forced vacuum<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # (change requires restart)<br />
#autovacuum_vacuum_cost_delay = 20&nbsp; &nbsp; &nbsp; # default vacuum cost delay for<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # autovacuum, -1 means use<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # vacuum_cost_delay<br />
#autovacuum_vacuum_cost_limit = -1&nbsp; &nbsp; &nbsp; # default vacuum cost limit for<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # autovacuum, -1 means use<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # vacuum_cost_limit<br />
<br />
<br />
#------------------------------------------------------------------------------<br />
# CLIENT CONNECTION DEFAULTS<br />
#------------------------------------------------------------------------------<br />
<br />
# - Statement Behavior -<br />
<br />
#search_path = '&quot;$user&quot;,public' &nbsp; &nbsp; &nbsp; &nbsp; # schema names<br />
#default_tablespace = ''&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # a tablespace name, '' uses the default<br />
#temp_tablespaces = ''&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # a list of tablespace names, '' uses<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # only default tablespace<br />
#check_function_bodies = on<br />
#default_transaction_isolation = 'read committed'<br />
#default_transaction_read_only = off<br />
#session_replication_role = 'origin'<br />
#statement_timeout = 0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # 0 is disabled<br />
#vacuum_freeze_min_age = 100000000<br />
#xmlbinary = 'base64'<br />
#xmloption = 'content'<br />
<br />
# - Locale and Formatting -<br />
<br />
datestyle = 'iso, mdy'<br />
#timezone = unknown &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # actually, defaults to TZ environment<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # setting<br />
#timezone_abbreviations = 'Default' &nbsp; &nbsp; # Select the set of available time zone<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # abbreviations. &nbsp;Currently, there are<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; Default<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; Australia<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # &nbsp; India<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # You can create your own file in<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # share/timezonesets/.<br />
#extra_float_digits = 0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # min -15, max 2<br />
#client_encoding = sql_ascii&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # actually, defaults to database<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # encoding<br />
<br />
# These settings are initialized by initdb, but they can be changed.<br />
lc_messages = 'C' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # locale for system error message<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # strings<br />
lc_monetary = 'C' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # locale for monetary formatting<br />
lc_numeric = 'C'&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # locale for number formatting<br />
lc_time = 'C' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # locale for time formatting<br />
<br />
# default configuration for text search<br />
default_text_search_config = 'pg_catalog.english'<br />
<br />
# - Other Defaults -<br />
<br />
#explain_pretty_print = on<br />
#dynamic_library_path = '$libdir'<br />
#local_preload_libraries = ''<br />
<br />
<br />
#------------------------------------------------------------------------------<br />
# LOCK MANAGEMENT<br />
#------------------------------------------------------------------------------<br />
<br />
#deadlock_timeout = 1s<br />
#max_locks_per_transaction = 64 &nbsp; &nbsp; &nbsp; &nbsp; # min 10<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # (change requires restart)<br />
# Note: &nbsp;Each lock table slot uses ~270 bytes of shared memory, and there are<br />
# max_locks_per_transaction * (max_connections + max_prepared_transactions)<br />
# lock table slots.<br />
<br />
<br />
#------------------------------------------------------------------------------<br />
# VERSION/PLATFORM COMPATIBILITY<br />
#------------------------------------------------------------------------------<br />
<br />
# - Previous PostgreSQL Versions -<br />
<br />
#add_missing_from = off<br />
#array_nulls = on<br />
#backslash_quote = safe_encoding&nbsp; &nbsp; &nbsp; &nbsp; # on, off, or safe_encoding<br />
#default_with_oids = off<br />
#escape_string_warning = on<br />
#regex_flavor = advanced&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # advanced, extended, or basic<br />
#sql_inheritance = on<br />
#standard_conforming_strings = off<br />
#synchronize_seqscans = on<br />
<br />
# - Other Platforms and Clients -<br />
<br />
#transform_null_equals = off<br />
<br />
<br />
#------------------------------------------------------------------------------<br />
# CUSTOMIZED OPTIONS<br />
#------------------------------------------------------------------------------<br />
<br />
#custom_variable_classes = '' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # list of custom variable class names<br />
<br />
&nbsp;</code></fieldset></p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109057</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109057</guid>
<pubDate>Wed, 05 Oct 2011 12:14:41 +0400</pubDate>
<description><![CDATA[<p>Да они все по мелочи притормаживают. Вот в сумме и набегает. Вот например &lt;!-- Запрос SELECT id FROM comments WHERE tid = '34824' ORDER BY id ASC выполнен за 0.230221 сек.--&gt; А конфиг будет уже ближе к вечеру.</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109047</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109047</guid>
<pubDate>Wed, 05 Oct 2011 11:41:33 +0400</pubDate>
<description><![CDATA[<p>Ну чо, втянул базу.. <br><br>SELECT count(*) AS cnt FROM comments where tid = 34536 кушает ~50 миллисеков<br><br>SELECT ALL * FROM comments WHERE timest &gt; '2011-10-04 12:37:53' ORDER BY timest DESC OFFSET 0 LIMIT NULL =&gt; 60 миллисеков<br><br>SELECT t.id, t.cid, t.attached, t.prooflink, t.approved, t.approved_by, t.approve_timest, t.subsection, c.subject, c.comment, c.uid, c.timest FROM threads t INNER JOIN comments c ON t.cid = c.id WHERE t.approved=true AND t.section=1 ORDER BY t.attached &lt;&gt;true ASC, t.id DESC LIMIT 10 OFFSET 0 =&gt; 15 миллисеков<br><br>Тюксоид, Выкладывай наверное и postgresql.conf - чтобы можно было свой конфиг портить и смотреть где затормозит. У тебя есть какие-нибудь образцово-тормозные запросы сейчас?</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109019</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109019</guid>
<pubDate>Wed, 05 Oct 2011 10:23:50 +0400</pubDate>
<description><![CDATA[<p>Much better :)</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109017</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109017</guid>
<pubDate>Wed, 05 Oct 2011 10:21:53 +0400</pubDate>
<description><![CDATA[<p>лови http://rulinux.net/dump.sql.gz</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109008</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109008</guid>
<pubDate>Wed, 05 Oct 2011 10:05:22 +0400</pubDate>
<description><![CDATA[<p>wget-нул его с домашней машины, получил какой-то мусор, похожий на ХТМЛ со вставками джаваскрипта. w3m вообще нифига не показывает по данному урлу. Чо тебе на собственном хостинге файл не выложить?</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109005</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109005</guid>
<pubDate>Wed, 05 Oct 2011 09:49:52 +0400</pubDate>
<description><![CDATA[<p>ловите ссылку на дамп http://zalil.ru/31812593</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109004</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109004</guid>
<pubDate>Wed, 05 Oct 2011 09:47:35 +0400</pubDate>
<description><![CDATA[<p>уже сменил на qwerty и noim@rulinux.net, noemail@rulinux.net. Ссылку дам как только загрузится на zalil.ru</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109003</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109003</guid>
<pubDate>Wed, 05 Oct 2011 09:43:20 +0400</pubDate>
<description><![CDATA[<p>Ну пароли сбросить - дело одного апдейта, я про остальное: насколько я понимаю у тебя раньше тебе базу расшарить мешали трудности с зачисткой айпишников и другой приватной информации и типа того?</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109002</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109002</guid>
<pubDate>Wed, 05 Oct 2011 09:40:28 +0400</pubDate>
<description><![CDATA[<p><i>>В новой БД они вроде и храниться-то кстати не должны, что облегчает дело.</i><br> Как это пароли не хранятся? IPшники не харнятся, а пароли хранятся ввиде md5-хешей.</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#109001</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#109001</guid>
<pubDate>Wed, 05 Oct 2011 09:38:25 +0400</pubDate>
<description><![CDATA[<p>Нет во время выполнения запроса.</p>]]></description>
</item>
<item>
<title>Re:Ну так чо там с апгрейдом постгреса?</title>
<link>https://rulinux.net/message.php?newsid=34821&amp;page=1#108999</link>
<guid>https://rulinux.net/message.php?newsid=34821&amp;page=1#108999</guid>
<pubDate>Wed, 05 Oct 2011 09:27:11 +0400</pubDate>
<description><![CDATA[<p><i>> А может ты выложишь дамп БД, естественно без паролей, емейлов и im-ов? Тогда можно будет попробовать потестировать на реальных данных на разных машинах.</i><br> В новой БД они вроде и храниться-то кстати не должны, что облегчает дело.</p>]]></description>
</item>
</channel>
</rss>