Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 632802E009B for ; Thu, 28 Feb 2008 10:31:30 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 12521-09 for ; Thu, 28 Feb 2008 10:31:21 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.186]) by postgresql.org (Postfix) with ESMTP id 4BB822E0074 for ; Thu, 28 Feb 2008 10:31:21 -0400 (AST) Received: by nf-out-0910.google.com with SMTP id f5so1915421nfh.23 for ; Thu, 28 Feb 2008 06:31:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=Aqn24gN6l95hn1dELES2U/T1ozz5UdU83ezgK767dVc=; b=ZisJINpGqgXx759rBnUQIzU+vHmgjCt889d2YRW4OnJ+Fnb716slybBFExcS6NbTfWDeCbM9rNBi9vRye4drLsjXnCLQ7WrH9YB2m0d1LgT9xhSZTDN0YAoMgGfUFOaywLQX9vOgJbdoL7YrhCDOV/b8L9q5hWLPfsZIiGlfqGw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=oNM/l1gsWzp3IJUGJwrp2V/pkbIcF/mZ/BB5Ss+Tb7Aln+cq24RyuSE//g2zq6GwbtQJTxneOStrJ3vZ4pFk0Y1KHkovN+31znwZgb2T2J3xgeb6JxbXFqGESWHROpYzSUTd9W9BiAphnpZdSTi1aW+U01AvWz8yRp91BGdChN0= Received: by 10.82.113.6 with SMTP id l6mr4466754buc.20.1204209079347; Thu, 28 Feb 2008 06:31:19 -0800 (PST) Received: by 10.82.112.18 with HTTP; Thu, 28 Feb 2008 06:31:19 -0800 (PST) Message-ID: <36af4bed0802280631ja29c636w2256fb329e14b95e@mail.gmail.com> Date: Thu, 28 Feb 2008 20:01:19 +0530 From: "Robins Tharakan" To: pgsql-performance@postgresql.org Subject: Bypassing useless ORDER BY in a VIEW MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_3482_4745090.1204209079340" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/392 X-Sequence-Number: 28934 ------=_Part_3482_4745090.1204209079340 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, While designing a complex database structure I wanted to ask a basic question about views. If I give an ORDER BY clause in a VIEW and then use it in another query where the VIEW's ORDER BY is immaterial, would the planner be able to discard this ORDER BY clause ? Any pointers / feedbacks would be really helpful. Regards, *Robins Tharakan* ------=_Part_3482_4745090.1204209079340 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi,

While designing a complex database structure I wanted to ask a basic question about views.

If I give an ORDER BY clause in a VIEW and then use it in another query where the VIEW's ORDER BY is immaterial, would the planner be able to discard this ORDER BY clause ?

Any pointers / feedbacks would be really helpful.

Regards,
Robins Tharakan
------=_Part_3482_4745090.1204209079340--