{"id":30900,"date":"2019-10-31T21:38:02","date_gmt":"2019-10-31T18:38:02","guid":{"rendered":"https:\/\/prohoster.info\/blog\/parallelnye-zaprosy-v-postgresql\/"},"modified":"2019-10-31T21:38:02","modified_gmt":"2019-10-31T18:38:02","slug":"parallelnye-zaprosy-v-postgresql","status":"publish","type":"post","link":"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/parallelnye-zaprosy-v-postgresql","title":{"rendered":"K\u00ebrkesa paralele n\u00eb PostgreSQL","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p><img decoding=\"async\" alt=\"K\u00ebrkesa paralele n\u00eb PostgreSQL\" src=\"\/wp-content\/uploads\/2019\/04\/bbb4b4d3f8714bbdb9b26ada2f2253b5.jpg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\nN\u00eb procesor\u00ebt modern\u00eb ka shum\u00eb b\u00ebrthama. P\u00ebr vite me radh\u00eb, aplikacionet d\u00ebrguan k\u00ebrkesa n\u00eb bazat e t\u00eb dh\u00ebnave n\u00eb m\u00ebnyr\u00eb paralel. N\u00ebse kjo \u00ebsht\u00eb nj\u00eb k\u00ebrkes\u00eb raportuese p\u00ebr shum\u00eb rreshta n\u00eb nj\u00eb tabel\u00eb, ajo ekzekutohet m\u00eb shpejt kur angazhohen disa procesor\u00eb, dhe n\u00eb PostgreSQL kjo \u00ebsht\u00eb e mundur, q\u00eb nga versioni 9.6.<\/p>\n<p><\/p>\n<p>M\u00eb mori 3 vjet p\u00ebr t\u00eb zbatuar funksionin e k\u00ebrkesave paralel \u2014 duhej t\u00eb ri-shtypeshin kodet n\u00eb faza t\u00eb ndryshme t\u00eb ekzekutimit t\u00eb k\u00ebrkesave. N\u00eb PostgreSQL 9.6 u shfaq infrastruktura p\u00ebr p\u00ebrmir\u00ebsimin e m\u00ebtejsh\u00ebm t\u00eb kodit. N\u00eb versionet pasuese, edhe lloje t\u00eb tjera t\u00eb k\u00ebrkesave ekzekutohen paralelisht.<\/p>\n<p><noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><\/p>\n<h3 id=\"ogranicheniya\">Kufizimet<\/h3>\n<p><\/p>\n<ul>\n<li>Mos aktivizoni ekzekutimin paralel n\u00ebse t\u00eb gjith\u00eb b\u00ebrthamat jan\u00eb t\u00eb angazhuara, p\u00ebrndryshe k\u00ebrkesat e tjera do t\u00eb ngadal\u00ebsohen.<\/li>\n<li>E r\u00ebnd\u00ebsishme, p\u00ebrpunimi paralel me vlera t\u00eb larta WORK_MEM angazhon shum\u00eb memorie \u2014 \u00e7do lidhje hash ose rregullim merr memorie p\u00ebr sa \u00ebsht\u00eb work_mem.<\/li>\n<li>K\u00ebrkesat OLTP me vones\u00eb t\u00eb ul\u00ebt nuk mund t\u00eb shpejtohen me ekzekutimin paralel. Dhe n\u00ebse k\u00ebrkesa kthen nj\u00eb rresht, p\u00ebrpunimi paralel vet\u00ebm e ngadal\u00ebson at\u00eb.<\/li>\n<li>Developer\u00ebt e duan t\u00eb p\u00ebrdorin benchmark-un TPC-H. Ndoshta keni k\u00ebrkesa t\u00eb ngjashme p\u00ebr ekzekutimin ideal paralel.<\/li>\n<li>Vet\u00ebm k\u00ebrkesat SELECT pa bllokimin e predikates ekzekutohen paralelisht.<\/li>\n<li>Nganj\u00ebher\u00eb indeksimi i duhur \u00ebsht\u00eb m\u00eb i mir\u00eb se skanimi sekondar i tabel\u00ebs n\u00eb m\u00ebnyr\u00eb paralel.<\/li>\n<li>Pauzat e k\u00ebrkesave dhe kursor\u00ebt nuk mb\u00ebshteten.<\/li>\n<li>Funksionet e dritareve dhe funksionet agregate t\u00eb grupeve t\u00eb renditshme nuk jan\u00eb paralel.<\/li>\n<li>Nuk fitoni asgj\u00eb n\u00eb ngarkes\u00ebn e hyrjes-daljes.<\/li>\n<li>Nuk ka algoritme paralel p\u00ebr renditje. Megjithat\u00eb, k\u00ebrkesat me renditje mund t\u00eb ekzekutohen paralelisht n\u00eb disa aspekte.<\/li>\n<li>Z\u00ebvend\u00ebsoni CTE (ME ... ) me nj\u00eb SELECT t\u00eb zhytur p\u00ebr t\u00eb p\u00ebrfshir\u00eb p\u00ebrpunimin paralel.<\/li>\n<li>Mb\u00ebshtetjet e t\u00eb dh\u00ebnave nga t\u00eb tret\u00ebt p\u00ebr momentin nuk mb\u00ebshtesin p\u00ebrpunimin paralel (por mund t\u00eb ishin!)<\/li>\n<li>FULL OUTER JOIN nuk mb\u00ebshtetet.<\/li>\n<li>max_rows \u00e7aktivizon p\u00ebrpunimin paralel.<\/li>\n<li>N\u00ebse n\u00eb k\u00ebrkes\u00eb ka nj\u00eb funksion q\u00eb nuk \u00ebsht\u00eb e markuar si PARALLEL SAFE, ajo do t\u00eb jet\u00eb nj\u00eb proces i vet\u00ebm.<\/li>\n<li>Niveli i izolimit t\u00eb trasaksioneve SERIALIZABLE \u00e7aktivizon p\u00ebrpunimin paralel.<\/li>\n<\/ul>\n<p><\/p>\n<h3 id=\"testovaya-sreda\">Mjedisi i testimit<\/h3>\n<p><\/p>\n<p>Developer\u00ebt e PostgreSQL p\u00ebrpiqeshin t\u00eb shkurtonin koh\u00ebn e p\u00ebrgjigjeve t\u00eb k\u00ebrkesave t\u00eb benchmark-ut TPC-H. Shkarkoni benchmark-un dhe <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/tvondra\/pg_tpch\">p\u00ebrshtateni at\u00eb me PostgreSQL<\/a><\/noindex>. Ky \u00ebsht\u00eb nj\u00eb p\u00ebrdorim jozyrtar i benchmark-ut TPC-H \u2014 jo p\u00ebr krahasimin e bazave t\u00eb t\u00eb dh\u00ebnave ose pajisjeve.<\/p>\n<p><\/p>\n<ol>\n<li>Shkarkoni TPC-H_Tools_v2.17.3.zip (ose nj\u00eb version m\u00eb t\u00eb ri) <noindex><a rel=\"nofollow\" href=\"http:\/\/www.tpc.org\/tpc_documents_current_versions\/current_specifications.asp\">nga faqja zyrtare TPC<\/a><\/noindex>.<\/li>\n<li>Rinovoni makefile.suite n\u00eb Makefile dhe ndryshoni si\u00e7 p\u00ebrshkruhet k\u00ebtu: <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/tvondra\/pg_tpch\">https:\/\/github.com\/tvondra\/pg_tpch <\/a><\/noindex>. Kompilon kodi me komand\u00ebn make.<\/li>\n<li>Gjeneroni t\u00eb dh\u00ebnat: <code>.\\\/dbgen -s 10<\/code> krijon nj\u00eb baz\u00eb t\u00eb dh\u00ebnash prej 23 GB. Kjo \u00ebsht\u00eb e mjaftueshme p\u00ebr t\u00eb par\u00eb diferenc\u00ebn n\u00eb performanc\u00ebn e pyetjeve paralel dhe jo paralel.<\/li>\n<li>Konvertoni skedar\u00ebt <code>tbl<\/code> n\u00eb <code>csv me for<\/code> dhe <code>sed<\/code>.<\/li>\n<li>Kloni depozita <code>pg_tpch<\/code> dhe kopjoni skedar\u00ebt <code>csv<\/code> n\u00eb <code>pg_tpch\\\/dss\\\/data<\/code>.<\/li>\n<li>Krijoni pyetje me komand\u00ebn <code>qgen<\/code>.<\/li>\n<li>Ngarkoni t\u00eb dh\u00ebnat n\u00eb baz\u00eb me komand\u00ebn <code>.\\\/tpch.sh<\/code>.<\/li>\n<\/ol>\n<p><\/p>\n<h3 id=\"parallelnoe-posledovatelnoe-skanirovanie\">Skandimi paralel sekuencial<\/h3>\n<p><\/p>\n<p>Ai mund t\u00eb jet\u00eb m\u00eb i shpejt\u00eb jo p\u00ebr shkak t\u00eb leximit paralel, por sepse t\u00eb dh\u00ebnat jan\u00eb shp\u00ebrndar\u00eb mbi shum\u00eb b\u00ebrthama CPU. N\u00eb sistemet operative moderne, skedar\u00ebt e t\u00eb dh\u00ebnave PostgreSQL keq m\u00ebsohen mir\u00eb. Me leximin parashikues, mund t\u00eb merrni nga magazina nj\u00eb bllok m\u00eb t\u00eb madh se sa k\u00ebrkon demon PG. Prandaj performanca e pyetjeve nuk pengohet nga I\/O-i i diskut. Ai konsumon cikle CPU p\u00ebr t\u00eb:<\/p>\n<p><\/p>\n<ul>\n<li>lexuar rreshta nj\u00eb nga nj\u00eb nga faqet e tabel\u00ebs;<\/li>\n<li>krahasuar vlerat e rreshtave dhe kushtet <code>KU<\/code>.<\/li>\n<\/ul>\n<p><\/p>\n<p>Le t\u00eb ekzekutojm\u00eb nj\u00eb pyetje t\u00eb thjesht\u00eb <code>select<\/code>:<\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">tpch=# shpjegoni analiz\u00ebn e zgjedhjes l_quantity si sum_qty nga lineitem ku l_shipdate &lt;= data '1998-12-01' - interval '105' dit\u00eb;\\nPLAN I PYETJES\\n--------------------------------------------------------------------------------------------------------------------------\\nSkanim Sekuencial mbi lineitem (kosto=0.00..1964772.00 rreshta=58856235 gjer\u00ebsi=5) (koha reale=0.014..16951.669 rreshta=58839715 loops=1)\\nFiltri: (l_shipdate &lt;= '1998-08-18 00:00:00'::timestamp pa zon\u00eb kohe)\\nRreshtat e hequr nga Filtri: 1146337\\nKoha e Planifikimit: 0.203 ms\\nKoha e Ekzekutimit: 19035.100 ms<\/code><\/pre>\n<p><\/p>\n<p>Skandimi sekuencial jep shum\u00eb rreshta pa agregim, k\u00ebshtu q\u00eb pyetja ekzekutohet nga nj\u00eb b\u00ebrtham\u00eb CPU.<\/p>\n<p><\/p>\n<p>N\u00ebse shtojm\u00eb <code>SUM()<\/code>, duket se dy procesor\u00eb do t\u00eb ndihmojn\u00eb p\u00ebr t\u00eb p\u00ebrshpejtuar pyetjen:<\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">shpjegoni analiz\u00ebn e zgjedhjes sum(l_quantity) si sum_qty nga lineitem ku l_shipdate &lt;= data '1998-12-01' - interval '105' dit\u00eb;\\nPLAN I PYETJES\\n----------------------------------------------------------------------------------------------------------------------------------------------------\\nP\u00ebrfundoni Agregat (kosto=1589702.14..1589702.15 rreshta=1 gjer\u00ebsi=32) (koha reale=8553.365..8553.365 rreshta=1 loops=1)\\n-&gt; Grumbullo (kosto=1589701.91..1589702.12 rreshta=2 gjer\u00ebsi=32) (koha reale=8553.241..8555.067 rreshta=3 loops=1)\\nPunonj\u00ebs t\u00eb Planifikuar: 2\\nPunonj\u00ebs t\u00eb L\u00ebshuar: 2\\n-&gt; Agregat i Pjes\u00ebs (kosto=1588701.91..1588701.92 rreshta=1 gjer\u00ebsi=32) (koha reale=8547.546..8547.546 rreshta=1 loops=3)\\n-&gt; Skanim Paralel Sekuencial mbi lineitem (kosto=0.00..1527393.33 rreshta=24523431 gjer\u00ebsi=5) (koha reale=0.038..5998.417 rreshta=19613238 loops=3)\\nFiltri: (l_shipdate &lt;= '1998-08-18 00:00:00'::timestamp pa zon\u00eb kohe)\\nRreshtat e hequr nga Filtri: 382112\\nKoha e Planifikimit: 0.241 ms\\nKoha e Ekzekutimit: 8555.131 ms<\/code><\/pre>\n<p><\/p>\n<h3 id=\"parallelnaya-agregaciya\">Agregimi Paralel<\/h3>\n<p><\/p>\n<p>\u041d\u043e\u0434\u0430 &#171;Parallel Seq Scan&#187; \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u0441\u0442\u0440\u043e\u043a\u0438 \u0434\u043b\u044f \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e\u0439 \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u0438. \u041d\u043e\u0434\u0430 &#171;Partial Aggregate&#187; \u0443\u0440\u0435\u0437\u0430\u0435\u0442 \u044d\u0442\u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>SUM()<\/code>. \u0412 \u043a\u043e\u043d\u0446\u0435 \u0441\u0447\u0435\u0442\u0447\u0438\u043a SUM \u0438\u0437 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043d\u043e\u0434\u043e\u0439 &#171;Gather&#187;.<\/p>\n<p><\/p>\n<p>\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u043e\u0434\u043e\u0439 &#171;Finalize Aggregate&#187;. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0441\u0432\u043e\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u0438, \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u043f\u043e\u043c\u0435\u0442\u0438\u0442\u044c \u0438\u0445 \u043a\u0430\u043a &#171;parallel safe&#187;.<\/p>\n<p><\/p>\n<h3 id=\"kolichestvo-rabochih-processov\">Numri i proceseve punuese<\/h3>\n<p><\/p>\n<p>Numri i proceseve punuese mund t\u00eb rritet pa rinisjen e serverit:<\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">shpjegoni analiz\u00ebn e zgjedhjes sum(l_quantity) si sum_qty nga lineitem ku l_shipdate &lt;= data '1998-12-01' - interval '105' dit\u00eb;\\nPLAN I PYETJES\\n----------------------------------------------------------------------------------------------------------------------------------------------------\\nP\u00ebrfundoni Agregat (kosto=1589702.14..1589702.15 rreshta=1 gjer\u00ebsi=32) (koha reale=8553.365..8553.365 rreshta=1 loops=1)\\n-&gt; Grumbullo (kosto=1589701.91..1589702.12 rreshta=2 gjer\u00ebsi=32) (koha reale=8553.241..8555.067 rreshta=3 loops=1)\\nPunonj\u00ebs t\u00eb Planifikuar: 2\\nPunonj\u00ebs t\u00eb L\u00ebshuar: 2\\n-&gt; Agregat i Pjes\u00ebs (kosto=1588701.91..1588701.92 rreshta=1 gjer\u00ebsi=32) (koha reale=8547.546..8547.546 rreshta=1 loops=3)\\n-&gt; Skanim Paralel Sekuencial mbi lineitem (kosto=0.00..1527393.33 rreshta=24523431 gjer\u00ebsi=5) (koha reale=0.038..5998.417 rreshta=19613238 loops=3)\\nFiltri: (l_shipdate &lt;= '1998-08-18 00:00:00'::timestamp pa zon\u00eb kohe)\\nRreshtat e hequr nga Filtri: 382112\\nKoha e Planifikimit: 0.241 ms\\nKoha e Ekzekutimit: 8555.131 ms<\/code><\/pre>\n<p><\/p>\n<p>\u00c7far\u00eb po ndodh k\u00ebtu? Numri i proceseve punuese \u00ebsht\u00eb dyfishuar, nd\u00ebrsa k\u00ebrkesa u b\u00eb vet\u00ebm 1,6599 her\u00eb m\u00eb e shpejt\u00eb. Llogarit\u00eb jan\u00eb interesante. Kishim 2 procese punuese dhe 1 lider. Pas ndryshimit, u b\u00eb 4+1.<\/p>\n<p><\/p>\n<p>Shpejt\u00ebsia jon\u00eb maksimale nga p\u00ebrpunimi paralel: 5\/3 = 1,66(6) her\u00eb.<\/p>\n<p><\/p>\n<h2 id=\"kak-eto-rabotaet\">Si funksionon kjo?<\/h2>\n<p><\/p>\n<h3 id=\"processy\">Proceset<\/h3>\n<p><\/p>\n<p>Ekzekutimi i k\u00ebrkes\u00ebs gjithmon\u00eb fillon me procesin lider. Lideri b\u00ebn t\u00eb gjitha p\u00ebrpunimet jo-paralel dhe nj\u00eb pjes\u00eb t\u00eb p\u00ebrpunimit paralel. Proceset e tjera, q\u00eb kryejn\u00eb t\u00eb nj\u00ebjtat k\u00ebrkesa, quhen procese punuese. P\u00ebrpunimi paralel p\u00ebrdor infrastruktur\u00ebn <noindex><a rel=\"nofollow\" href=\"https:\/\/www.postgresql.org\/docs\/11\/bgworker.html\">e proceseve punuese dinamike n\u00eb sfond<\/a><\/noindex> (nga versioni 9.4). Nd\u00ebrsa pjes\u00ebt e tjera t\u00eb PostgreSQL p\u00ebrdorin procese dhe jo fije, nj\u00eb k\u00ebrkes\u00eb me 3 procese punuese mund t\u00eb jet\u00eb 4 her\u00eb m\u00eb e shpejt\u00eb se p\u00ebrpunimi tradicional.<\/p>\n<p><\/p>\n<h3 id=\"vzaimodeystvie\">Nd\u00ebrveprimi<\/h3>\n<p><\/p>\n<p>Proceset punuese komunikojn\u00eb me liderin p\u00ebrmes nj\u00eb sistemi mesazhesh (p\u00ebr baz\u00eb t\u00eb memories s\u00eb p\u00ebrbashk\u00ebt). \u00c7do proces ka 2 skeda: p\u00ebr gabimet dhe p\u00ebr tuple.<\/p>\n<p><\/p>\n<h3 id=\"skolko-nuzhno-rabochih-processov\">Sa procese punuese nevojiten?<\/h3>\n<p><\/p>\n<p>Kufiri minimal vendoset nga parametri <noindex><a rel=\"nofollow\" href=\"https:\/\/www.postgresql.org\/docs\/11\/runtime-config-resource.html#GUC-MAX-PARALLEL-WORKERS-PER-GATHER\"><code>max_parallel_workers_per_gather<\/code><\/a><\/noindex>. Pastaj ekzekutori i k\u00ebrkesave merr proceset punuese nga rezervuari, i kufizuar nga parametri <noindex><a rel=\"nofollow\" href=\"https:\/\/www.postgresql.org\/docs\/11\/runtime-config-resource.html#GUC-MAX-WORKER-PROCESSES\"><code>max_parallel_workers size<\/code><\/a><\/noindex>. Kufiri i fundit \u00ebsht\u00eb <noindex><a rel=\"nofollow\" href=\"https:\/\/www.postgresql.org\/docs\/11\/runtime-config-resource.html#GUC-MAX-WORKER-PROCESSES\"><code>max_worker_processes<\/code><\/a><\/noindex>, dometh\u00ebn\u00eb numri total i proceseve n\u00eb sfond.<\/p>\n<p><\/p>\n<p>N\u00ebse nuk arrihet t\u00eb alokoni nj\u00eb proces punues, p\u00ebrpunimi do t\u00eb jet\u00eb me proces t\u00eb vet\u00ebm.<\/p>\n<p><\/p>\n<p>Planifikuesi i k\u00ebrkesave mund t\u00eb reduktoj\u00eb proceset punuese n\u00eb var\u00ebsi t\u00eb madh\u00ebsis\u00eb s\u00eb tabel\u00ebs ose indekseve. P\u00ebr k\u00ebt\u00eb ka parametra <noindex><a rel=\"nofollow\" href=\"https:\/\/www.postgresql.org\/docs\/current\/runtime-config-query.html#GUC-MIN-PARALLEL-TABLE-SCAN-SIZE\"><code>min_parallel_table_scan_size<\/code><\/a><\/noindex> dhe <noindex><a rel=\"nofollow\" href=\"https:\/\/www.postgresql.org\/docs\/current\/runtime-config-query.html#GUC-MIN-PARALLEL-INDEX-SCAN-SIZE\"><code>min_parallel_index_scan_size<\/code><\/a><\/noindex>.<\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">set min_parallel_table_scan_size='8MB' 8MB tabel\u00eb =&gt; 1 punues 24MB tabel\u00eb =&gt; 2 punues 72MB tabel\u00eb =&gt; 3 punues x =&gt; log(x \/ min_parallel_table_scan_size) \/ log(3) + 1 punues<\/code><\/pre>\n<p><\/p>\n<p>\u00c7do her\u00eb q\u00eb tabela \u00ebsht\u00eb 3 her\u00eb m\u00eb e madhe se <code>min_parallel_(index|table)_scan_size<\/code>, Postgres shton nj\u00eb proces punues. Numri i proceseve punuese nuk bazohet n\u00eb kosto. Var\u00ebsia ciklike e v\u00ebshtir\u00ebson realizimet e komplikuara. N\u00eb vend t\u00eb k\u00ebsaj, planifikuesi p\u00ebrdor rregulla t\u00eb thjeshta.<\/p>\n<p><\/p>\n<p>N\u00eb praktik\u00eb, k\u00ebto rregulla nuk jan\u00eb gjithmon\u00eb t\u00eb p\u00ebrshtatshme p\u00ebr prodhim, k\u00ebshtu q\u00eb mund t\u00eb ndryshoni numrin e proceseve punuese p\u00ebr nj\u00eb tabel\u00eb t\u00eb caktuar: ALTER TABLE \u2026 SET (<code>parallel_workers = N<\/code>).<\/p>\n<p><\/p>\n<h3 id=\"pochemu-parallelnaya-obrabotka-ne-ispolzuetsya\">Pse nuk p\u00ebrdoret p\u00ebrpunimi paralel?<\/h3>\n<p><\/p>\n<p>P\u00ebrve\u00e7 list\u00ebs s\u00eb gjat\u00eb t\u00eb kufizimeve, ka edhe verifikime t\u00eb shpenzimeve:<\/p>\n<p><\/p>\n<p><noindex><a rel=\"nofollow\" href=\"https:\/\/www.postgresql.org\/docs\/current\/runtime-config-query.html#GUC-PARALLEL-SETUP-COST\"><code>parallel_setup_cost<\/code><\/a><\/noindex> \u2014 p\u00ebr t\u00eb shmangur p\u00ebrpunimin paralel t\u00eb k\u00ebrkesave t\u00eb shkurtra. Ky paramet\u00ebr vler\u00ebson koh\u00ebn p\u00ebr p\u00ebrgatitjen e memorjes, fillimin e procesit dhe shk\u00ebmbimin fillestar t\u00eb t\u00eb dh\u00ebnave.<\/p>\n<p><\/p>\n<p><noindex><a rel=\"nofollow\" href=\"https:\/\/www.postgresql.org\/docs\/current\/runtime-config-query.html#GUC-PARALLEL-TUPLE-COST\"><code>parallel_tuple_cost<\/code><\/a><\/noindex>: komunikimi i liderit me punonj\u00ebsit mund t\u00eb zgjas\u00eb proporcionalisht me numrin e tuple-ve nga proceset punuese. Ky paramet\u00ebr llogarit shpenzimet p\u00ebr shk\u00ebmbimin e t\u00eb dh\u00ebnave.<\/p>\n<p><\/p>\n<h3 id=\"soedineniya-vlozhennyh-ciklov--nested-loop-join\">Bashkimet e cikleve t\u00eb thella \u2014 Nested Loop Join<\/h3>\n<p><\/p>\n<pre><code class=\"plaintext\">PostgreSQL 9.6+ \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0446\u0438\u043a\u043b\u044b \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f.\n\nexplain (costs off) select c_custkey, count(o_orderkey)\n                from    customer left outer join orders on\n                                c_custkey = o_custkey and o_comment not like '%special%deposits%'\n                group by c_custkey;\n                                      QUERY PLAN\n--------------------------------------------------------------------------------------\n Finalize GroupAggregate\n   Group Key: customer.c_custkey\n   -&gt;  Gather Merge\n         Workers Planned: 4\n         -&gt;  Partial GroupAggregate\n               Group Key: customer.c_custkey\n               -&gt;  Nested Loop Left Join\n                     -&gt;  Parallel Index Only Scan using customer_pkey on customer\n                     -&gt;  Index Scan using idx_orders_custkey on orders\n                           Index Cond: (customer.c_custkey = o_custkey)\n                           Filter: ((o_comment)::text !~~ '%special%deposits%'::text)<\/code><\/pre>\n<p><\/p>\n<p>Grumbullimi ndodh n\u00eb faz\u00ebn e fundit, k\u00ebshtu q\u00eb Nested Loop Left Join \u00ebsht\u00eb nj\u00eb operacion paralel. Skano paralel vet\u00ebm mbi indekso u shfaq vet\u00ebm n\u00eb versionin 10. Ai funksionon n\u00eb m\u00ebnyr\u00eb t\u00eb ngjashme me skanimin paralel t\u00eb rreshtave. Kushti <code>c_custkey = o_custkey<\/code> lexon nj\u00eb porosi p\u00ebr \u00e7do rresht klienti. Pra, ai nuk \u00ebsht\u00eb paralel.<\/p>\n<p><\/p>\n<h3 id=\"hesh-soedinenie--hash-join\">Bashkimi me Hash \u2014 Hash Join<\/h3>\n<p><\/p>\n<p>\u00c7do proces punues krijon tabel\u00ebn e tij t\u00eb hash deri n\u00eb PostgreSQL 11. Dhe n\u00ebse ka m\u00eb shum\u00eb se kat\u00ebr procese, performanca nuk do t\u00eb rritet. N\u00eb versionin e ri, tabela e hash \u00ebsht\u00eb e p\u00ebrbashk\u00ebt. \u00c7do proces punues mund t\u00eb p\u00ebrdor\u00eb WORK_MEM p\u00ebr t\u00eb krijuar tabel\u00ebn e hash.<\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">zgjedh\n        l_shipmode,\n        shum\u00eb(rasti\n                kur o_orderpriority = '1-URGENT'\n                        ose o_orderpriority = '2-HIGH'\n                        at\u00ebher\u00eb 1\n                tjet\u00ebr 0\n        fund) si high_line_count,\n        shum\u00eb(rasti\n                kur o_orderpriority  '1-URGENT'\n                        dhe o_orderpriority  '2-HIGH'\n                        at\u00ebher\u00eb 1\n                tjet\u00ebr 0\n        fund) si low_line_count\nnga\n        porosit\u00eb,\n        linjat\nku\n        o_orderkey = l_orderkey\n        dhe l_shipmode n\u00eb ('MAIL', 'AIR')\n        dhe l_commitdate &lt; l_receiptdate\n        dhe l_shipdate = data '1996-01-01'\n        dhe l_receiptdate &lt; data &#039;1996-01-01&#039; + interval &#039;1&#039; vit\ngrup n\u00eb\n        l_shipmode\nrendit sipas\n        l_shipmode\nLIMIT 1;\n                                                                                                                                    PLAN I K\u00cbRKES\u00cbS\n-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n Limit  (cost=1964755.66..1964961.44 rows=1 width=27) (actual time=7579.592..7922.997 rows=1 loops=1)\n   -&gt;  Finalizo Grupin e Agregat\u00ebve  (cost=1964755.66..1966196.11 rows=7 width=27) (actual time=7579.590..7579.591 rows=1 loops=1)\n         \u00c7el\u00ebsi i Grupit: lineitem.l_shipmode\n         -&gt;  Grumbullo t\u00eb Bashkuara  (cost=1964755.66..1966195.83 rows=28 width=27) (actual time=7559.593..7922.319 rows=6 loops=1)\n               Pun\u00ebtor\u00ebt e Planifikuar: 4\n               Pun\u00ebtor\u00ebt e L\u00ebshuar: 4\n               -&gt;  Grumbullo t\u00eb Pjes\u00ebshme  (cost=1963755.61..1965192.44 rows=7 width=27) (actual time=7548.103..7564.592 rows=2 loops=5)\n                     \u00c7el\u00ebsi i Grupit: lineitem.l_shipmode\n                     -&gt;  Rendit  (cost=1963755.61..1963935.20 rows=71838 width=27) (actual time=7530.280..7539.688 rows=62519 loops=5)\n                           \u00c7el\u00ebsi i Rendit: lineitem.l_shipmode\n                           Metoda e Rendit: shp\u00ebrndarje ekstreme  Disk: 2304kB\n                           Pun\u00ebtor 0:  Metoda e Rendit: shp\u00ebrndarje ekstreme  Disk: 2064kB\n                           Pun\u00ebtor 1:  Metoda e Rendit: shp\u00ebrndarje ekstreme  Disk: 2384kB\n                           Pun\u00ebtor 2:  Metoda e Rendit: shp\u00ebrndarje ekstreme  Disk: 2264kB\n                           Pun\u00ebtor 3:  Metoda e Rendit: shp\u00ebrndarje ekstreme  Disk: 2336kB\n                           -&gt;  Bashkimi i Hashit Paralel  (cost=382571.01..1957960.99 rows=71838 width=27) (actual time=7036.917..7499.692 rows=62519 loops=5)\n                                 Kushti i Hashit: (lineitem.l_orderkey = orders.o_orderkey)\n                                 -&gt;  Skano n\u00ebn grupin Paralel  (cost=0.00..1552386.40 rows=71838 width=19) (actual time=0.583..4901.063 rows=62519 loops=5)\n                                       Filtri: ((l_shipmode = \u00c7DO (&#039;{MAIL,AIR}&#039;::bpchar[])) DHE (l_commitdate &lt; l_receiptdate) DHE (l_shipdate = '1996-01-01'::date) DHE (l_receiptdate &lt; &#039;1997-01-01 00:00:00&#039;::timestamp pa zon\u00eb t\u00eb koh\u00ebs))\n                                       Rreshtat e Hequr nga Filtri: 11934691\n                                 -&gt;  Hash Paralel  (cost=313722.45..313722.45 rows=3750045 width=20) (actual time=2011.518..2011.518 rows=3000000 loops=5)\n                                       Koshat: 65536  Grumbuj: 256  P\u00ebrdorimi i Memoris\u00eb: 3840kB\n                                       -&gt;  Skano n\u00ebn grupin Paralel  (cost=0.00..313722.45 rows=3750045 width=20) (actual time=0.029..995.948 rows=3000000 loops=5)\n Koha e Planifikimit: 0.977 ms\n Koha e Ekzekutimit: 7923.770 ms<\/code><\/pre>\n<p><\/p>\n<p>K\u00ebrkesa 12 nga TPC-H ilustron qart\u00eb bashkimin e hashit paralel. \u00c7do proces punues merr pjes\u00eb n\u00eb krijimin e nj\u00eb tabele t\u00eb p\u00ebrbashk\u00ebt hash.<\/p>\n<p><\/p>\n<h3 id=\"soedinenie-sliyaniem--merge-join\">Lidhja e bashkimit \u2014 Merge Join<\/h3>\n<p><\/p>\n<p>Lidhja e bashkimit \u00ebsht\u00eb natyrisht e pafavorshme p\u00ebr paraleliz\u00ebm. Mos u shqet\u00ebsoni n\u00ebse ky \u00ebsht\u00eb hapi i fundit i pyetjes, ai mund t\u00eb ekzekutohet gjithsesi paralelisht.<\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">-- K&euml;rkesa 2 nga TPC-H\nshpjego (kostot off) zgjidh s_acctbal, s_name, n_name, p_partkey, p_mfgr, s_address, s_phone, s_comment\nnga    part, supplier, partsupp, nation, region\nku\n        p_partkey = ps_partkey\n        dhe s_suppkey = ps_suppkey\n        dhe p_size = 36\n        dhe p_type si &#039;%BRASS&#039;\n        dhe s_nationkey = n_nationkey\n        dhe n_regionkey = r_regionkey\n        dhe r_name = &#039;AMERICA&#039;\n        dhe ps_supplycost = (\n                zgjidh\n                        min(ps_supplycost)\n                nga    partsupp, supplier, nation, region\n                ku\n                        p_partkey = ps_partkey\n                        dhe s_suppkey = ps_suppkey\n                        dhe s_nationkey = n_nationkey\n                        dhe n_regionkey = r_regionkey\n                        dhe r_name = &#039;AMERICA&#039;\n        )\nrendit sipas s_acctbal zbret, n_name, s_name, p_partkey\nKUFIZO 100;\n                                                PLANI I K&Euml;RKES&Euml;S\n----------------------------------------------------------------------------------------------------------\n Limit\n   -&amp;gt;  Rendit\n         &Ccedil;el&euml;si i Rendit: supplier.s_acctbal ZBRET, nation.n_name, supplier.s_name, part.p_partkey\n         -&amp;gt;  Bashkimi i Shkrir&euml;\n               Kusht i Shkrirjes: (part.p_partkey = partsupp.ps_partkey)\n               Filtri i Bashkimit: (partsupp.ps_supplycost = (SubPlani 1))\n               -&amp;gt;  Grumbullimi i Shkrir&euml;\n                     Punonj&euml;sit e Planifikuar: 4\n                     -&amp;gt;  Skano Indeksin Paralel duke p&euml;rdorur &lt;strong&gt;part_pkey&lt;\/strong&gt; n&euml; pjes&euml;\n                           Filtri: (((p_type)::text ~~ &#039;%BRASS&#039;::text) DHE (p_size = 36))\n               -&amp;gt;  Materializo\n                     -&amp;gt;  Rendit\n                           &Ccedil;el&euml;si i Rendit: partsupp.ps_partkey\n                           -&amp;gt;  Rrotullues i Foshnjave\n                                 -&amp;gt;  Rrotullues i Foshnjave\n                                       Filtri i Bashkimit: (nation.n_regionkey = region.r_regionkey)\n                                       -&amp;gt;  Skano Sequentiellement mbi region\n                                             Filtri: (r_name = &#039;AMERICA&#039;::bpchar)\n                                       -&amp;gt;  Bashkimi Hash\n                                             Kushti Hash: (supplier.s_nationkey = nation.n_nationkey)\n                                             -&amp;gt;  Skano Sequentiellement mbi supplier\n                                             -&amp;gt;  Hash\n                                                   -&amp;gt;  Skano Sequentiellement mbi nation\n                                 -&amp;gt;  Skano Indeksin duke p&euml;rdorur idx_partsupp_suppkey mbi partsupp\n                                       Kushti i Indeksit: (ps_suppkey = supplier.s_suppkey)\n               SubPlani 1\n                 -&amp;gt;  Agregat\n                       -&amp;gt;  Rrotullues i Foshnjave\n                             Filtri i Bashkimit: (nation_1.n_regionkey = region_1.r_regionkey)\n                             -&amp;gt;  Skano Sequentiellement mbi region region_1\n                                   Filtri: (r_name = &#039;AMERICA&#039;::bpchar)\n                             -&amp;gt;  Rrotullues i Foshnjave\n                                   -&amp;gt;  Rrotullues i Foshnjave\n                                         -&amp;gt;  Skano Indeksin duke p&euml;rdorur idx_partsupp_partkey mbi partsupp partsupp_1\n                                               Kushti i Indeksit: (part.p_partkey = ps_partkey)\n                                         -&amp;gt;  Skano Indeksin duke p&euml;rdorur supplier_pkey mbi supplier supplier_1\n                                               Kushti i Indeksit: (s_suppkey = partsupp_1.ps_suppkey)\n                                   -&amp;gt;  Skano Indeksin duke p&euml;rdorur nation_pkey mbi nation nation_1\n                                         Kushti i Indeksit: (n_nationkey = supplier_1.s_nationkey)<\/code><\/pre>\n<p><\/p>\n<p>\u041d\u043e\u0434\u0430 &#171;Merge Join&#187; \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430\u0434 &#171;Gather Merge&#187;. \u0422\u0430\u043a \u0447\u0442\u043e \u0441\u043b\u0438\u044f\u043d\u0438\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u0443\u044e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443. \u041d\u043e \u043d\u043e\u0434\u0430 &#171;Parallel Index Scan&#187; \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0441 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u043c <code>part_pkey<\/code>.<\/p>\n<p><\/p>\n<h3 id=\"soedinenie-po-sekciyam\">Lidhja sipas sekcioneve<\/h3>\n<p><\/p>\n<p>N\u00eb PostgreSQL 11 <noindex><a rel=\"nofollow\" href=\"http:\/\/ashutoshpg.blogspot.com\/2017\/12\/partition-wise-joins-divide-and-conquer.html\">lidhja sipas sekcioneve<\/a><\/noindex> \u00ebsht\u00eb e \u00e7aktivizuar si e paracaktuar: ka nj\u00eb planifikim shum\u00eb t\u00eb shtrenjt\u00eb. Tabelat me sekcionim t\u00eb ngjash\u00ebm mund t\u00eb lidhen sekond\u00eb p\u00ebr sekond\u00eb. K\u00ebshtu q\u00eb Postgres do t\u00eb p\u00ebrdor\u00eb tabela hesh t\u00eb vogla. \u00c7do lidhje sekcionesh mund t\u00eb jet\u00eb paralel.<\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">tpch=# vendos enable_partitionwise_join=t;\ntpch=# shpjego (kostot fik\u00ebse) zgjedh * nga prt1 t1, prt2 t2\nku t1.a = t2.b dhe t1.b = 0 dhe t2.b mes 0 dhe 10000;\n                    PLANI I PYETJES\n---------------------------------------------------\n Shtoni\n   -&gt;  Lidhja Hesh\n         Kushti i Heshit: (t2.b = t1.a)\n         -&gt;  Skanoje Sequencialisht n\u00eb prt2_p1 t2\n               Filtri: ((b &gt;= 0) DHE (b &lt;= 10000))\n         -&gt;  Hesh\n               -&gt;  Skanoje Sequencialisht n\u00eb prt1_p1 t1\n                     Filtri: (b = 0)\n   -&gt;  Lidhja Hesh\n         Kushti i Heshit: (t2_1.b = t1_1.a)\n         -&gt;  Skanoje Sequencialisht n\u00eb prt2_p2 t2_1\n               Filtri: ((b &gt;= 0) DHE (b &lt;= 10000))\n         -&gt;  Hesh\n               -&gt;  Skanoje Sequencialisht n\u00eb prt1_p2 t1_1\n                     Filtri: (b = 0)\ntpch=# vendos parallel_setup_cost = 1;\ntpch=# vendos parallel_tuple_cost = 0.01;\ntpch=# shpjego (kostot fik\u00ebse) zgjedh * nga prt1 t1, prt2 t2\nku t1.a = t2.b dhe t1.b = 0 dhe t2.b mes 0 dhe 10000;\n                        PLANI I PYETJES\n-----------------------------------------------------------\n Mbledh\n   Punonj\u00ebsit e planifikuar: 4\n   -&gt;  Shtoni Paralel\n         -&gt;  Lidhja Hesh Paralel\n               Kushti i Heshit: (t2_1.b = t1_1.a)\n               -&gt;  Skanoje Paralel n\u00eb prt2_p2 t2_1\n                     Filtri: ((b &gt;= 0) DHE (b &lt;= 10000))\n               -&gt;  Hesh\n                     -&gt;  Skanoje Paralel n\u00eb prt1_p2 t1_1\n                           Filtri: (b = 0)\n         -&gt;  Lidhja Hesh Paralel\n               Kushti i Heshit: (t2.b = t1.a)\n               -&gt;  Skanoje Paralel n\u00eb prt2_p1 t2\n                     Filtri: ((b &gt;= 0) DHE (b &lt;= 10000))\n               -&gt;  Hesh\n                     -&gt;  Skanoje Paralel n\u00eb prt1_p1 t1\n                           Filtri: (b = 0)<\/code><\/pre>\n<p><\/p>\n<p>E r\u00ebnd\u00ebsishme, lidhja sipas sekcioneve \u00ebsht\u00eb paralel vet\u00ebm n\u00ebse k\u00ebto sekcione jan\u00eb t\u00eb mjaftueshme t\u00eb m\u00ebdha.<\/p>\n<p><\/p>\n<h3 id=\"parallelnoe-dopolnenie--parallel-append\">Shtimi Paralel \u2014 Parallel Append<\/h3>\n<p><\/p>\n<p><noindex><a rel=\"nofollow\" href=\"https:\/\/www.postgresql.org\/docs\/11\/parallel-plans.html#PARALLEL-APPEND\">Shtimi Paralel<\/a><\/noindex> mund t\u00eb p\u00ebrdoret n\u00eb vend t\u00eb blloqeve t\u00eb ndryshme n\u00eb procese t\u00eb ndryshme. Kjo ndodh zakonisht me pyetje UNION ALL. Disavantazhi \u2014 m\u00eb pak paraleliz\u00ebm, pasi \u00e7do proces punonj\u00ebsi p\u00ebrpunon vet\u00ebm 1 pyetje.<\/p>\n<p><\/p>\n<p>K\u00ebtu jan\u00eb nisur 2 proces punonj\u00ebsish, megjith\u00ebse jan\u00eb planifikuar 4.<\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">tpch=# shpjego (costs off) p\u00ebrmbledh (sum) l_quantity as sum_qty nga lineitem ku l_shipdate &lt;= data &#039;1998-12-01&#039; - interval &#039;105&#039; dit\u00eb union all p\u00ebrmbledh (sum) l_quantity as sum_qty nga lineitem ku l_shipdate   Shtim paralel\n         -&gt;  Agregatuar\n               -&gt;  Skanim sekuestrues n\u00eb lineitem\n                     Filtri: (l_shipdate   Agregatuar\n               -&gt;  Skanim sekuestrues n\u00eb lineitem lineitem_1\n                     Filtri: (l_shipdate &lt;= &#039;1998-08-18 00:00:00&#039;::timestamp pa zon\u00eb kohore)<\/code><\/pre>\n<p><\/p>\n<h3 id=\"samye-vazhnye-peremennye\">Variablat m\u00eb t\u00eb r\u00ebnd\u00ebsish\u00ebm<\/h3>\n<p><\/p>\n<ul>\n<li>WORK_MEM kufizon sasin\u00eb e memories p\u00ebr secilin proces, jo vet\u00ebm p\u00ebr k\u00ebrkesat: work_mem <em> proceset <\/em> lidhje = shum\u00eb memoria.<\/li>\n<li><noindex><a rel=\"nofollow\" href=\"https:\/\/www.postgresql.org\/docs\/11\/runtime-config-resource.html#GUC-MAX-PARALLEL-WORKERS-PER-GATHER\"><code>max_parallel_workers_per_gather<\/code><\/a><\/noindex> \u2014 sa procese pune do t\u00eb p\u00ebrdor\u00eb programi p\u00ebr procesimin paralel nga plani.<\/li>\n<li><noindex><a rel=\"nofollow\" href=\"https:\/\/www.postgresql.org\/docs\/11\/runtime-config-resource.html#GUC-MAX-WORKER-PROCESSES\"><code>max_worker_processes<\/code><\/a><\/noindex> \u2014 rregullon numrin total t\u00eb punonj\u00ebsve sipas numrit t\u00eb b\u00ebrthamave t\u00eb CPU n\u00eb server.<\/li>\n<li><noindex><a rel=\"nofollow\" href=\"https:\/\/www.postgresql.org\/docs\/11\/runtime-config-resource.html#GUC-MAX-WORKER-PROCESSES\"><code>max_parallel_workers<\/code><\/a><\/noindex> \u2014 po ashtu, por p\u00ebr proceset punuese paralel.<\/li>\n<\/ul>\n<p><\/p>\n<h3 id=\"itogi\">P\u00ebrfundime<\/h3>\n<p><\/p>\n<p>Fillimisht nga versioni 9.6, procesimi paralel mund t\u00eb p\u00ebrmir\u00ebsoj\u00eb ndjesh\u00ebm performanc\u00ebn e k\u00ebrkesave t\u00eb komplikuara q\u00eb skanojn\u00eb shum\u00eb rreshta ose indekse. N\u00eb PostgreSQL 10, procesimi paralel \u00ebsht\u00eb aktivizuar si e drejt\u00eb. Mos harroni ta \u00e7aktivizoni n\u00eb server\u00eb me ngarkes\u00eb t\u00eb madhe OLTP. Skanimet sekondare ose skanimet e indekseve konsumojn\u00eb shum\u00eb burime. N\u00ebse nuk jeni n\u00eb nj\u00eb raporton e t\u00eb dh\u00ebnave t\u00eb plota, k\u00ebrkesat mund t\u00eb b\u00ebhen m\u00eb efikase thjesht duke shtuar indekset q\u00eb mungojn\u00eb ose duke p\u00ebrdorur ndarjen e duhur.<\/p>\n<p><\/p>\n<h3 id=\"ssylki\">Linket<\/h3>\n<p><\/p>\n<ul>\n<li><noindex><a rel=\"nofollow\" href=\"https:\/\/www.postgresql.org\/docs\/11\/how-parallel-query-works.html\">https:\/\/www.postgresql.org\/docs\/11\/how-parallel-query-works.html<\/a><\/noindex><\/li>\n<li><noindex><a rel=\"nofollow\" href=\"https:\/\/www.postgresql.org\/docs\/11\/parallel-plans.html\">https:\/\/www.postgresql.org\/docs\/11\/parallel-plans.html<\/a><\/noindex><\/li>\n<li><noindex><a rel=\"nofollow\" href=\"http:\/\/ashutoshpg.blogspot.com\/2017\/12\/partition-wise-joins-divide-and-conquer.html\">http:\/\/ashutoshpg.blogspot.com\/2017\/12\/partition-wise-joins-divide-and-conquer.html<\/a><\/noindex><\/li>\n<li><noindex><a rel=\"nofollow\" href=\"http:\/\/rhaas.blogspot.com\/2016\/04\/postgresql-96-with-parallel-query-vs.html\">http:\/\/rhaas.blogspot.com\/2016\/04\/postgresql-96-with-parallel-query-vs.html<\/a><\/noindex><\/li>\n<li><noindex><a rel=\"nofollow\" href=\"http:\/\/amitkapila16.blogspot.com\/2015\/11\/parallel-sequential-scans-in-play.html\">http:\/\/amitkapila16.blogspot.com\/2015\/11\/parallel-sequential-scans-in-play.html<\/a><\/noindex><\/li>\n<li><noindex><a rel=\"nofollow\" href=\"https:\/\/write-skew.blogspot.com\/2018\/01\/parallel-hash-for-postgresql.html\">https:\/\/write-skew.blogspot.com\/2018\/01\/parallel-hash-for-postgresql.html<\/a><\/noindex><\/li>\n<li><noindex><a rel=\"nofollow\" href=\"http:\/\/rhaas.blogspot.com\/2017\/03\/parallel-query-v2.html\">http:\/\/rhaas.blogspot.com\/2017\/03\/parallel-query-v2.html<\/a><\/noindex><\/li>\n<li><noindex><a rel=\"nofollow\" href=\"https:\/\/blog.2ndquadrant.com\/parallel-monster-benchmark\/\">https:\/\/blog.2ndquadrant.com\/parallel-monster-benchmark\/<\/a><\/noindex><\/li>\n<li><noindex><a rel=\"nofollow\" href=\"https:\/\/blog.2ndquadrant.com\/parallel-aggregate\/\">https:\/\/blog.2ndquadrant.com\/parallel-aggregate\/<\/a><\/noindex><\/li>\n<li><noindex><a rel=\"nofollow\" href=\"https:\/\/www.depesz.com\/2018\/02\/12\/waiting-for-postgresql-11-support-parallel-btree-index-builds\/\">https:\/\/www.depesz.com\/2018\/02\/12\/waiting-for-postgresql-11-support-parallel-btree-index-builds\/<\/a><\/noindex><\/li>\n<li><noindex><a rel=\"nofollow\" href=\"https:\/\/youtu.be\/jWIOZzezbb8\">Paralelizmi n\u00eb PostgreSQL 11<\/a><\/noindex><\/li>\n<\/ul>\n<p>Burimi: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/company\/southbridge\/blog\/446706\/\">habr.com<\/a><\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u0412 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0426\u041f \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u044f\u0434\u0435\u0440. \u0413\u043e\u0434\u0430\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u044b\u043b\u0430\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u043e\u0442\u0447\u0435\u0442\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043a\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0443 \u0441\u0442\u0440\u043e\u043a \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435, \u043e\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0426\u041f, \u0438 \u0432 PostgreSQL \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 9.6. \u041f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c 3 \u0433\u043e\u0434\u0430, \u0447\u0442\u043e\u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u2014 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u044d\u0442\u0430\u043f\u0430\u0445 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":22879,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[688],"tags":[],"class_list":["post-30900","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-administrirovanie"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.1.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u0412 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0426\u041f \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u044f\u0434\u0435\u0440.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/parallelnye-zaprosy-v-postgresql\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.1.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"sq_AL\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u041f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 PostgreSQL | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u0412 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0426\u041f \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u044f\u0434\u0435\u0440.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/parallelnye-zaprosy-v-postgresql\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2019-10-31T18:38:02+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2019-10-31T18:38:02+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47K\u00ebrkesat paralel n\u00eb PostgreSQL | ProHoster","description":"N\u00eb CPU-t\u00eb moderne ka shum\u00eb b\u00ebrthama.","canonical_url":"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/parallelnye-zaprosy-v-postgresql","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"sq_AL","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u041f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 PostgreSQL | ProHoster","og:description":"\u0412 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0426\u041f \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u044f\u0434\u0435\u0440.","og:url":"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/parallelnye-zaprosy-v-postgresql","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2019-10-31T18:38:02+00:00","article:modified_time":"2019-10-31T18:38:02+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"30900","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":"2026-01-21 03:34:04","breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-03-01 03:27:06","updated":"2026-01-21 03:34:04","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts\/30900","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/comments?post=30900"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts\/30900\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/media\/22879"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/media?parent=30900"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/categories?post=30900"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/tags?post=30900"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}