X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7E92A52CA2 for ; Thu, 14 Jul 2005 17:58:10 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 94441-06 for ; Thu, 14 Jul 2005 20:58:09 +0000 (GMT) Received: from hub.org (hub.org [200.46.204.220]) by svr1.postgresql.org (Postfix) with ESMTP id 0DB1352CA0 for ; Thu, 14 Jul 2005 17:58:09 -0300 (ADT) Received: from localhost (unknown [200.46.204.144]) by hub.org (Postfix) with ESMTP id 64975A24653 for ; Thu, 14 Jul 2005 17:58:08 -0300 (ADT) Received: from hub.org ([200.46.204.220]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 94466-08 for ; Thu, 14 Jul 2005 20:57:59 +0000 (GMT) Received: from ganymede.hub.org (blk-224-176-51.eastlink.ca [24.224.176.51]) by hub.org (Postfix) with ESMTP id F02F0A246B6 for ; Thu, 14 Jul 2005 17:57:58 -0300 (ADT) Received: by ganymede.hub.org (Postfix, from userid 1000) id 402093DF45; Thu, 14 Jul 2005 17:58:04 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by ganymede.hub.org (Postfix) with ESMTP id 3CF683DF2F for ; Thu, 14 Jul 2005 17:58:04 -0300 (ADT) X-Return-Path: X-Received: from localhost ([unix socket]) by ganymede.hub.org (Cyrus v2.2.12) with LMTPA; Thu, 14 Jul 2005 03:35:49 -0300 X-Sieve: CMU Sieve 2.2 X-Received: from localhost (localhost [127.0.0.1]) by ganymede.hub.org (Postfix) with ESMTP id F172945997 for ; Thu, 14 Jul 2005 03:35:23 -0300 (ADT) X-Received: from mail.postgresql.org [200.46.204.71] by localhost with IMAP (fetchmail-6.2.5) for scrappy@localhost (single-drop); Thu, 14 Jul 2005 03:35:24 -0300 (ADT) X-Received: from svr1.postgresql.org ([unix socket]) by svr1.postgresql.org (Cyrus v2.2.12) with LMTPA; Thu, 14 Jul 2005 03:34:03 -0300 X-Sieve: CMU Sieve 2.2 X-Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C130652D49 for ; Thu, 14 Jul 2005 03:34:03 -0300 (ADT) X-Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 90271-10 for ; Thu, 14 Jul 2005 06:33:56 +0000 (GMT) X-Received: from nextmail.ru (unknown [83.222.5.149]) by svr1.postgresql.org (Postfix) with SMTP id CFE0552D10 for ; Thu, 14 Jul 2005 03:33:54 -0300 (ADT) X-Received: (qmail 63581 invoked from network); 14 Jul 2005 06:32:47 -0000 X-Received: from ppp85-140-125-114.pppoe.mtu-net.ru (HELO z) (85.140.125.114) by nextmail.ru with SMTP; 14 Jul 2005 06:32:47 -0000 From: "jobapply" To: Subject: Indexing Function called on VACUUM and sorting ? Date: Thu, 14 Jul 2005 10:33:53 +0400 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.6353 Thread-Index: AcWIBRPH0sxvB4uyS7CMZ6QrhZOEzw== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Message-Id: <20050714063354.CFE0552D10@svr1.postgresql.org> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-DCC: : X-Spam-Pyzor: Reported 0 times. ReSent-Date: Thu, 14 Jul 2005 17:57:59 -0300 (ADT) Resent-From: "Marc G. Fournier" Resent-To: pgsql-performance@postgresql.org ReSent-Subject: Indexing Function called on VACUUM and sorting ? ReSent-Message-ID: <20050714175759.A66818@ganymede.hub.org> X-Virus-Scanned: by amavisd-new at hub.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.647 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200507/209 X-Sequence-Number: 13450 It seems functional indexes are recalculated even where it is obviously not needed. \d+ test: i | integer | | t | text | | x | text | | "i_i" btree (i) "x_iii" btree (xpath_string(x, 'movie/rating'::text)) 1) When I run VACUUM FULL ANALYZE VERBOSE OR VACUUM ANALYZE a lot of xpath_string calls occur. Does VACUUM rebuild indexes ? What for to recalculate that all? It makes VACUUMing very slow. Simple VACUUM call does not lead to such function calls. 2) When I do select * from test order by xpath_string(x, 'movie/rating'::text) limit 1000 offset 10; Planner uses index x_iii (as it should, ok here): Limit -> Index scan. But many of calls to xpath_string occur in execution time. Why ? Index is calculated already and everything is so immutable.. Please answer if you have any ideas.. Functional indexes seemed so great first, but now I uncover weird issues I can't understand..