Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 22B1A64FC2A for ; Sat, 3 Jan 2009 00:13:19 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 85077-04 for ; Sat, 3 Jan 2009 00:13:13 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-bw0-f19.google.com (mail-bw0-f19.google.com [209.85.218.19]) by mail.postgresql.org (Postfix) with ESMTP id B813F64FC25 for ; Sat, 3 Jan 2009 00:13:11 -0400 (AST) Received: by bwz12 with SMTP id 12so17822800bwz.19 for ; Fri, 02 Jan 2009 20:13:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=BYflal3hU82FQ4dx8rrL4+hDJB7GvIiMdhPuDZczRSg=; b=Dk4hmc6Lg/1Tas0YcZtpAIGxR0+CAz7ugPWVf5Y/oqfuqxN2Ixz1Q4f6lclnShS/zA WS+QKk4B5YrFxxBQQi9fIB/NWfKJC6zV7Sl/vBawmX2P5JOmnTuVDJUzTWug/yNqWAMk QdwNCsOc6xmft2NnlfuHgSATwfmrXeRXeDATo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=OHoxuOHUYBUQfUIrpAS74FYudX3WZFwpAaRDrv2ylEqYd4aMhJKzYgkiFrrPfv/dQl QAL/uHyunsKrIEJY6zUy8/isj0l9r6+NGTs2VEVSkaMAlDUAiTY5rzcJUki4R3GmNe+y rNJnUMOkCTTNLqASZ2TzogRnZgYv/g24UihRg= Received: by 10.223.112.83 with SMTP id v19mr13238693fap.66.1230955990208; Fri, 02 Jan 2009 20:13:10 -0800 (PST) Received: by 10.223.107.134 with HTTP; Fri, 2 Jan 2009 20:13:10 -0800 (PST) Message-ID: <603c8f070901022013u242179fbq4ba97e2f5aea3715@mail.gmail.com> Date: Fri, 2 Jan 2009 23:13:10 -0500 From: "Robert Haas" To: "Greg Stark" Subject: Re: posix_fadvise v22 Cc: "Greg Smith" , "Tom Lane" , "ITAGAKI Takahiro" , Postgres In-Reply-To: <4136ffa0901021902m3d9565e8v6d62a75c4a81511a@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <87k5a6tmy7.fsf@oxford.xeocode.com> <603c8f070901011230t1afa6644racb715b975078054@mail.gmail.com> <10658.1230843315@sss.pgh.pa.us> <603c8f070901011843p121e40afu35c4a7bdc51c051c@mail.gmail.com> <603c8f070901021436v71f10188g1d747b493c89f2f5@mail.gmail.com> <4136ffa0901021502w78f0611dx63929ac0fbbdc2f4@mail.gmail.com> <603c8f070901021742s61dcbaf2r51deff1219196944@mail.gmail.com> <4136ffa0901021902m3d9565e8v6d62a75c4a81511a@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200901/102 X-Sequence-Number: 130746 > Any chance you could put back the code in explain.c which showed > whether posix_fadvise is actually getting used? Another thing I did > when testing was attaching with strace to see if posix_fadvise (the > syscall on linux was actually fadvise64 iirc) is actually getting > called. I tried changing this: returnCode = posix_fadvise(VfdCache[file].fd, offset, amount, POSIX_FADV_WILLNEED); to this: returnCode = 0; When I did that, it when back from 50 s to 33 s, which I think means that posix_fadvise is getting called and that that is what is making it slower. > And is this on a system with multiple spindles? How many? Latitude D830 laptop. Single disk. Fedora 9. kernel-2.6.27.9-73.fc9.x86_64. > And how much of the data is in shared buffers or in filesystem cache? > Is this consistent for repeated queries? Is it only when you're > repeating a query for dates that you've already selected? I stopped the cluster, dropped the page cache, and restarted the cluster just before testing. Repeated tests are fast due to caching effects. shared_buffers is 240MB. System has 2GB RAM, steady state is about 1GB of page cache. > And how fast is it with effective_io_concurrency set to 1,2,3,5,6,7,8,...? I do not currently have this information. :-) I will try to run some more tests over the weekend, but I'm too tired now and am starting to make mistakes. > Do you see the same effect if you use a self-contained test case > instead of the TPC-H data so I can try it? Not sure exactly what you have in mind here. If you send a script or something to reproduce I will try it. ...Robert