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 1g5xwk-0002qt-Ma for pgsql-general@arkaria.postgresql.org; Fri, 28 Sep 2018 18:57:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g5xwi-0007aT-Sf for pgsql-general@arkaria.postgresql.org; Fri, 28 Sep 2018 18:57:00 +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 1g5xwi-0007Vi-HE for pgsql-general@lists.postgresql.org; Fri, 28 Sep 2018 18:57:00 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1g5xwb-0004is-TC for pgsql-general@lists.postgresql.org; Fri, 28 Sep 2018 18:56:59 +0000 Received: by mail-pg1-x542.google.com with SMTP id i4-v6so4480087pgq.9 for ; Fri, 28 Sep 2018 11:56:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=/GHJr9itgs9BuwDclNeikyxvzhZcZNQrKoeIXXAvDpE=; b=QNHSGYOtFlEkV+VmtX32iMnrnGQyPeJjLAprEFbjMe/ykxLXdaqeaMgOsn7U+NEQWp UQf7+891uH/Y2PuK1kQYC17SmBVkeqs9SzSwBjHbvBYgyqzB6QB5hnJJm7oT9cY9xkPV z/bfMXz8+LdqUnA4i1lgadR3691eLLils8OAVV3dOkkeuVwflcNyt1k+VkZH+HTWeHLa F2KDmpZr5jgEiaKdi/H3s8V5AM4h/CDgCLuxCyVlXbiksIs++oTgVVuqEXaqhkgsWTng oUyUIw2/rAafj1PK292fGu33A7FTde8LtQ5lckLjh8qHyWyWL6Mhyfh2KckUPzXLs0k/ RzLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=/GHJr9itgs9BuwDclNeikyxvzhZcZNQrKoeIXXAvDpE=; b=DSKte16hitb+Y0AU4HTzhe7eXU0+c5gwRFLRBzR/Mr5QLsgCXgSPnLdoPaAQWaciqK 257cT4chyvtUH1DAQy2hlqDq1HHGp5pKKWlMF67bhC9QlTl79wWyLOyJ8js7+eWtsrBB HfKhNPEZ0PM/d9aVGy5pNd9d1yphREmdOKxo8zvxIa+EJJl6fpDCa2XH65KWHUNabU8M atOv9+Y0UirnarbLbwg6mf1/7SGCy3WBOH71LyW7+Q2SUDFRjIKwMnCGjRcdUG5j4ru7 KcDCkhGDuvuArp6UO86yBZl250J7XdlHzc4y0tUqxC0uZLFaipHPyt1DFt4J87GP7N/b UrUA== X-Gm-Message-State: ABuFfog35sl9NiyhiGMdzh0CDXsArAtcvbQB2LhoLosHQkL11NvqIeFc d2EA7DXDyFwB+cKCydG+qMa74Gl9 X-Google-Smtp-Source: ACcGV63CqVXqpWbSqt9+wt/6a1KPoZ9D3DZ/rm4xpOGmXSuuSkDSDw6uHe7dAk7Dlgip0yyh9UFvpA== X-Received: by 2002:a62:c957:: with SMTP id k84-v6mr2527075pfg.205.1538161011096; Fri, 28 Sep 2018 11:56:51 -0700 (PDT) Received: from [10.104.134.14] ([155.100.47.6]) by smtp.gmail.com with ESMTPSA id j16-v6sm13052834pfk.125.2018.09.28.11.56.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Sep 2018 11:56:50 -0700 (PDT) Subject: Re: Why my query not using index to sort? To: pgsql-general@lists.postgresql.org References: <20311.1538141875@sss.pgh.pa.us> <97DDEE09-FE33-43DB-A451-665F3535B5BA@zeit.io> <40D9D4B8-7D62-4E6E-B6E9-3F83DACA2D45@zeit.io> <61708e66-dcc6-6490-b876-979eff8c3efd@a-kretschmer.de> <05A26EE2-964C-4F53-8DB5-CD86D3D46D86@zeit.io> <2c10559c-21fa-bb73-3814-cec5583ddb6c@aklaver.com> <327CBA05-3910-416D-B1E0-175C44A256AE@zeit.io> From: Rob Sargent Message-ID: <0a779131-11fb-4ef5-5412-fa4e412317f8@gmail.com> Date: Fri, 28 Sep 2018 12:56:49 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <327CBA05-3910-416D-B1E0-175C44A256AE@zeit.io> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 09/28/2018 12:51 PM, Arup Rakshit wrote: > > Yes, I have shown the explain plan output. But in my application log > the sql query prints 1.7 to 1.9 ms. > > How often does the production app make this call?  Apparently it could do it 500 times per second.  But at such a rate the network overhead would be stupendous - you might think about getting more data per call, few calls.