Re: [PERFORM] Evaluation of PG performance vs MSDE/MSSQL 2000 (not 2005)

2007-12-05 Thread ismo . tuononen
I don't know if this is true in this case, but transaction level can be different, in mssql it is normally something like TRANSACTION_READ_UNCOMMITTED in postgres TRANSACTION_READ_COMMITTED and that makes huge difference in performance. other thing can be the queries in procedures, if you use sa

Re: [PERFORM] How to improve speed of 3 table join &group (HUGE tables)

2007-10-18 Thread ismo . tuononen
Hi, how about: select sf.library_id, fio.clip_type , count(sf.sequence_id) fromsequence_fragment sf, fragment_external_info fio ,(SELECT distinct sequence_id from sequence_alignment) sa where sf.seq_frag_id = fio.sequence_frag_id and sf.sequence_id = sa.sequence_id group by s

Re: [PERFORM] truncate a table instead of vaccum full when count(*) is 0

2007-05-08 Thread ismo . tuononen
On Tue, 8 May 2007, Pomarede Nicolas wrote: > As you can see, with hundreds of thousands events a day, this table will need > being vaccumed regularly to avoid taking too much space (data and index). > > Note that processing rows is quite fast in fact, so at any time a count(*) on > this table

Re: [PERFORM] Wrong plan sequential scan instead of an index one

2007-03-30 Thread ismo . tuononen
I don't know about postgres, but in oracle it could be better to write: SELECT COUNT(distinct c.id) FROM t_oa_2_00_card c,l_pvcp l WHERE l.value ilike '%pi%' and c.pvcp=l.id; or SELECT COUNT(c.id) FROM t_oa_2_00_card c, (select distinct id from l_pvcp where value ilike '%pi%') l WHERE c.pvcp=l

Re: [PERFORM] Performance of count(*)

2007-03-22 Thread ismo . tuononen
approximated count? why? who would need it? where you can use it? calculating costs and desiding how to execute query needs approximated count, but it's totally worthless information for any user IMO. Ismo On Thu, 22 Mar 2007, Albert Cervera Areny wrote: > As you can see, PostgreSQL nee

Re: [PERFORM] Performance of count(*)

2007-03-22 Thread ismo . tuononen
explain is just "quessing" how many rows are in table. sometimes quess is right, sometimes just an estimate. sailabdb=# explain SELECT count(*) from sl_tuote; QUERY PLAN --

Re: [PERFORM] query slows down after vacuum analyze

2007-03-05 Thread ismo . tuononen
Are you sure that: SELECT count(distinct s.id) AS count_all FROM symptoms s ,symptom_reports sr,users u WHERE s.id=sr.symptom_id and sr.user_id=u.id and u.disease_id=1; is as slow as SELECT count(*) AS count_all FROM symptoms WHERE (1=1 and symptoms.id in ( select symptom_id from symptom_re

Re: [PERFORM] slow update on 1M rows (worse with indexes)

2007-02-22 Thread ismo . tuononen
how about saying: lock table versions_9d in EXCLUSIVE mode; UPDATE versions_9d SET flag=2; commit; Ismo On Thu, 22 Feb 2007, Gabriel Biberian wrote: > Hello, > > I experience significant performance issues with postgresql and updates. > I have a table which contains ~1M rows. > Layout: > TOTO

Re: [PERFORM] slow subselects

2007-02-19 Thread ismo . tuononen
try: select studentid,max(score) from studentprofile group by studentid; or if you want only those which exists in students select s.studentid,max(p.score) from studentprofile p,students s where s.studentid=p.studentid group by s.studentid; if it takes longer than 1-2 seconds something is seri

[PERFORM] many instances or many databases or many users?

2007-02-13 Thread ismo . tuononen
Hi, I have used postgresql some years now, but only small databases and only one database per instance and one user per database. Now we have a server reserved only for postgresql, and I'm wondering if it is better to set up: - only one instance and many databases or - many instances and only o