Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Let me use a metaphor: if you want to buy a <strong>golden necklace</strong> in Paris, the goldsmith could sit in Cape Town or Paris, that is a matter of skill and taste. But you would <em>never</em> ship tons of gold ore from South Africa to France for that. The ore is processed at the mining site (or at least in the general area), only the gold gets shipped. The same should be true for apps and databases.</p> <p>As far as <strong>PostgreSQL</strong> is concerned, you can do almost anything on the server, quite efficiently. The RDBMS excels at complex queries. For procedural needs you can choose from a variety of <a href="http://www.postgresql.org/docs/current/static/server-programming.html" rel="nofollow noreferrer">server-side script languages</a>: tcl, python, perl and many more. Mostly I use <a href="http://www.postgresql.org/docs/current/static/plpgsql.html" rel="nofollow noreferrer">PL/pgSQL</a>, though.</p> <p><strong>Worst case</strong> scenario would be to repeatedly go to the server for every single row of a larger set. (That would be like shipping one ton of ore a time.)</p> <p><strong>Second in line</strong>, if you send a cascade of queries, each depending on the one before, while all of it could be done in one query or procedure on the server. (That's like shipping the gold, and each of the jewels with a separate ship, sequentially.)</p> <p>Going back and forth between app and server is expensive. For server <em>and</em> client. Try to cut down on that, and you will win - ergo: use server side procedures and / or sophisticated SQL where necessary.</p> <p>We just finished a project where we packed almost all complex queries into Postgres functions. The app hands over parameters and gets the datasets it needs. Fast, clean, simple (for the app developer), I/O reduced to a minimum ... a shiny necklace with a low carbon footprint.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload