[HACKERS] Discarding the resulting rows
Hello Hackers: Two questions. 1. I would like to execute queries such as select * from part and time the query. But I want to ignore how much time is taken for printing the result to a file or the screen. Basically, I would like to discard the result rows after doing all the work required to execute the query. I looked at the documentation and I saw something about using the keyword PERFORM rather than SELECT. I tried PERFORM * from part; But this gave me a syntax error. Please let me know how this can be done. 2. How do I clear the buffer caches between two query runs? I believe this is not possible in Postgres. Can someone please confirm this or tell me how it may be done. Thanks, Murali. - Please visit NumberFest.com for educational number puzzles mind exercises for all ages! And please tell your friends about it. Thank You!
Re: [HACKERS] Discarding the resulting rows
Hello All: The optimizer assumes that data is disk resident when computing the cost of a query plan. I am trying to ascertain what the correlation is between times and costs of some benchmark queries to see how good the cost model is. Since I have more than 100 queries, it would be painful to stop and start the server each time to force all the buffer pages out. Also, some of these queries have large number of result rows. I don't want the time to be skewed by the output time. Cheers, Murali. - Please visit NumberFest.com for educational number puzzles mind exercises for all ages! And please tell your friends about it. Thank You! --- On Mon, 4/26/10, Tom Lane t...@sss.pgh.pa.us wrote: From: Tom Lane t...@sss.pgh.pa.us Subject: Re: [HACKERS] Discarding the resulting rows To: Jaime Casanova jcasa...@systemguards.com.ec Cc: Robert Haas robertmh...@gmail.com, Kevin Grittner kevin.gritt...@wicourts.gov, pgsql-hackers@postgresql.org, Murali M. Krishna murali1...@yahoo.com Date: Monday, April 26, 2010, 1:25 PM Jaime Casanova jcasa...@systemguards.com.ec writes: On Mon, Apr 26, 2010 at 3:03 PM, Robert Haas robertmh...@gmail.com wrote: On Mon, Apr 26, 2010 at 3:36 PM, Kevin Grittner kevin.gritt...@wicourts.gov wrote: I would use EXPLAIN ANALYZE SELECT ... There's some overhead to that, of course. he could see the actual time in the very first row of the EXPLAIN ANALYZE... isn't that a value that is more close to what the OP is looking for? Well, it will include the instrumentation overhead of EXPLAIN ANALYZE, which can be nontrivial depending on your hardware and the query plan. On the other hand, EXPLAIN skips the cost of converting the result data to text form, not to mention the network overhead of delivering it; so in another sense it's underestimating the work involved. I guess the real question is exactly what the OP is hoping to measure and why. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
[HACKERS] debugger question
Hello: I am brand new to Postgresql. I ran the following commands. ./configure gmake su gmake install adduser postgres mkdir /usr/local/pgsql/data chown postgres /usr/local/pgsql/data su - postgres /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data logfile 21 /usr/local/pgsql/bin/createdb test /usr/local/pgsql/bin/psql test I would like to start using gdb. What is the simplest way of doing this? I read the instructions on this page http://sites.google.com/a/cs.berkeley.edu/cs186-fa09/home/assignments/assignment2/pggdb , but this is what I get. gdb) attach 1731 Attaching to program: /usr/local/pgsql/bin/postgres, process 1731 ptrace: Operation not permitted. (gdb) break cost_seqscan Breakpoint 1 at 0x81cdf97: file costsize.c, line 163. (gdb) c The program is not being run. - Please help. Thanks. MMK. - Please visit NumberFest.com for educational number puzzles mind exercises for all ages! And please tell your friends about it. Thank You!
Re: [HACKERS] debugger question
The OS is Fedora 12. - Please visit NumberFest.com for educational number puzzles mind exercises for all ages! And please tell your friends about it. Thank You! --- On Mon, 4/12/10, to...@tuxteam.de to...@tuxteam.de wrote: From: to...@tuxteam.de to...@tuxteam.de Subject: Re: [HACKERS] debugger question To: Murali M. Krishna murali1...@yahoo.com Cc: pgsql-hackers@postgresql.org Date: Monday, April 12, 2010, 9:28 PM -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mon, Apr 12, 2010 at 08:31:38PM -0700, Murali M. Krishna wrote: Hello: I am brand new to Postgresql. I ran the following commands. ./configure gmake su gmake install adduser postgres mkdir /usr/local/pgsql/data chown postgres /usr/local/pgsql/data su - postgres /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data logfile 21 /usr/local/pgsql/bin/createdb test /usr/local/pgsql/bin/psql test I would like to start using gdb. What is the simplest way of doing this? I read the instructions on this page http://sites.google.com/a/cs.berkeley.edu/cs186-fa09/home/assignments/assignment2/pggdb , but this is what I get. gdb) attach 1731 Attaching to program: /usr/local/pgsql/bin/postgres, process 1731 ptrace: Operation not permitted. (gdb) break cost_seqscan Breakpoint 1 at 0x81cdf97: file costsize.c, line 163. (gdb) c The program is not being run. Hm. Seems you got the right PID (gdb finds the executable after all). Are you perhaps running under SELinux? (i just boldly assumed some GNU/Linux). Which distribution, which kernel version (there seems to be a bug in 2.4-ish Linux kernels which manifests itself like that, but that's quite a while ago). Next time, please tell us what OS is under you (although it might be fun to watch people make wild guesses :) Regards - -- tomás -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFLw/LTBcgs9XrR2kYRArYMAJ9JHu/Sl5JWSAv77om9HXHIzZtrDACZAWWu fpk1yLbio8KOcWjTEWCXrK4= =z0qo -END PGP SIGNATURE- -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers