Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 63BB81337B94 for ; Mon, 20 Dec 2010 14:48:27 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 01559-09 for ; Mon, 20 Dec 2010 18:48:20 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id B1726133740B for ; Mon, 20 Dec 2010 14:48:19 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id oBKImIRh012516; Mon, 20 Dec 2010 13:48:18 -0500 (EST) To: "Maxim Boguk" cc: pgsql-bugs@postgresql.org Subject: Re: BUG #5797: Strange bug with hstore In-reply-to: <201012201115.oBKBFYH9082710@wwwmaster.postgresql.org> References: <201012201115.oBKBFYH9082710@wwwmaster.postgresql.org> Comments: In-reply-to "Maxim Boguk" message dated "Mon, 20 Dec 2010 11:15:34 +0000" Date: Mon, 20 Dec 2010 13:48:18 -0500 Message-ID: <12515.1292870898@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201012/150 X-Sequence-Number: 28956 "Maxim Boguk" writes: > Bad explain: > billing=# EXPLAIN SELECT * from domains where > name='"name"=>"somedomain"'::text::hstore->'name'; > QUERY PLAN > ---------------------------------------------------------------------------- > ------------------------ > Seq Scan on domains (cost=0.00..7775.91 rows=1 width=230) > Filter: ((name)::text = (('"name"=>"somedomain"'::text)::hstore -> > 'name'::text)) > (index not used) The reason for this is that hstore fails to label its I/O functions as immutable (or even stable) in 8.4. This is fixed in 9.0. regards, tom lane