Re: [PERFORM] TPC-R benchmarks

2003-10-01 Thread Josh Berkus
Oleg, > All right, my query just finished running with EXPLAIN ANALYZE. > I show the plan below and also attached it as a file. > Any ideas? Yes. Your problem appears to be right here: >-> Nested Loop > (cost=0.00..54596.00 rows=3 width=88) (actual time=

Re: [PERFORM] TPC-R benchmarks

2003-10-01 Thread Tom Lane
Oleg Lebedev <[EMAIL PROTECTED]> writes: > All right, my query just finished running with EXPLAIN ANALYZE. > I show the plan below and also attached it as a file. > Any ideas? Uh, have you done an ANALYZE (or VACUUM ANALYZE) on this database? It sure looks like the planner thinks the tables are a

Re: [PERFORM] TPC-R benchmarks

2003-10-01 Thread scott.marlowe
For troubleshooting, can you try it with "set enable_nestloop = false" and rerun the query and see how long it takes? It looks like the estimates of rows returned is WAY off (estimate is too low compared to what really comes back.) Also, you might try to alter the table.column to have a highe

Re: [PERFORM] TPC-R benchmarks

2003-10-01 Thread Oleg Lebedev
All right, my query just finished running with EXPLAIN ANALYZE. I show the plan below and also attached it as a file. Any ideas? -> Sort (cost=54597.49..54597.50 rows=1 width=121) (actual time=6674562.03..6674562.15 rows=175 loops=1) Sort Key: nation.n_name, date_part('year'::text, o

Re: [PERFORM] Optimizing >= and <= for numbers and dates

2003-10-01 Thread Manfred Koizar
On Wed, 1 Oct 2003 19:45:29 +0200 (MEST), "Dimitri Nagiev" <[EMAIL PROTECTED]> wrote: >template1=# explain analyze select * from mytable where >mydate>='2003-09-01'; > Seq Scan on mytable (cost=0.00..2209.11 rows=22274 width=562) (actual > time=0.06..267.30 rows=22677 loops=1) > Filter: (mydate

Re: [PERFORM] Optimizing >= and <= for numbers and dates

2003-10-01 Thread scott.marlowe
Oh, to followup on my previously sent post, make sure you've got effective_cache_size set right BEFORE you go trying to set random_page_cost, and you might wanna run a select * from table to load the table into kernel buffer cache before testing, then also test it with the cache cleared out (s

Re: [PERFORM] Optimizing >= and <= for numbers and dates

2003-10-01 Thread scott.marlowe
On Wed, 1 Oct 2003, Dimitri Nagiev wrote: > here goes the EXPLAIN ANALYZE output: > > > template1=# VACUUM analyze mytable; > VACUUM > template1=# explain analyze select * from mytable where > mydate>='2003-09-01'; > QUERY PLAN >

Re: [PERFORM] Optimizing >= and <= for numbers and dates

2003-10-01 Thread Neil Conway
On Wed, 2003-10-01 at 13:45, Dimitri Nagiev wrote: > template1=# explain analyze select * from mytable where > mydate>='2003-09-01'; > QUERY PLAN > > >

Re: [PERFORM] TPC-R benchmarks

2003-10-01 Thread Oleg Lebedev
Sure, below is the query. I attached the plan to this posting. select nation, o_year, sum(amount) as sum_profit from ( select n_name as nation, extract(year from o_orderdate) as o_year,

Re: [PERFORM] TPC-R benchmarks

2003-10-01 Thread Josh Berkus
Oleg, > The output of the query should contain about 200 rows. So, I guess the > planer is off assuming that the query should return 1 row. Oh, also did you post the query before? Can you re-post it with the planner results? -- Josh Berkus Aglio Database Solutions San Francisco

Re: [PERFORM] Tuning/performance issue...

2003-10-01 Thread Oleg Lebedev
That would be great! When do you think this would be ready for us to see ;?) -Original Message- From: Jeff [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 01, 2003 11:42 AM To: Oleg Lebedev Cc: [EMAIL PROTECTED] Subject: RE: [PERFORM] Tuning/performance issue... On Wed, 1 Oct 2003, O

Re: [PERFORM] Optimizing >= and <= for numbers and dates

2003-10-01 Thread Dimitri Nagiev
here goes the EXPLAIN ANALYZE output: template1=# VACUUM analyze mytable; VACUUM template1=# explain analyze select * from mytable where mydate>='2003-09-01'; QUERY PLAN

Re: [PERFORM] [NOVICE] Ideal Hardware?

2003-10-01 Thread Josh Berkus
Jason, Your question is really suited to the PERFORMANCE list, not NOVICE, so I have cross-posted it there. I reccomend that you subscribe to performance, and drop novice from your replies. There are lots of hardware geeks on performance, but few on novice. > We have an opportunity to purch

Re: [PERFORM] Tuning/performance issue...

2003-10-01 Thread Jeff
On Wed, 1 Oct 2003, Oleg Lebedev wrote: > Jeff, > I would really appreciate if you could send me that lengthy presentation > that you've written on pg/other dbs comparison. > Thanks. > After I give the presentation at work and collect comments from my coworkers (and remove some information you fo

Re: [PERFORM] Optimizing >= and <= for numbers and dates

2003-10-01 Thread Rod Taylor
On Wed, 2003-10-01 at 13:30, Dimitri Nagiev wrote: > Hi all, > > I haven't found any official documentation about the postgres sql optimizer > on the web, so please forgive me if there is such a document and point me to > the right direction. > > I've got the following problem: I cannot make the

Re: [PERFORM] TPC-R benchmarks

2003-10-01 Thread Oleg Lebedev
The output of the query should contain about 200 rows. So, I guess the planer is off assuming that the query should return 1 row. I will start EXPLAIN ANALYZE now. Thanks. Oleg -Original Message- From: scott.marlowe [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 01, 2003 7:23 AM To

[PERFORM] Optimizing >= and <= for numbers and dates

2003-10-01 Thread Dimitri Nagiev
Hi all, I haven't found any official documentation about the postgres sql optimizer on the web, so please forgive me if there is such a document and point me to the right direction. I've got the following problem: I cannot make the postgres SQL Optimizer use an index on a date field to filter out

Re: [PERFORM] inferior SCSI performance

2003-10-01 Thread Christopher Browne
[EMAIL PROTECTED] (Andrew Sullivan) writes: > On Wed, Oct 01, 2003 at 07:14:32AM -0600, scott.marlowe wrote: >> FYI, on a Dual PIV2800 with 2 gig ram and a single UDMA 80 gig hard drive, >> I from 420 tps to 22 tps when I disable write caching. WOW. A factor of >> about 20 times slower. (pgben

Re: [PERFORM] Joins on inherited tables

2003-10-01 Thread Tom Lane
[EMAIL PROTECTED] writes: > So.. does anybody have any advice? Look at set_inherited_rel_pathlist() in allpaths.c --- it forms the best plan for fully scanning the inheritance-tree table. Currently that's the *only* plan considered, and it does not make any use of join clauses. It's possible tha

Re: [PERFORM] TPC-R benchmarks

2003-10-01 Thread Josh Berkus
Oleg, > I continue struggling with the TPC-R benchmarks and wonder if anyone > could help me optimize the query below. ANALYZE statistics indicate that > the query should run relatively fast, but it takes hours to complete. I > attached the query plan to this posting. Even though it takes hours t

Re: [PERFORM] TPC-R benchmarks

2003-10-01 Thread George Essig
Tom Lane wrote: > When benchmarking with data sets considerably larger than available > buffer cache, I rather doubt that small random_page_cost would be a > good idea. Still, you might as well experiment to see. >From experience, I know the difference in response time can be huge when postgres

Re: [PERFORM] Tuning/performance issue...

2003-10-01 Thread Oleg Lebedev
Jeff, I would really appreciate if you could send me that lengthy presentation that you've written on pg/other dbs comparison. Thanks. Oleg -Original Message- From: Jeff [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 01, 2003 6:23 AM To: David Griffiths Cc: [EMAIL PROTECTED] Subject:

[PERFORM] Joins on inherited tables

2003-10-01 Thread apb18
Hi, In some situations, it looks like the optimizer does not chose efficient paths for joining inherited tables. For I created a rather trivial formulation to serve as an example. I created the table 'numbers' comprising of the columns id (int) and value (text). I also created the ta

Re: [PERFORM] Tuning/performance issue...

2003-10-01 Thread Tom Lane
David Griffiths <[EMAIL PROTECTED]> writes: >> The reason PG's planner doesn't discover this join order for itself >> is that it's written to not attempt to re-order outer joins from the >> syntactically defined ordering. In general, such reordering would >> change the results. It is possible to

Re: [PERFORM] TPC-R benchmarks

2003-10-01 Thread scott.marlowe
On Tue, 30 Sep 2003, Oleg Lebedev wrote: > I continue struggling with the TPC-R benchmarks and wonder if anyone > could help me optimize the query below. ANALYZE statistics indicate that > the query should run relatively fast, but it takes hours to complete. I > attached the query plan to this pos

Re: [PERFORM] inferior SCSI performance

2003-10-01 Thread Andrew Sullivan
On Wed, Oct 01, 2003 at 07:14:32AM -0600, scott.marlowe wrote: > FYI, on a Dual PIV2800 with 2 gig ram and a single UDMA 80 gig hard drive, > I from 420 tps to 22 tps when I disable write caching. WOW. A factor of > about 20 times slower. (pgbench -c 4 -t 100) That's completely consistent wit

Re: [PERFORM] inferior SCSI performance

2003-10-01 Thread scott.marlowe
On Wed, 1 Oct 2003, Andrew Sullivan wrote: > On Wed, Sep 17, 2003 at 04:46:00PM -0400, Michael Adler wrote: > > So the quesiton is whether it is ever sensible to use write-caching and > > expect comparable persistence. > > Yes. If and only if you have a battery-backed cache. I know of no > IDE

Re: [PERFORM] What is the fastest null WHERE

2003-10-01 Thread Mindaugas Riauba
> > While writing web application I found that it would > > be very nice for me to have "null" WHERE clause. Like > > WHERE 1=1. Then it is easy to concat additional > > conditions just using $query . " AND col=false" syntax. > > > > But which of the possible "null" clauses is the fastest > > o

Re: [PERFORM] What is the fastest null WHERE

2003-10-01 Thread Rod Taylor
On Wed, 2003-10-01 at 08:11, Mindaugas Riauba wrote: > While writing web application I found that it would > be very nice for me to have "null" WHERE clause. Like > WHERE 1=1. Then it is easy to concat additional > conditions just using $query . " AND col=false" syntax. > > But which of the poss

Re: [PERFORM] What is the fastest null WHERE

2003-10-01 Thread Richard Huxton
On Wednesday 01 October 2003 13:11, Mindaugas Riauba wrote: > Hello, > > While writing web application I found that it would > be very nice for me to have "null" WHERE clause. Like > WHERE 1=1. Then it is easy to concat additional > conditions just using $query . " AND col=false" syntax. > >

Re: [PERFORM] What is the fastest null WHERE

2003-10-01 Thread Shridhar Daithankar
Mindaugas Riauba wrote: Hello, While writing web application I found that it would be very nice for me to have "null" WHERE clause. Like WHERE 1=1. Then it is easy to concat additional conditions just using $query . " AND col=false" syntax. But which of the possible "null" clauses is the fa

Re: [PERFORM] Tuning/performance issue...

2003-10-01 Thread Jeff
On Tue, 30 Sep 2003, David Griffiths wrote: > > This is all part of a "migrate away from Oracle" project. We are looking at > 3 databases - > MySQL (InnoDB), Postgres and Matisse (object oriented). We have alot of > queries like this > or worse, and I'm worried that many of them would need to be r

[PERFORM] What is the fastest null WHERE

2003-10-01 Thread Mindaugas Riauba
Hello, While writing web application I found that it would be very nice for me to have "null" WHERE clause. Like WHERE 1=1. Then it is easy to concat additional conditions just using $query . " AND col=false" syntax. But which of the possible "null" clauses is the fastest one? Thanks,

Re: [PERFORM] inferior SCSI performance

2003-10-01 Thread Andrew Sullivan
On Wed, Sep 17, 2003 at 04:46:00PM -0400, Michael Adler wrote: > So the quesiton is whether it is ever sensible to use write-caching and > expect comparable persistence. Yes. If and only if you have a battery-backed cache. I know of no IDE drives that have that, but there's nothing about the spe

Re: [PERFORM] Tuning/performance issue....

2003-10-01 Thread Shridhar Daithankar
David Griffiths wrote: And finally, Here's the contents of the postgresql.conf file (I've been playing with these setting the last couple of days, and using the guide @ http://www.varlena.com/varlena/GeneralBits/Tidbits/annotated_conf_e.html to make sure I didn't have it mis-tuned): tcpip_s