Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 7A135101438A for ; Thu, 1 Mar 2012 08:19:19 -0400 (AST) Received: from meteor.mejor.pl ([2001:470:1f15:1b61::2]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1S34yb-0007Ya-8f for pgsql-performance@postgresql.org; Thu, 01 Mar 2012 12:19:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mejor.pl; s=cokolwiek; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:References:Subject:CC:To:MIME-Version:From:Date:Message-ID; bh=H1RSOGFC8PE+TtG/nguBytjYUFRYlVGjl6T9QClZxn4=; b=TZKvlta6jpdHLwHm1y96WRTpkiPiMaKEAVHT3Y4ySNKJK0j6ZrifSXZGVAcVoE/Tj2TSBUPIAY7/V3o3ejnAYMI5fmNNLZIS6M66ORkXUxAbsnc0PktenRmZ9/d1XbYS; Received: from cadera.waw.pl ([62.121.127.119] helo=[192.168.138.46]) by meteor.mejor.pl with esmtpsa (TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.77) (envelope-from ) id 1S34yO-0009nz-Cf; Thu, 01 Mar 2012 13:19:04 +0100 Message-ID: <4F4F6937.4090200@mejor.pl> Date: Thu, 01 Mar 2012 13:19:03 +0100 From: =?UTF-8?B?TWFyY2luIE1pcm9zxYJhdw==?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120213 Thunderbird/10.0.1 MIME-Version: 1.0 To: Szymon Guz CC: pgsql-performance@postgresql.org Subject: Re: [planner] Ignore "order by" in subselect if parrent do count(*) References: <4F4F6158.7060200@mejor.pl> <4F4F6550.4010705@mejor.pl> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.0 (--) X-Archive-Number: 201203/5 X-Sequence-Number: 46455 W dniu 01.03.2012 13:09, Szymon Guz pisze: > Could you provide the postgres version and the structure of > users_profile table (with indexes)? Argh, i forgot about version. It's postgresql-9.1.3. I don't think structre of users_profile is important here. Me idea is let planner ignore sorting completly. I don't want to have sort quicker (in this case, surely;)), i'd like to skip sorting completly because it doesn't influence for query result. Table isn't "real life", it only demonstrates than planner sometimes can safely skip some steps. Regards, Marcin