Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 29C199FB399 for ; Mon, 29 Jan 2007 11:41:13 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 02427-01 for ; Mon, 29 Jan 2007 11:40:59 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from fafnir.androme.com (fafnir.androme.com [62.58.96.158]) by postgresql.org (Postfix) with ESMTP id 3C0939FB38A for ; Mon, 29 Jan 2007 11:40:59 -0400 (AST) Received: by fafnir.androme.com (Postfix, from userid 1003) id B321FB99167; Mon, 29 Jan 2007 16:40:57 +0100 (CET) Message-ID: <45BE1589.9030804@andromeiberica.com> Date: Mon, 29 Jan 2007 16:40:57 +0100 From: Arnau Reply-To: arnaulist@andromeiberica.com User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: PostgreSQL Performance Subject: Re: [OT] Very strange postgresql behaviour References: <45BDE6E4.9050805@andromeiberica.com> <20070129082706.0ef2df3b.wmoran@collaborativefusion.com> In-Reply-To: <20070129082706.0ef2df3b.wmoran@collaborativefusion.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200701/404 X-Sequence-Number: 23005 Hi Bill, > In response to Arnau : >> I have postgresql 7.4.2 running on debian and I have the oddest >> postgresql behaviour I've ever seen. >> >> I do the following queries: >> >> >> espsm_asme=# select customer_app_config_id, customer_app_config_name >> from customer_app_config where customer_app_config_id = 5929 or >> customer_app_config_id = 11527 order by customer_app_config_id; >> >> >> customer_app_config_id | customer_app_config_name >> ------------------------+-------------------------- >> 5929 | INFO >> (1 row) >> >> >> I do the same query but changing the order of the or conditions: >> >> >> espsm_asme=# select customer_app_config_id, customer_app_config_name >> from customer_app_config where customer_app_config_id = 11527 or >> customer_app_config_id = 5929 order by customer_app_config_id; >> >> >> customer_app_config_id | customer_app_config_name >> ------------------------+-------------------------- >> 11527 | MOVIDOSERENA TONI 5523 >> (1 row) >> >> >> >> As you can see, the configuration 5929 and 11527 both exists, but >> when I do the queries they don't appear. > > [snip] > > Just a guess, but perhaps your index is damaged. Have you tried > REINDEXing? > Yes, I have tried with: reindex table customer_app_config reindex index pk_cag_customer_application_id but nothing changed. I also tried to drop the index: espsm_asme=# begin; drop index pk_cag_customer_application_id; BEGIN ERROR: cannot drop index pk_cag_customer_application_id because constraint pk_cag_customer_application_id on table customer_app_config requires it HINT: You may drop constraint pk_cag_customer_application_id on table customer_app_config instead. espsm_asme=# rollback; ROLLBACK But I can't remove the constraint as it's the primary key and there are foreign keys over it -- Arnau