Re: [PERFORM] What needs to be done for real Partitioning?

2005-03-22 Thread Simon Riggs
On Sun, 2005-03-20 at 01:14 -0500, Greg Stark wrote: > Josh Berkus writes: > > > -- INSERT INTO should automatically create new partitions where necessary > > new tables should automatically inherit all constraints, indexes, > > keys of "parent" table > > I think you're goin

[PERFORM] best practices with index on varchar column

2005-03-22 Thread Layet Benjamin
(B (B (BHi everyone, (BI hope it is the correct newsletter for this question. (B  (BCan I use an index on a varchar column to optimize the SELECT queries that (Buse " column LIKE 'header%'  "? (BIf yes what is the best tree algotithm to use ? (B  (BI don't care about optimising INSERT,

Re: [PERFORM] best practices with index on varchar column

2005-03-22 Thread Dawid Kuroczko
On Tue, 22 Mar 2005 18:22:24 +0900, Layet Benjamin <[EMAIL PROTECTED]> wrote: > Can I use an index on a varchar column to optimize the SELECT queries that > use " column LIKE 'header%' "? > If yes what is the best tree algotithm to use ? Yes, that is the correct place. The best tree algorithm

Re: [PERFORM] What about utility to calculate planner cost constants?

2005-03-22 Thread Dawid Kuroczko
On Mon, 21 Mar 2005 14:59:56 -0800, Josh Berkus wrote: > > If by not practical you mean, "no one has implemented a multivariable > > testing approach," I'll agree with you. But multivariable testing is > > definitely a valid statistical approach to solving just such problems. > Well, not practical

Re: [PERFORM] best practices with index on varchar column

2005-03-22 Thread PFC
Can I use an index on a varchar column to optimize the SELECT queries that use " column LIKE 'header%' "? Yes If yes what is the best tree algotithm to use ? Btree Note that if you want case insensitive matching you need to make an index on lower(column) and SELECT WHERE lower(column

Re: [PERFORM] What needs to be done for real Partitioning?

2005-03-22 Thread Hannu Krosing
On E, 2005-03-21 at 09:55 -0800, Josh Berkus wrote: > Stacy, > > > Luckily they that had the chance to work with a truly fantastic DBA (the > > author of an Oracle Press performance tuning book even) before they could > > switch back. He convinced them to make some of their indexes global. > > Pe

Re: [PERFORM] What needs to be done for real Partitioning?

2005-03-22 Thread Hannu Krosing
On P, 2005-03-20 at 00:52 +0100, PFC wrote: > > tableoid would accomplish that already, assuming that the "partitioned > > table" is effectively a view on separate physical tables. > > > > regards, tom lane > > Very good. > > Also note the possibility to mark a par

Re: [PERFORM] What needs to be done for real Partitioning?

2005-03-22 Thread Hannu Krosing
On L, 2005-03-19 at 12:02 -0800, Josh Berkus wrote: > Folks, > > I may (or may not) soon have funding for implementing full table partitioning > in PostgreSQL. If you don't get it, contact me as there is a small possibility that I know a company interested enough to fund (some) of it :) > I th

Re: [PERFORM] What needs to be done for real Partitioning?

2005-03-22 Thread Hannu Krosing
On L, 2005-03-19 at 19:03 -0500, Tom Lane wrote: > Josh Berkus writes: > >>> -- INSERT INTO should automatically create new partitions where necessary > >>> -- DELETE FROM should automatically drop empty partitions > >> > >> I am not sure I agree with either of those, and the reason is that they

Re: [PERFORM] What needs to be done for real Partitioning?

2005-03-22 Thread Hannu Krosing
On L, 2005-03-19 at 23:47 -0500, Tom Lane wrote: > Alvaro Herrera <[EMAIL PROTECTED]> writes: > > Hmm. You are right, but without that we won't be able to enforce > > uniqueness on the partitioned table (we could only enforce it on each > > partition, which would mean we can't partition on anythin

Re: [PERFORM] What about utility to calculate planner cost constants?

2005-03-22 Thread Richard Huxton
Greg Stark wrote: Josh Berkus writes: That's not really practical. There are currently 5 major query tuning parameters, not counting the memory adjustments which really can't be left out. You can't realistically test all combinations of 6 variables. I don't think it would be very hard at all

[PERFORM] Tsearch2 performance on big database

2005-03-22 Thread Rick Jansen
Hi, I'm looking for a *fast* solution to search thru ~ 4 million records of book descriptions. I've installed PostgreSQL 8.0.1 on a dual opteron server with 8G of memory, running Linux 2.6. I haven't done a lot of tuning on PostgreSQL itself, but here's the settings I have changed so far: share

Re: [PERFORM] Tsearch2 performance on big database

2005-03-22 Thread Oleg Bartunov
On Tue, 22 Mar 2005, Rick Jansen wrote: Hi, I'm looking for a *fast* solution to search thru ~ 4 million records of book descriptions. I've installed PostgreSQL 8.0.1 on a dual opteron server with 8G of memory, running Linux 2.6. I haven't done a lot of tuning on PostgreSQL itself, but here's th

Re: [PERFORM] Tsearch2 performance on big database

2005-03-22 Thread Mike Rylander
On Tue, 22 Mar 2005 15:36:11 +0300 (MSK), Oleg Bartunov wrote: > On Tue, 22 Mar 2005, Rick Jansen wrote: > > > Hi, > > > > I'm looking for a *fast* solution to search thru ~ 4 million records of book > > descriptions. I've installed PostgreSQL 8.0.1 on a dual opteron server with > > 8G of memory,

Re: [PERFORM] What needs to be done for real Partitioning?

2005-03-22 Thread Alvaro Herrera
On Mon, Mar 21, 2005 at 08:26:24PM +0200, Hannu Krosing wrote: > On P, 2005-03-20 at 00:52 +0100, PFC wrote: > > Also note the possibility to mark a partition READ ONLY. Or even a > > table. > Would we still need regular VACUUMing of read-only table to avoid > OID-wraparound ? You could VA

Re: [PERFORM] Tsearch2 performance on big database

2005-03-22 Thread Oleg Bartunov
On Tue, 22 Mar 2005, Mike Rylander wrote: And Oleg should know. Unless I'm mistaken, he (co)wrote tsearch2. You're not mistaken :) Other than shared buffers, I can't imagine what could be causing that kind of slowness. EXPLAIN ANALYZE, please? tsearch2 config's also are very important. I've seen

Re: [PERFORM] Tsearch2 performance on big database

2005-03-22 Thread Rick Jansen
Mike Rylander wrote: On Tue, 22 Mar 2005 15:36:11 +0300 (MSK), Oleg Bartunov wrote: use something like echo "15000" > /proc/sys/kernel/shmmax to increase shared memory. In your case you could dedicate much more memory. Regards, Oleg Thanks, I'll check that out. And Oleg

Re: [PERFORM] What about utility to calculate planner cost constants?

2005-03-22 Thread Christopher Browne
Martha Stewart called it a Good Thing when [EMAIL PROTECTED] (Greg Stark) wrote: > I don't think it would be very hard at all actually. > > It's just a linear algebra problem with a bunch of independent > variables and a system of equations. Solving for values for all of > them is a straightforward

[PERFORM] Planner issue

2005-03-22 Thread Alex Turner
I get the following output from explain analyze on a certain subset of a large query I'm doing. >From the looks of it, I need to increase how often postgres uses an index over a seq scan, but I'm not sure how to do that. I looked through the run-time configuration docs on the website, but didn't

Re: [PERFORM] What about utility to calculate planner cost constants?

2005-03-22 Thread Bruno Wolff III
On Tue, Mar 22, 2005 at 08:09:40 -0500, Christopher Browne <[EMAIL PROTECTED]> wrote: > > Are you certain it's a linear system? I'm not. If it was a matter of > minimizing a linear expression subject to some set of linear > equations, then we could model this as a Linear Program for which > th

Re: [PERFORM] Tsearch2 performance on big database

2005-03-22 Thread Mike Rylander
On Tue, 22 Mar 2005 14:25:19 +0100, Rick Jansen <[EMAIL PROTECTED]> wrote: > > ilab=# explain analyze select count(titel) from books where idxfti @@ > to_tsquery('default', 'buckingham | palace'); > QUERY PLAN > --

Re: [PERFORM] Tsearch2 performance on big database

2005-03-22 Thread Oleg Bartunov
Mike, no comments before Rick post tsearch configs and increased buffers ! Union shouldn't be faster than (term1|term2). tsearch2 internals description might help you understanding tsearch2 limitations. See http://www.sai.msu.su/~megera/oddmuse/index.cgi/Tsearch_V2_internals Also, don't miss my n

Re: [PERFORM] What needs to be done for real Partitioning?

2005-03-22 Thread Hannu Krosing
On T, 2005-03-22 at 09:10 -0400, Alvaro Herrera wrote: > On Mon, Mar 21, 2005 at 08:26:24PM +0200, Hannu Krosing wrote: > > On P, 2005-03-20 at 00:52 +0100, PFC wrote: > > > > Also note the possibility to mark a partition READ ONLY. Or even a > > > table. > > > Would we still need regular VACU

Re: [PERFORM] Tsearch2 performance on big database

2005-03-22 Thread Rick Jansen
Oleg Bartunov wrote: Mike, no comments before Rick post tsearch configs and increased buffers ! Union shouldn't be faster than (term1|term2). tsearch2 internals description might help you understanding tsearch2 limitations. See http://www.sai.msu.su/~megera/oddmuse/index.cgi/Tsearch_V2_internals

Re: [PERFORM] What about utility to calculate planner cost constants?

2005-03-22 Thread Greg Stark
Richard Huxton writes: > You'd only need to log them if they diverged from expected anyway. That should > result in fairly low activity pretty quickly (or we're wasting our time). > Should they go to the stats collector rather than logs? I think you need to log them all. Otherwise when you go to

Re: [PERFORM] Planner issue

2005-03-22 Thread Joshua D. Drake
Alex Turner wrote: I get the following output from explain analyze on a certain subset of a large query I'm doing. Try increases the statistics on the listprice column with alter table and then re-run analyze. alter table foo alter column set statistics Sincerely, Joshua D. Drake From the look

Re: [PERFORM] Tsearch2 performance on big database

2005-03-22 Thread Oleg Bartunov
On Tue, 22 Mar 2005, Rick Jansen wrote: Oleg Bartunov wrote: Mike, no comments before Rick post tsearch configs and increased buffers ! Union shouldn't be faster than (term1|term2). tsearch2 internals description might help you understanding tsearch2 limitations. See http://www.sai.msu.su/~megera

Re: [PERFORM] What needs to be done for real Partitioning?

2005-03-22 Thread Josh Berkus
Hannu, > If you don't get it, contact me as there is a small possibility that I > know a company interested enough to fund (some) of it :) Enough people have been interested in this that if we get our acts together, we may do it as multi-funded. Easier on our budget ... > As these are already

Re: [PERFORM] What about utility to calculate planner cost constants?

2005-03-22 Thread Greg Stark
Christopher Browne <[EMAIL PROTECTED]> writes: > Are you certain it's a linear system? If you just consider the guc parameters that tell postgres how long various real world operations take (all the *_cost parameters) then it's a linear system. It has to be. The resulting time is just a sum of

Re: [PERFORM] What about utility to calculate planner cost constants?

2005-03-22 Thread Richard Huxton
Greg Stark wrote: Richard Huxton writes: You'd only need to log them if they diverged from expected anyway. That should result in fairly low activity pretty quickly (or we're wasting our time). Should they go to the stats collector rather than logs? I think you need to log them all. Otherwise when

Re: [PERFORM] best practices with index on varchar column

2005-03-22 Thread Tom Lane
PFC <[EMAIL PROTECTED]> writes: >> Can I use an index on a varchar column to optimize the SELECT queries >> that use " column LIKE 'header%' "? > Yes > Note that if you want case insensitive matching you need to make an > index > on lower(column) and SELECT WHERE lower(column) L

[PERFORM] CPU 0.1% IOWAIT 99% for decisonnal queries

2005-03-22 Thread Patrick Vedrines
Hi everyone,   I'm developping a web decisonnal application based on -Red Hat 3 ES -Postgresql 8.0.1 -Dell poweredge 2850, Ram 2Gb, 2 procs, 3 Ghz, 1Mb cache and 4 disks ext3 10,000 r/mn I am alone in the box and there is not any crontab.   I have 2 databases (A and B) with exactly the same

Re: [PERFORM] CPU 0.1% IOWAIT 99% for decisonnal queries

2005-03-22 Thread Gustavo F Nobrega - Planae
Hi Patrick,     How is configured your disk array? Do you have a Perc 4? Tip: Use reiserfs instead ext3, raid 0+1 and deadline I/O scheduler in kernel linux 2.6 Atenciosamente, Gustavo Franklin Nóbrega Infra-Estrutura e Banco de Dados Planae Tecnologia da Informação (+55) 14 3224-3066 Ramal

Re: [PERFORM] What about utility to calculate planner cost constants?

2005-03-22 Thread Tom Lane
Christopher Browne <[EMAIL PROTECTED]> writes: > Martha Stewart called it a Good Thing when [EMAIL PROTECTED] (Greg Stark) > wrote: >> It's just a linear algebra problem with a bunch of independent >> variables and a system of equations. Solving for values for all of >> them is a straightforward p

Re: [PERFORM] [ADMIN] Too slow

2005-03-22 Thread Thomas F . O'Connell
Please post the results of that query as run through EXPLAIN ANALYZE. Also, I'm going to reply to this on pgsql-performance, which is probably where it better belongs. -tfo -- Thomas F. O'Connell Co-Founder, Information Architect Sitening, LLC http://www.sitening.com/ 110 30th Avenue North, Suite

Re: [PERFORM] What about utility to calculate planner cost constants?

2005-03-22 Thread Tom Lane
Greg Stark <[EMAIL PROTECTED]> writes: > Christopher Browne <[EMAIL PROTECTED]> writes: >> Are you certain it's a linear system? > If you just consider the guc parameters that tell postgres how long various > real world operations take (all the *_cost parameters) then it's a linear > system. It

Re: [PERFORM] CPU 0.1% IOWAIT 99% for decisonnal queries

2005-03-22 Thread Richard Huxton
Patrick Vedrines wrote: Hi everyone, I'm developping a web decisonnal application based on -Red Hat 3 ES -Postgresql 8.0.1 -Dell poweredge 2850, Ram 2Gb, 2 procs, 3 Ghz, 1Mb cache and 4 disks ext3 10,000 r/mn I am alone in the box and there is not any crontab. I have 2 databases (A and B) with ex

Re: [PERFORM] Planner issue

2005-03-22 Thread Alex Turner
This helps a bit when I set it to 1000 - but it's still pretty bad: I will use an index 220-300, but not 200-300. Alex trendmls=# explain analyze select listnum from propmain where listprice<=30 and listprice>=20; QUERY PLAN

Re: [PERFORM] Planner issue

2005-03-22 Thread Ragnar Hafstað
On Tue, 2005-03-22 at 14:36 -0500, Alex Turner wrote: > I will use an index 220-300, but not 200-300. > ... > Seq Scan on propmain (cost=0.00..15517.56 rows=6842 width=4) (actual > time=0.039..239.760 rows=6847 loops=1) > ... > Index Scan using propmain_listprice_i on propmain > (cost=0.00..22

[PERFORM] PostgreSQL on Solaris 8 and ufs

2005-03-22 Thread Brandon Metcalf
We've recently moved our pgsql installation and DBs to a Solaris 8 machine with striped and mirrored ufs filesystem that houses the DB data. We are now seeing terrible performance and the bottleneck is no doubt disk I/O. We've tried modifying a tunables related to ufs, but it doesn't seem to be h

Re: [PERFORM] PostgreSQL on Solaris 8 and ufs

2005-03-22 Thread Sven Willenberger
On Tue, 2005-03-22 at 14:44 -0600, Brandon Metcalf wrote: > We've recently moved our pgsql installation and DBs to a Solaris 8 > machine with striped and mirrored ufs filesystem that houses the DB > data. We are now seeing terrible performance and the bottleneck is no > doubt disk I/O. > > We've

Re: [PERFORM] PostgreSQL on Solaris 8 and ufs

2005-03-22 Thread Alan Stange
Brandon Metcalf wrote: We've recently moved our pgsql installation and DBs to a Solaris 8 machine with striped and mirrored ufs filesystem that houses the DB data. We are now seeing terrible performance and the bottleneck is no doubt disk I/O. We've tried modifying a tunables related to ufs, but i

Re: [PERFORM] PostgreSQL on Solaris 8 and ufs

2005-03-22 Thread Brandon Metcalf
s == [EMAIL PROTECTED] writes: s> Try setting s> set ufs:ufs_WRITES=0 s> in /etc/system and rebooting, which basically says "any amount of disk s> IO can be outstanding". There's a tunables doc on docs.sun.com that s> explains this option. s> Also, logging UFS might help with some of the m

Re: [PERFORM] PostgreSQL on Solaris 8 and ufs

2005-03-22 Thread Brandon Metcalf
s == [EMAIL PROTECTED] writes: s> What are you using to create your raid? Hm. I didn't set this up. I'll have to check. s> You say it is "no doubt disk s> I/O" - does iostat confirm this? A lot of performance issues are related s> to the size of the stripe you chose for the striped portion

Re: [PERFORM] PostgreSQL on Solaris 8 and ufs

2005-03-22 Thread Mark Kirkwood
Brandon Metcalf wrote: We've recently moved our pgsql installation and DBs to a Solaris 8 machine with striped and mirrored ufs filesystem that houses the DB data. We are now seeing terrible performance and the bottleneck is no doubt disk I/O. We've tried modifying a tunables related to ufs, but i

Re: [PERFORM] What about utility to calculate planner cost constants?

2005-03-22 Thread Greg Stark
Tom Lane <[EMAIL PROTECTED]> writes: > Christopher Browne <[EMAIL PROTECTED]> writes: > > Martha Stewart called it a Good Thing when [EMAIL PROTECTED] (Greg Stark) > > wrote: > >> It's just a linear algebra problem with a bunch of independent > >> variables and a system of equations. Solving for

Re: [PERFORM] What about utility to calculate planner cost constants?

2005-03-22 Thread Tom Lane
Greg Stark <[EMAIL PROTECTED]> writes: > The time spent in real-world operations like random page accesses, sequential > page accesses, cpu operations, index lookups, etc, are all measurable > quantities. They can be directly measured or approximated by looking at the > resulting net times. That's

Re: [PERFORM] What about utility to calculate planner cost constants?

2005-03-22 Thread Dave Held
> -Original Message- > From: Tom Lane [mailto:[EMAIL PROTECTED] > Sent: Tuesday, March 22, 2005 3:48 PM > To: Greg Stark > Cc: Christopher Browne; pgsql-performance@postgresql.org > Subject: Re: [PERFORM] What about utility to calculate planner cost > constants? > [...] > The difficulty wit

Re: [PERFORM] CPU 0.1% IOWAIT 99% for decisonnal queries

2005-03-22 Thread Simon Riggs
On Tue, 2005-03-22 at 19:08 +0100, Patrick Vedrines wrote: > I have 2 databases (A and B) with exactly the same schemas: > -one main table called "aggregate" having no indexes and supporting > only SELECT statements (loaded one time a month with a new bundle of > datas). Row size # 200 bytes (50 c

Re: [PERFORM] What about utility to calculate planner cost constants?

2005-03-22 Thread Dave Held
> -Original Message- > From: Dave Held > Sent: Tuesday, March 22, 2005 4:16 PM > To: Tom Lane > Cc: pgsql-performance@postgresql.org > Subject: Re: [PERFORM] What about utility to calculate planner cost > constants? > [...] > Then instead of building a fixed cost model, why not evolve > a

Re: [PERFORM] What about utility to calculate planner cost constants?

2005-03-22 Thread Ron Mayer
Tom Lane wrote: And you can't just dismiss the issue of wrong cost models and say we can get numbers anyway. Is there a way to see more details about the cost estimates. EXPLAIN ANALYZE seems to show the total time and rows; but not information like how many disk pages were accessed. I get the feel

Re: [PERFORM] Planner issue

2005-03-22 Thread Ron Mayer
I'm guessing your data is actually more "clustered" than the "correlation" stastic thinks it is. Alex Turner wrote: > trendmls=# explain analyze select listnum from propmain where > listprice<=30 and listprice>=20; Is that a database of properties like land/houses? If

Re: [PERFORM] Planner issue

2005-03-22 Thread Ron Mayer
I'm guessing your data is actually more "clustered" than the "correlation" statistic thinks it is. Alex Turner wrote: > trendmls=# explain analyze select listnum from propmain where > listprice<=30 and listprice>=20; Is that a database of properties like land/houses?

Re: [PERFORM] What about utility to calculate planner cost constants?

2005-03-22 Thread Chris Browne
[EMAIL PROTECTED] ("Dave Held") writes: >> -Original Message- >> From: Tom Lane [mailto:[EMAIL PROTECTED] >> Sent: Tuesday, March 22, 2005 3:48 PM >> To: Greg Stark >> Cc: Christopher Browne; pgsql-performance@postgresql.org >> Subject: Re: [PERFORM] What about utility to calculate planner

Re: [PERFORM] What needs to be done for real Partitioning?

2005-03-22 Thread Bruce Momjian
Added to TODO: * Support table partitioning that allows a single table to be stored in subtables that are partitioned based on the primary key or a WHERE clause --- Josh Berkus wrote: > Hannu, > > > If you don't get i

[PERFORM] Hardware questions

2005-03-22 Thread Junaili Lie
Hi guys, We are in the process of buying a new dell server. Here is what we need to be able to do: - we need to be able to do queries on tables that has 10-20 millions of records (around 40-60 bytes each row) in less than 5-7 seconds. We also need the hardware to be able to handle up to 50 millions

Re: [PERFORM] Hardware questions

2005-03-22 Thread Karim Nassar
On Tue, 2005-03-22 at 17:32 -0800, Junaili Lie wrote: > Here is what we are thinking: > - Dual Xeon 2.8 Ghz > - 4GB DDR2 400 Mhz Dual Ranked DIMMS (is dual ranked or single ranked > makes any differences in terms of performance?). Do you guys think 4GB > is reasonably enough? > - 73 GB 15k RPM Ultr