X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id CC03C9DC802 for ; Thu, 5 Jan 2006 19:11:06 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 26959-09 for ; Thu, 5 Jan 2006 19:11:09 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from floppy.pyrenet.fr (floppy.pyrenet.fr [194.116.145.2]) by postgresql.org (Postfix) with ESMTP id 4E53B9DC812 for ; Thu, 5 Jan 2006 19:11:04 -0400 (AST) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id C8FA533A69; Fri, 6 Jan 2006 00:11:04 +0100 (MET) From: "Qingqing Zhou" X-Newsgroups: pgsql.performance Subject: Re: Help in avoiding a query 'Warm-Up' period/shared buffer cache Date: Thu, 5 Jan 2006 18:12:13 -0500 Organization: Hub.Org Networking Services Lines: 31 Message-ID: References: <200601041449.43557.mliberman@mixedsignals.com> X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.154 required=5 tests=[AWL=0.154] X-Spam-Score: 0.154 X-Spam-Level: X-Archive-Number: 200601/24 X-Sequence-Number: 16502 "Mark Liberman" wrote > > First run, after a night of inactivity: > > -> Bitmap Index Scan on 1min_events_file_id_begin_idx > (cost=0.00..37.85 rows=3670 width=0) (actual time=313.468..313.468 > rows=11082 > loops=1) > Index Cond: (file_id = 137271) > Total runtime: 313.643 ms > > Second run, after that: > > -> Bitmap Index Scan on 1min_events_file_id_begin_idx > (cost=0.00..37.85 rows=3670 width=0) (actual time=2.106..2.106 rows=11082 > loops=1) > Index Cond: (file_id = 137271) > Total runtime: 2.276 ms It is clear that the first query takes longer time because of the IO time of index 1min_events_file_id_begin_idx (see 313.468 vs. 2.106). I am afraid currently there is no easy solution for this situation, unless you could predicate which part of relation/index your query will use, then you can preload or "warm-up" cache for it. Regards, Qingqing