<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="144959" data-post-id="144959">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="scouten" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/scouten/120/2055_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  scouten
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>OK, got a few spare moments so I was able to post it tonight.</p>
<p><a href="https://github.com/scouten/pghr/pull/16" class="onebox" target="_blank" rel="noopener nofollow ugc">https://github.com/scouten/pghr/pull/16</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="144959" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/looking-for-help-with-poor-ecto-query-performance/25476/77">Post #76</a>
	                </div>
	            </div>
              <div id="likers-container-144959" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="144959"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #76"></div>
  </section>
</div>
    <div class="postbit" id="144978" data-post-id="144978">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="aseigo" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/aseigo/120/10674_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  aseigo
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Curious on this one, I gave it a spin here as well.</p>
<p>With pgbench without the pg_notify trigger, I get a bit over 80k TPS. With the trigger, pgbench manages “only” 50k TPS, which is only 62.5% the performance relative to without.This is quite reliable here.</p>
<p>Using ecto, I get 44k TPS without the pg_notify trigger, and 33k with the trigger which is 75% the performance of without.</p>
<p>The drop in performance is less (relatively) in ecto than pgbench, which makes sense since there is overhead in the Elixir code (inc ecto, of course) which gets paid on every transaction, which masks the performance hit due only to the trigger. But the performance drop is there, and significant in both pgbench and the ecto benchmark.</p>
<p>Simplifying the trigger itself by removing the string coercion and concats results in a small improvement in performance, which also makes sense since that code is actually being run in the db. Keeping the trigger but removing the pg_notify eliminates the performance penalty entirely.</p>
<p>Moving to just one thread (vs 10), the penalty is reduced to 83% as fast with vs without the pg_notify, so it certainly costs more as the number of parallel actions occur …</p>
<p>So, seems that the issue is pg_notify itself, and is indeed likely the 0(n^2) behavior showing up when there are multiple messages being broadcast on the same notification channel.</p>
<p>There are patches on the postgresql mailing list that have been rotting for a year or more (depending on the patch). This seems to be an issue that is not going to see easy resolution. If this is indeed the source of your performance problems, it may be time to look at a solution other than pg_notify. <img src="https://forum.elixirforum.com/images/emoji/apple/confused.png?v=15" title=":confused:" class="emoji" alt=":confused:" loading="lazy" width="20" height="20"></p>
<p>If your application(s) are entirely Elixir and/or database mutations all go through your Elixir code, you may want to look at phoenix_pubsub. It certainly scales decently, and works lovely as a message bus. If you need horizontal scalability and can not do BEAM clustering, then perhaps move to a full external message queue bus solution or if you have to (or just want to) keep it all in-app perhaps look at something like lasp-pg.</p>
<p>Good luck!</p>
<p>(p.s. Also tried with the straight NOTIFY call instead of a PERFORM pg_notify in case there was some gotcha there, but they are indeed equivalent.)</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="144978" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/looking-for-help-with-poor-ecto-query-performance/25476/78">Post #77</a>
	                </div>
	            </div>
              <div id="likers-container-144978" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="144978"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #77"></div>
  </section>
</div>
    <div class="postbit" id="144982" data-post-id="144982">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="benwilson512" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/benwilson512/120/1457_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  benwilson512
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Author of Craft GraphQL APIs in Elixir with Absinthe</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>So, I dug into this, and when I did so I realized there’s a huge difference between the settings being used between pg bench and Ecto. The number of threads used for pgbench is NOT the same thing as the parallelism used in parallel bench.</p>
<h2><a name="p-144982-threads-1" class="anchor" href="#p-144982-threads-1" aria-label="Heading link" rel="nofollow"></a>Threads</h2>
<p>Notably, the following section is BEFORE introducing pg_notify</p>
<p>From the pgbench docs:</p>
<blockquote>
<p>Number of worker threads within pgbench. Using more than one thread can be helpful on multi-CPU machines. Clients are distributed as evenly as possible among available threads. Default is 1.</p>
</blockquote>
<p>This is more akin to the number of BEAM schedulers. It’s the <code>-c</code> Client Count that is the true “parallelism” (which really ought to be called concurrency). Here’s why this matters: The settings for <code>pghr</code> that I downloaded had a pool size of 40, but only a parallelism of 10. This means there are 30 connections just sitting idle at any given time since there are only 10 processes doing work.</p>
<p>Improving the <code>iterations_in_checkout</code> value up to 1000 also makes a big difference. On my computer ecto with these changes is now 87% as fast as pg bench, which is pretty good in my books given that we haven’t really started micro-optimizing the loops or the mechanism we use to check for time.</p>
<h2><a name="p-144982-randomness-2" class="anchor" href="#p-144982-randomness-2" aria-label="Heading link" rel="nofollow"></a>Randomness</h2>
<p>Here you’re using randomness just to make sure that a unique value is entered every time, it doesn’t need to be random in a secure sense. I wanted to make sure that differences in randomness didn’t slow Elixir down, while also keeping things fair. The first thing I did was change the Elixir random value to <code>:erlang.unique_integer([:positive])</code>. This actually had a decent impact, getting me to within ~90% of pgbench. At this point though I wanted to make sure that pgbench wasn’t being slowed down by randomness, so I added a <code>create_item_fast_seq</code> which used a sequence to generate incrementally higher values. This actually slowed pgbench down a fair bit, which makes sense given the additional disk IO.</p>
<h2><a name="p-144982-pg_notify-3" class="anchor" href="#p-144982-pg_notify-3" aria-label="Heading link" rel="nofollow"></a>Pg_notify</h2>
<p>Here’s why all of this preliminary stuff was important: If you have the same number of parallelism and client values between ecto and pgbench, the performance penalty of pg_notify is the same. Both drop by a factor of ~3+. I’ve got a PR up with the changes I made so you can confirm.</p>
<p>BUT SURPRISE: it isn’t entirely <code>pg_notify</code>’s fault. If you change <code>PERFORM pg_notify</code> to <code>EXECUTE 'SELECT 1'</code> you still lose 40% throughput just from running the trigger.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="144982" data-batch-url="/posts/batch_likers">
                        8
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/looking-for-help-with-poor-ecto-query-performance/25476/79">Post #78</a>
	                </div>
	            </div>
              <div id="likers-container-144982" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="144982"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #78"></div>
  </section>
</div>
    <div class="postbit" id="144988" data-post-id="144988">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dimitarvp" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/120/38664_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dimitarvp
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>If you are willing, could you please make a PR and link it here? Really curious to see your changes.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="144988" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/looking-for-help-with-poor-ecto-query-performance/25476/80">Post #79</a>
	                </div>
	            </div>
              <div id="likers-container-144988" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="144988"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #79"></div>
  </section>
</div>
    <div class="postbit" id="145002" data-post-id="145002">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="scouten" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/scouten/120/2055_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  scouten
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Ben did post a PR last night (<a href="https://github.com/scouten/pghr/pull/17" class="inline-onebox" rel="noopener nofollow ugc">more correct concurrency by benwilson512 · Pull Request #17 · scouten-archive/pghr · GitHub</a>). I’m reading through it now. There were a few distinct changes he’s proposing and I’m thinking about splitting them apart and layering them in separately so we can assess each one independently.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="145002" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/looking-for-help-with-poor-ecto-query-performance/25476/81">Post #80</a>
	                </div>
	            </div>
              <div id="likers-container-145002" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="145002"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #80"></div>
  </section>
</div>
    <div class="postbit" id="145010" data-post-id="145010">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kip" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kip/120/1440_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kip
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ex_cldr Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Really enjoying this thread (and I suspect I’m one of many lurkers).  Thank to you all for digging into this.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="145010" data-batch-url="/posts/batch_likers">
                        6
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/looking-for-help-with-poor-ecto-query-performance/25476/82">Post #81</a>
	                </div>
	            </div>
              <div id="likers-container-145010" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="145010"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #81"></div>
  </section>
</div>
    <div class="postbit" id="145014" data-post-id="145014">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="scouten" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/scouten/120/2055_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  scouten
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Update (probably last one until Monday or Tuesday as I’ll be traveling in places with limited Internet access):</p>
<p>I’ve worked in all of <a class="mention" href="/u/benwilson512" rel="nofollow">@benwilson512</a>’s feedback and I’m really happy with where we’ve landed. Please see the new README in the pghr repo (<a href="https://github.com/scouten/pghr#results" class="inline-onebox" rel="noopener nofollow ugc">GitHub - scouten-archive/pghr: Q&amp;D demo of PG perf issues · GitHub</a>). tl;dr:</p>
<ul>
<li>Ecto performance is between 87% and 107% <img src="https://forum.elixirforum.com/images/emoji/apple/rocket.png?v=15" title=":rocket:" class="emoji" alt=":rocket:" loading="lazy" width="20" height="20">  of <code>pg_bench</code> write throughput on apples-to-apples comparison of the two systems.</li>
<li><code>pg_notify</code> clearly adversely impacts perf. My team has decided on an approach that doesn’t rely on <code>pg_notify</code> and we have a good idea of the perf we can expect once that work is complete. And that we will be satisfied with that result.</li>
</ul>
<p>Thank you, everyone, who has participated in this effort. It’s one of the things that makes Elixir a great platform to build upon.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="145014" data-batch-url="/posts/batch_likers">
                        7
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/looking-for-help-with-poor-ecto-query-performance/25476/83">Post #82</a>
	                </div>
	            </div>
              <div id="likers-container-145014" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="145014"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #82"></div>
  </section>
</div>
    <div class="postbit" id="145015" data-post-id="145015">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="scouten" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/scouten/120/2055_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  scouten
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>FYI everything that I’ve been working with is now merged into the <code>pghr</code> (short for Postgres hot rod <img src="https://forum.elixirforum.com/images/emoji/apple/wink.png?v=15" title=":wink:" class="emoji" alt=":wink:" loading="lazy" width="20" height="20"> ) repo so you can check methods and results.</p>
<p>This includes all of Ben’s suggestions, except for the use of sequence in the <code>pg_bench</code> create test, which did not appear to help performance. (See PR <span class="hashtag-raw">#22</span> in that repo, which was not merged.)</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="145015" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/looking-for-help-with-poor-ecto-query-performance/25476/84">Post #83</a>
	                </div>
	            </div>
              <div id="likers-container-145015" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="145015"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #83"></div>
  </section>
</div>
    <div class="postbit" id="145020" data-post-id="145020">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dimitarvp" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/120/38664_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dimitarvp
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’ll post a 3rd round of tests on my MBP 2015 and iMac Pro pretty <strong><em>Soon™</em></strong> as well.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="145020" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/looking-for-help-with-poor-ecto-query-performance/25476/85">Post #84</a>
	                </div>
	            </div>
              <div id="likers-container-145020" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="145020"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #84"></div>
  </section>
</div>
    <div class="postbit" id="145130" data-post-id="145130">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dimitarvp" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/120/38664_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dimitarvp
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>3rd round of tests. Notes:</p>
<ul>
<li>At GIT commit <code>1b77536cd2214e23b3a045529e9cc4038332bc0c</code>.</li>
<li>Added my Manjaro i3-3217U spare laptop that I turn on like five times a year.</li>
<li>Changed Erlang to <code>22.1.1</code>. Elixir is unchanged and at <code>1.9.1-otp-22</code>.</li>
<li>All tests are at 30s now so no point in the “duration” column.</li>
<li>All machines use SSDs, no HDDs involved.</li>
</ul>
<p>Results:</p>
<hr>
<div class="md-table">
<table>
<thead>
<tr>
<th>CPU (cores/threads)</th>
<th>Test</th>
<th>IPS</th>
</tr>
</thead>
<tbody>
<tr>
<td>Xeon-2150B, 10/20</td>
<td>Elixir create</td>
<td>13780</td>
</tr>
<tr>
<td>Xeon-2150B, 10/20</td>
<td>pgbench create</td>
<td>14768</td>
</tr>
<tr>
<td>Xeon-2150B, 10/20</td>
<td>Elixir update</td>
<td>14360</td>
</tr>
<tr>
<td>Xeon-2150B, 10/20</td>
<td>pgbench update</td>
<td>14563</td>
</tr>
<tr>
<td>i7-4870HQ, 4/8</td>
<td>Elixir create</td>
<td>17746</td>
</tr>
<tr>
<td>i7-4870HQ, 4/8</td>
<td>pgbench create</td>
<td>26338</td>
</tr>
<tr>
<td>i7-4870HQ, 4/8</td>
<td>Elixir update</td>
<td>22624</td>
</tr>
<tr>
<td>i7-4870HQ, 4/8</td>
<td>pgbench update</td>
<td>30569</td>
</tr>
<tr>
<td>i3-3217U, 2/4</td>
<td>Elixir create</td>
<td>194</td>
</tr>
<tr>
<td>i3-3217U, 2/4</td>
<td>pgbench create</td>
<td>191</td>
</tr>
<tr>
<td>i3-3217U, 2/4</td>
<td>Elixir update</td>
<td>198</td>
</tr>
<tr>
<td>i3-3217U, 2/4</td>
<td>pgbench update</td>
<td>190</td>
</tr>
</tbody>
</table>
</div><p>These results are surprising to say the least. I can’t explain why the iMac Pro did so bad. I have various system monitors installed and Postgres couldn’t even go beyond ~127MB/s write throughput (and I know it has peaked at 1.6GB/s write speed when doing <code>pg_restore</code>). So something is severely under-utilised under this test.</p>
<p>Additionally: 6 out of the 10 cores were very moderately used: about 35-40%, another 2 were at about 15%, and the final 2 weren’t used at all.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="145130" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/looking-for-help-with-poor-ecto-query-performance/25476/86">Post #85</a>
	                </div>
	            </div>
              <div id="likers-container-145130" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="145130"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #85"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/25476/load_more?page=9">Load more posts (2 remaining)</a>
</div></template></turbo-stream>