X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 9ED219DC82F for ; Thu, 12 Jan 2006 19:33:03 -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 83021-03 for ; Thu, 12 Jan 2006 19:33:02 -0400 (AST) X-Greylist: delayed 00:26:39.190576 by SQLgrey- Received: from smtp1.iitb.ac.in (unknown [203.199.81.249]) by postgresql.org (Postfix) with SMTP id 50CDA9DCE4D for ; Thu, 12 Jan 2006 19:32:55 -0400 (AST) Received: (qmail 22754 invoked from network); 13 Jan 2006 04:35:45 +0530 Received: from unknown (HELO ldns1.iitb.ac.in) (10.200.12.1) by smtp1.iitb.ac.in with SMTP; 13 Jan 2006 04:35:45 +0530 Received: (qmail 24742 invoked by uid 509); 12 Jan 2006 23:05:45 -0000 Received: from 10.105.1.1 by ldns1 (envelope-from , uid 501) with qmail-scanner-1.25 (clamdscan: 0.87.1/1238. spamassassin: 3.1.0. Clear:RC:1(10.105.1.1):. Processed in 0.023286 secs); 12 Jan 2006 23:05:45 -0000 Received: from unknown (HELO cse.iitb.ac.in) (10.105.1.1) by ldns1.iitb.ac.in with SMTP; 12 Jan 2006 23:05:45 -0000 Received: (qmail 30084 invoked by uid 11940); 12 Jan 2006 23:08:13 -0000 Received: from 10.105.11.22 by jeeves.cse.iitb.ac.in (envelope-from , uid 11926) with qmail-scanner-1.25 (clamdscan: 0.87/1239. spamassassin: 3.1.0. Clear:RC:1(10.105.11.22):. Processed in 0.027503 secs); 12 Jan 2006 23:08:13 -0000 Received: from nsl-22.cse.iitb.ac.in ([10.105.11.22]) (envelope-sender ) by cse.iitb.ac.in (qmail-ldap-1.03) with SMTP for ; 12 Jan 2006 23:08:13 -0000 Date: Fri, 13 Jan 2006 04:35:45 +0530 (IST) From: "Anjan Kumar. A." To: pgsql-hackers@postgresql.org Subject: Re: Please Help: PostgreSQL Query Optimizer In-Reply-To: Message-ID: References: <17378.1134321553@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200601/383 X-Sequence-Number: 78487 > Through googling, i found that Normal Disk has external data transfer rate of > around 40MBps, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Does this includes, seek and rotational latency ? > where as Main Memory has Data transfer rate ranging from 1.6GBps to 2.8GBps. > > As we can see, the ratio between Disk and Main Memory data transfer rates is > around 50. Then, if we multiply all cpu_* paramters by 50, the resulting > values will be: > > random_page_cost = 1; > cpu_tuple_cost = 0.5; > cpu_index_tuple_cost = 0.05; > cpu_operator_cost = 0.0125; > > > Would it be a suitable approach ? We request all of u to give > comments/suggestions on this calcualations. Thanking You. > > > > > > On Sun, 11 Dec 2005, Tom Lane wrote: > >> [ trimming cc list to something sane ] >> >> "Anjan Kumar. A." writes: >>> In Main Memory DataBase(MMDB) entire database on the disk is loaded >>> on to the main memory during initial startup of the system. There after >>> all the references are made to database on the main memory. When the >>> system is going to shutdown, we will write back the database on the main >>> memory to disk. Here, for the sake of recovery we are writing log records >>> on to the disk during the transaction execution. >> >> Don't you get 99.9% of this for free with Postgres' normal behavior? >> Just increase shared_buffers. >> >>> Can any one tell me the modifications needs to be incorporated to >>> PostgreSQL, so that it considers only Processing Costs during >>> optimization of the Query. >> >> Assuming that a page fetch costs zero is wrong even in an all-in-memory >> environment. So I don't see any reason you can't maintain the >> convention that a page fetch costs 1.0 unit, and just adjust the other >> cost parameters in the light of a different idea about what that >> actually means. >> >>> Will it be sufficient, if we change the default values of above paramters >>> in "src/include/optimizer/cost.h and >>> src/backend/utils/misc/postgresql.conf.sample" as follows: >> >>> random_page_cost = 4; >>> cpu_tuple_cost = 2; >>> cpu_index_tuple_cost = 0.2; >>> cpu_operator_cost = 0.05; >> >> You'd want random_page_cost = 1 since there is presumably no penalty for >> random access in this context. Also, I think you'd want >> cpu_operator_cost a lot higher than that (maybe you dropped a decimal >> place? You scaled the others up by 200 but this one only by 20). >> >> It's entirely possible that the ratios of the cpu_xxx_cost values >> aren't very good and will need work. In the past we've never had >> occasion to study them very carefully, since they were only marginal >> contributions anyway. >> >> regards, tom lane >> > > -- Regards. Anjan Kumar A. MTech2, Comp Sci., www.cse.iitb.ac.in/~anjankumar ______________________________________________________________ Bradley's Bromide: If computers get too powerful, we can organize them into a committee -- that will do them in.