FW: [PERFORM] FW: Index usage

2004-11-24 Thread BBI Edwin Punzalan
Thanks, Tim. I tried adding an upper limit and its still the same as follows: == db=# explain analyze select date from chatlogs where date>='11/24/04'; NOTICE: QUERY PLAN: Index Scan using chatlogs_date_idx on chatlogs (cost=0.00..145.72 rows=37 width=4) (actual time=0.18..239.69

Re: [PERFORM] Data type to use for primary key

2004-11-24 Thread Greg Stark
Tom Lane <[EMAIL PROTECTED]> writes: > Greg Stark <[EMAIL PROTECTED]> writes: > > This could hurt if they ever reuse an old previously retired postal code, > > which isn't an entirely impossible case. As far as I know it hasn't happened > > yet though. > > One would suppose that the guys who are

Re: [PERFORM] FW: Index usage

2004-11-24 Thread gnari
From: "BBI Edwin Punzalan" <[EMAIL PROTECTED]> > db=# explain analyze select date from chatlogs where date>='11/23/04' and > date<'11/25/04'; > NOTICE: QUERY PLAN: > > Seq Scan on chatlogs (cost=0.00..24763.19 rows=9200 width=4) (actual > time=0.45..4268.00 rows=23787 loops=1) > Total runtime:

Re: [PERFORM] FW: Index usage

2004-11-24 Thread BBI Edwin Punzalan
Yes, the database is being vacuum-ed and analyzed on a daily basis. Our version is 7.2.1 -Original Message- From: gnari [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 24, 2004 4:35 PM To: BBI Edwin Punzalan; [EMAIL PROTECTED] Subject: Re: [PERFORM] FW: Index usage From: "BBI Edwi

[PERFORM] Unsubscribe

2004-11-24 Thread songtebo
Unsubscribe ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: FW: [PERFORM] FW: Index usage

2004-11-24 Thread Richard Huxton
BBI Edwin Punzalan wrote: Thanks, Tim. I tried adding an upper limit and its still the same as follows: == db=# explain analyze select date from chatlogs where date>='11/24/04'; NOTICE: QUERY PLAN: Index Scan using chatlogs_date_idx on chatlogs (cost=0.00..145.72 rows=37 width=4) (act

Re: FW: [PERFORM] FW: Index usage

2004-11-24 Thread BBI Edwin Punzalan
Hi. 1) chatlogs rows increases every now and then (its in a live environment) and currently have 538,696 rows 2) this is the only problem we experienced. So far, all our other indexes are being used correctly. 3) I don't remember tuning any post-installation configuration of our postgreSQL excep

Re: FW: [PERFORM] FW: Index usage

2004-11-24 Thread Richard Huxton
BBI Edwin Punzalan wrote: Hi. 1) chatlogs rows increases every now and then (its in a live environment) and currently have 538,696 rows OK, so as a rule of thumb I'd say if you were fetching less than 5000 rows it's bound to use an index. If more than 50,000 always use a seqscan, otherwise it'll

[PERFORM] Postgres vs. MySQL

2004-11-24 Thread Evilio del Rio
Hi, I have installed the dspam filter (http://www.nuclearelephant.com/projects/dspam) on our mail server (RedHat 7.3 Linux with sendmail 8.13 and procmail). I have ~300 users with a quite low traffic of 4000 messages/day. So it's a quite common platform/environment, nothing spectacular. First ti

Re: [PERFORM] Postgres vs. MySQL

2004-11-24 Thread Steinar H. Gunderson
On Wed, Nov 24, 2004 at 02:14:18PM +0100, Evilio del Rio wrote: > It's incredible! the same servers, the same messages, the same dspam > compilation (well each one with the corresponding > --with-storage-driver=*sql_drv). Postgres is getting worst than > 30s/message and MySQL process the same in le

Re: [PERFORM] Postgres vs. MySQL

2004-11-24 Thread Richard Huxton
Evilio del Rio wrote: Please, could anyone explain me this difference? Is Postgres that bad? Is MySQL that good? Am I the only one to have observed this behavior? Do you have any record of configuration, system hardware, usage patterns, queries executed? If you can tell us what you tried (and why

Re: [PERFORM] Postgres vs. MySQL

2004-11-24 Thread Christian Fowler
As for performance, lots of others will probably volunteer tips and techniques. In my experience, properly written and tuned applications will show only minor speed differences. I have seen several open-source apps that "support postgres" but are not well tested on it. Query optimization can ca

Re: [PERFORM] Data type to use for primary key

2004-11-24 Thread Alexandre Leclerc
On 24 Nov 2004 01:52:52 -0500, Greg Stark <[EMAIL PROTECTED]> wrote: > Alexandre Leclerc <[EMAIL PROTECTED]> writes: > > > Thanks for those tips. I'll print and keep them. So in my case, the > > product_code being varchar(24) is: > > 4 bytes + string size (so possibly up to 24) = possible 28 bytes

Re: [PERFORM] Postgres vs. MySQL

2004-11-24 Thread Joshua D. Drake
Evilio del Rio wrote: Hi, I have installed the dspam filter (http://www.nuclearelephant.com/projects/dspam) on our mail server (RedHat 7.3 Linux with sendmail 8.13 and procmail). I have ~300 users with a quite low traffic of 4000 messages/day. So it's a quite common platform/environment, nothing sp

Re: [PERFORM] memcached and PostgreSQL

2004-11-24 Thread Jim C. Nasby
If instead of a select you do a select for update I think this would be transaction safe. Nothing would be able to modify the data in the database between when you do the SELECT and when you commit. If the transaction fails the value in memcached will be correct. Also, it's not clear if you're doi

Re: [PERFORM] Postgres vs. MySQL

2004-11-24 Thread Steinar H. Gunderson
On Wed, Nov 24, 2004 at 09:57:52AM -0500, Christian Fowler wrote: > As for performance, lots of others will probably volunteer tips and > techniques. In my experience, properly written and tuned applications will > show only minor speed differences. I have seen several open-source apps > that "s

Re: [PERFORM] [PERFORMANCE] Big number of schemas (3500) into a single database

2004-11-24 Thread Jaime Casanova
--- Tom Lane <[EMAIL PROTECTED]> escribió: > "Constantin Teodorescu" <[EMAIL PROTECTED]> writes: > > If I will choose to keep a mirror of every > > workstation database in a > > separate schema in the central database that mean > > that I will have 3500 different schemas. > > > Is there any limi

[PERFORM] "Group By " index usage

2004-11-24 Thread sdfasdfas sdfasdfs
I have a table with this index: create index ARTISTS_NAME on ARTISTS ( lower(AR_NAME) ); Te index is over a colum with this definition: AR_NAME VARCHAR(256) null, I want to optimize this query: select * from artists where lower(ar_name) like lower('a%') order by lower

Re: [PERFORM] "Group By " index usage

2004-11-24 Thread Tom Lane
sdfasdfas sdfasdfs <[EMAIL PROTECTED]> writes: > I have a table with this index: > create index ARTISTS_NAME on ARTISTS ( > lower(AR_NAME) > ); > Te index is over a colum with this definition: > AR_NAME VARCHAR(256) null, > I want to optimize this query: > select * fro

Re: [PERFORM] FW: Index usage

2004-11-24 Thread gnari
From: "BBI Edwin Punzalan" <[EMAIL PROTECTED]> > > Yes, the database is being vacuum-ed and analyzed on a daily basis. > then you should consider increating the statistics on the date column, as the estimates were a bit off in the plan > Our version is 7.2.1 upgrade time ? gnari --

Re: [PERFORM] Slow execution time when querying view with WHERE clause

2004-11-24 Thread Mike Mascari
Tom Lane wrote: Um ... doh ... analyze.c about line 1550: /* We can only compute valid stats if we found some non-null values. */ if (nonnull_cnt > 0) ... There's a bit of an epistemological issue here: if we didn't actually find any nonnull values in our sample, is it legitimate to

Re: [PERFORM] Postgres vs. MySQL

2004-11-24 Thread Steinar H. Gunderson
On Wed, Nov 24, 2004 at 02:14:18PM +0100, Evilio del Rio wrote: > I have installed the dspam filter > (http://www.nuclearelephant.com/projects/dspam) on our mail server > (RedHat 7.3 Linux with sendmail 8.13 and procmail). I have ~300 users > with a quite low traffic of 4000 messages/day. So it's a

[PERFORM] Hardware purchase question

2004-11-24 Thread Bo Stewart
We currently are utilizing postgresql on 2 servers with the following configuration: 2 - 2.4 Ghz Xeon processors 4GB ram 4 36gb 1rpm scsi drives configured for raid 10 We started out with one server and as we became IO bound we added the second. We are currently considering purchasing anoth

Re: [PERFORM] [pgsql-hackers-win32] scalability issues on win32

2004-11-24 Thread Reini Urban
Merlin Moncure schrieb: Following is the promised writeup in performance related issues comparing win32 with linux x86 and linux x86-64. Unfortunately, the 64 bit portion of the test is not yet completed and won't be for a bit. However there are some telling things about the win32/linux comparison

Re: [PERFORM] [pgsql-hackers-win32] scalability issues on win32

2004-11-24 Thread Dave Page
> -Original Message- > From: Bruce Momjian [mailto:[EMAIL PROTECTED] > Sent: 23 November 2004 15:06 > To: Dave Page > Cc: Merlin Moncure; [EMAIL PROTECTED]; > PostgreSQL Win32 port list > Subject: Re: [pgsql-hackers-win32] scalability issues on win32 > > The general opinion of server

Re: [PERFORM] [pgsql-hackers-win32] scalability issues on win32

2004-11-24 Thread Dave Page
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf > Of Bruce Momjian > Sent: 23 November 2004 02:26 > To: Merlin Moncure > Cc: [EMAIL PROTECTED]; PostgreSQL Win32 port list > Subject: Re: [pgsql-hackers-win32] scalability issues on win32 > > > This

[PERFORM] HELP speed up my Postgres

2004-11-24 Thread JM
Hi ALL, Ive been using postgres for 3 years and now we are having problems with its performance. Here are some givens.. We have 260 subscription tables per Database. We have 2 databases. Our main client has given

Re: [PERFORM] HELP speed up my Postgres

2004-11-24 Thread Vishal Kashyap @ [SaiHertz]
Dear JM , > Ive been using postgres for 3 years and now we are having problems > with its PostgrSQL version please -- With Best Regards, Vishal Kashyap. Lead Software Developer, http://saihertz.com, http://vishalkashyap.tk ---(end of broadcast)

Re: [PERFORM] HELP speed up my Postgres

2004-11-24 Thread JM
PG Version 7.3.4 On Thursday 25 November 2004 14:12, Vishal Kashyap @ [SaiHertz] wrote: > Dear JM , > > > Ive been using postgres for 3 years and now we are having > > problems with its > > PostgrSQL version please ---(end of broadcast)---

Re: [PERFORM] HELP speed up my Postgres

2004-11-24 Thread Tom Lane
JM <[EMAIL PROTECTED]> writes: > PG Version 7.3.4 Avoid the "IN (subselect)" construct then. 7.4 is the first release that can optimize that in any real sense. regards, tom lane ---(end of broadcast)--- TIP 5: Have you chec

Re: [PERFORM] HELP speed up my Postgres

2004-11-24 Thread Klint Gore
On Thu, 25 Nov 2004 14:00:32 +0800, JM <[EMAIL PROTECTED]> wrote: > update SUBSCRIPTIONTABLE set ACTIVEFLAG='Y' where mobile_num in > (select > mobile_num from LOADED_MOBILE_NUMBERS) does loaded_mobile_numbers have a primary key or index on mobile_num? same for subscriptiontable? h

Re: [PERFORM] HELP speed up my Postgres

2004-11-24 Thread Christopher Kings-Lynne
update SUBSCRIPTIONTABLE set ACTIVEFLAG='Y' where mobile_num in (select mobile_num from LOADED_MOBILE_NUMBERS) Change to: update SUBSCRIPTIONTABLE set ACTIVEFLAG='Y' where exists (select 1 from LOADED_MOBILE_NUMBERS lmn where lmn.mobile_num=SUBSCRIPTIONTABLE.mobile_num); That should run a lot