Re: [PERFORM] Selects query stats?

2006-05-23 Thread Mischa Sandberg
Alvaro Herrera wrote: Yeah, the problem seems underspecified. So, Dan, the question is, what are you trying to measure? This might be a statistic that management has always been given, for Oracle, and you need to produce the "same" number for PostgreSQL. If not, it's hard to figure out what a

Re: [PERFORM] Selects query stats?

2006-05-23 Thread Simon Riggs
On Tue, 2006-05-23 at 15:55 -0400, Tom Lane wrote: > Alvaro Herrera <[EMAIL PROTECTED]> writes: > > OTOH ISTM it would be easy to modify Postgres so as to count statements > > in the stat collector, by turning pgstat_report_activity into a routine > > that sent a count (presumably always 1) instead

Re: [PERFORM] Selects query stats?

2006-05-23 Thread Guillaume Smet
On 5/23/06, Dan Gorman <[EMAIL PROTECTED]> wrote: What I am looking for is that our DB is doing X selects a min. If you're using 7.4, you can use log_duration to only log duration. It won't log all the query text, only one short line per query. Then you can use pgFouine to analyze this and havi

Re: [PERFORM] Selects query stats?

2006-05-23 Thread Jim C. Nasby
On Tue, May 23, 2006 at 03:50:01PM -0400, Alvaro Herrera wrote: > Tom Lane wrote: > > > Counting individual statements would add overhead (which the OP already > > declared unacceptable) and there are some definitional issues too, like > > whether to count statements executed within functions. >

Re: [PERFORM] Selects query stats?

2006-05-23 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > OTOH ISTM it would be easy to modify Postgres so as to count statements > in the stat collector, by turning pgstat_report_activity into a routine > that sent a count (presumably always 1) instead of the query string, and > then just add the count to a co

Re: [PERFORM] Selects query stats?

2006-05-23 Thread Alvaro Herrera
Tom Lane wrote: > Counting individual statements would add overhead (which the OP already > declared unacceptable) and there are some definitional issues too, like > whether to count statements executed within functions. Yeah, the problem seems underspecified. How do you count statements added o

Re: [PERFORM] Selects query stats?

2006-05-23 Thread Tom Lane
"Jim C. Nasby" <[EMAIL PROTECTED]> writes: > On Tue, May 23, 2006 at 11:33:12AM -0700, Dan Gorman wrote: >> In any other DB (oracle, mysql) I know how many queries (selects) per >> second the database is executing. How do I get this >> number out of postgres? > You can't. You also can't know how

Re: [PERFORM] Selects query stats?

2006-05-23 Thread Dan Gorman
Yeah, I'm not really concerned about the app or sys performance, just a basic question of how do I get the rate of selects that are being executed. In a previous post from Jim, he noted it cannot be done. I am very surprised postgres can't do this basic functionality. Does anyone know if

Re: [PERFORM] Selects query stats?

2006-05-23 Thread Simon Riggs
On Tue, 2006-05-23 at 11:33 -0700, Dan Gorman wrote: > In any other DB (oracle, mysql) I know how many queries (selects) per > second the database is executing. How do I get this > number out of postgres? > > > I have a perl script that can test this, but no way the db tells me > how fast it's g

Re: [PERFORM] Selects query stats?

2006-05-23 Thread Jim C. Nasby
On Tue, May 23, 2006 at 11:33:12AM -0700, Dan Gorman wrote: > In any other DB (oracle, mysql) I know how many queries (selects) per > second the database is executing. How do I get this > number out of postgres? You can't. You also can't know how many DML statements were executed (though you can

Re: [PERFORM] Selects query stats?

2006-05-23 Thread Dan Gorman
In any other DB (oracle, mysql) I know how many queries (selects) per second the database is executing. How do I get this number out of postgres?I have a perl script that can test this, but no way the db tells me how fast it's going.(e.g. in oracle: select sum(executions) from v$sqlarea;)Regards,Da

Re: [PERFORM] Selects query stats?

2006-05-23 Thread Mischa Sandberg
Dan Gorman wrote: What I am looking for is that our DB is doing X selects a min. What specifically would you like to measure? Duration for specific queries? Queries in an app for which you have no source? There may be a way to get what you want by other means ... Details? I gather you cannot j

Re: [PERFORM] Selects query stats?

2006-05-23 Thread Dan Gorman
What I am looking for is that our DB is doing X selects a min. Turning on logging isn't an option as it will create too much IO in our enviornment. Regards, Dan Gorman On May 23, 2006, at 11:15 AM, Mischa Sandberg wrote: Dan Gorman wrote: All, I might be completely crazy here, but it seem

Re: [PERFORM] Selects query stats?

2006-05-23 Thread Mischa Sandberg
Dan Gorman wrote: All, I might be completely crazy here, but it seems every other database exposes select query stats. Postgres only exposes updates/deletes/inserts. Is there something I am missing here? Perhaps. You can EXPLAIN ANALYZE a SELECT, just like i/u/d -- but then you don't get th

[PERFORM] Selects query stats?

2006-05-23 Thread Dan Gorman
All, I might be completely crazy here, but it seems every other database exposes select query stats. Postgres only exposes updates/deletes/ inserts. Is there something I am missing here? Best Regards, Dan Gorman ---(end of broadcast)--- TIP 9

Re: [PERFORM] slow query using sub select

2006-05-23 Thread Tim Jones
that worked like a champ nice call as always! thanks Tim Jones Healthcare Project Manager Optio Software, Inc. (770) 576-3555 -Original Message- From: Tom Lane [mailto:[EMAIL PROTECTED] Sent: Monday, May 22, 2006 7:07 PM To: Tim Jones Cc: pgsql-performance@postgresql.org Subject: Re: [