Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1frJgX-0004Jj-IB for pgsql-general@arkaria.postgresql.org; Sun, 19 Aug 2018 09:07:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1frJgV-0004sC-VO for pgsql-general@arkaria.postgresql.org; Sun, 19 Aug 2018 09:07:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1frJgV-0004s4-Lt for pgsql-general@lists.postgresql.org; Sun, 19 Aug 2018 09:07:43 +0000 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1frJgP-0007CH-Cz for pgsql-general@postgresql.org; Sun, 19 Aug 2018 09:07:43 +0000 Received: by mail-wr1-x432.google.com with SMTP id 20-v6so4516984wrb.12 for ; Sun, 19 Aug 2018 02:07:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:references:in-reply-to:subject:date:message-id:mime-version :content-transfer-encoding:content-language:thread-index; bh=l3Z0XG4/WLGc87quwYZdSQKG9dtDG1c6ZPaUAAZU4Wc=; b=eQs7iSXAP3a0Jc4JlF4W+tsm722xO6ncupONcatDII/do9vIYdUSUpy0qsXG61AKSO AWmSwonSLzmII36d5uGfqD7CLwbUCeSiwm6e4xIQPTNQMEKhxHMlBpkABFmMJ6kzDSVE M0+0ZTWTQWTsBSkU7KyRWeI45xp0ZEFx3xZlAu0D7xml/sXKVbVxqVk9zs1C8tzHAhQB FomZYxGTPfhkU20QWt3MoiCRSqOzA/CFlJi5iG5Z/pJhTGw7yjsirYFBy+/JP3vmaUC1 YA8y3Q/xPyuPK9FYjbd4lQMquQvWdgNpamcs5ogyzvgVNcv8cGUYmBFpsUcOKNpmEY+W VisA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:references:in-reply-to:subject:date :message-id:mime-version:content-transfer-encoding:content-language :thread-index; bh=l3Z0XG4/WLGc87quwYZdSQKG9dtDG1c6ZPaUAAZU4Wc=; b=G6MkNkeOElgExT8zIQFT0nL0c2wAAKjiP5yDe+jgg0JLVJKSyByUOKuvZYx0IIfbTR MuMaaqAyOQh61+5hU6O0D+uWLPuNBBmrqtrNFq08rR/uBLr4q/tuYY18fFhlBNWB8NBu m9/KKxmu87AJ4zFINj+LmOokVC7PU/iMAKuA7iSwQMnHZsuNqxVyUUa6k9kRDVoXAQrg UcTBB90BnSWkzvFfojwWZzbpyVSttCByMR6egSq1uCVIKl+rSX5DeeLnatL0f7U+L99g MaTisuAxhb8P2rCAOfJ2Hf2nWzwDoBwoFvOdYisbR4I6ZXpWf3dqG6e/bLAWu/4C/Evk bhow== X-Gm-Message-State: AOUpUlFNwP1H7Sx/tIbaHS8v+v9SfHiEbxWXALcawoJT7ScmU16t17Z9 sY0oxqBvx3fl5CBo6yjcLmYwVQN9 X-Google-Smtp-Source: AA+uWPzJflhqVh3686wwyeXCFWZ+ORJ2VO//mWG4elDUUogkOgtKcjArR0+9a0zJbGjXSr8rJxNxug== X-Received: by 2002:a5d:6908:: with SMTP id t8-v6mr9463111wru.170.1534669656414; Sun, 19 Aug 2018 02:07:36 -0700 (PDT) Received: from PC016 (mail.ibeq.com. [212.100.42.241]) by smtp.gmail.com with ESMTPSA id q11-v6sm6283935wrp.58.2018.08.19.02.07.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Aug 2018 02:07:35 -0700 (PDT) From: To: References: <004b01d436d6$ff96c840$fec458c0$@gmail.com> <807123113.9511341.1534609514205@mail.yahoo.com> <007201d43711$33120e20$99362a60$@gmail.com> <87ftzb5aiz.fsf@gmail.com> In-Reply-To: <87ftzb5aiz.fsf@gmail.com> Subject: AW: AW: CTE with JOIN of two tables is much faster than a regular query Date: Sun, 19 Aug 2018 11:07:34 +0200 Message-ID: <007601d4379c$11991d20$34cb5760$@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Content-Language: de Thread-Index: AQMeRW6BypEtj0kC9MzG04zOKiRbkAKicACEAXo6hZwCZeXpraH+lqWg List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > -----Urspr=C3=BCngliche Nachricht----- > Von: Tim Cross > Gesendet: Sonntag, 19. August 2018 04:57 > > > > We're using object mapping / entity frameworks (e.g. XPO, Entity > Framework Core). These frameworks support regular queries out-of-the > box; a CTEs require additional effort and are more difficult to = maintain. > > >=20 > Ah, another reason to avoid object mapping/entity frameworks! I guess > really the same reason - loss of flexibility and expressive power. While I agree that you loose control over certain details, we are = overall quite happy using the frameworks.=20 The frameworks nowadays provide the ability to call procedures if = required - but using the objects directly is more convenient for the = developers. SQL procedures add (just like a CTE) an additional layer to = the application design which needs maintenance. That's fine if it really = helps overall but we try to avoid it if it isn't needed.=20 Regards Klaus