Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YO6Q0-0001ZY-P9 for pgsql-admin@arkaria.postgresql.org; Wed, 18 Feb 2015 15:20:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YO6Q0-0006jY-0i for pgsql-admin@arkaria.postgresql.org; Wed, 18 Feb 2015 15:20:04 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YO6Pz-0006iA-2z for pgsql-admin@postgresql.org; Wed, 18 Feb 2015 15:20:03 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YO6Pv-0003Fj-Pt for pgsql-admin@postgresql.org; Wed, 18 Feb 2015 15:20:01 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t1IFJvQC001021; Wed, 18 Feb 2015 10:19:57 -0500 From: Tom Lane To: Valentina Tedone cc: pgsql-admin@postgresql.org Subject: Re: execution time In-reply-to: References: Comments: In-reply-to Valentina Tedone message dated "Wed, 18 Feb 2015 09:38:36 +0100" Date: Wed, 18 Feb 2015 10:19:57 -0500 Message-ID: <1020.1424272797@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org Valentina Tedone writes: > The problem is about time, infact to solve i.e. this query: > "SELECT * FROM data d WHERE d.type = 7 AND > (((d.metadata->'chromosome'->>'value')::text IN ('3','7')) AND > ((d.metadata->'somatic'->>'value')::boolean = 'true')) and > ((d.metadata->'filter'->>'value')::text IN ('pass')) LIMIT 30;" > the first db has an average time about 52.876 ms, the second about > 470.1172 ms and the bigger one about 58.3572 ms. > Why is there this difference?it is only for the different strategy? You have not provided enough detail to let anyone do more than guess. There is advice here about how to ask answerable questions: https://wiki.postgresql.org/wiki/Slow_Query_Questions regards, tom lane -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin