Re: [PERFORM] help with query

2004-08-19 Thread Jean-Luc Lachance
how about: SELECT distinct main.oid,main.* FROM Tickets main WHERE main.EffectiveId = main.id AND main.Status != 'deleted' AND ( main.Type = 'ticket' OR main.Type = 'subticket' ) AND ( main.Queue = '9' ) AND ( main.id = '17417' OR main.id IN ( SELECT DISTINCT LocalTarget from Links where

Re: [PERFORM] *very* inefficient choice made by the planner (regarding

2004-06-10 Thread Jean-Luc Lachance
I agree, but it should be a simple rewrite. No? x IS NULL/IS NOT NULL AND/OR NOT EXISTS Tom Lane wrote: Jean-Luc Lachance <[EMAIL PROTECTED]> writes: If the two statments are functionally equivalent, why can't PG rewrite the "NOT IN" version into the more efficient "

Re: [PERFORM] *very* inefficient choice made by the planner (regarding

2004-06-10 Thread Jean-Luc Lachance
The real question is: If the two statments are functionally equivalent, why can't PG rewrite the "NOT IN" version into the more efficient "NOT EXISTS"? Frank van Vugt wrote: L.S. Could anybody explain why the planner is doing what it is doing? What could I do to make it easier to choose a better

Re: [PERFORM] Compare rows

2003-10-08 Thread Jean-Luc Lachance
Here is what i think you can use: One master table with out duplicates and one anciliary table with duplicate for the day. Insert the result of the select from the anciliary table into the master table, truncate the anciliary table. select distinct on ( {all the fields except day}) * from table

Re: [PERFORM] count(*) slow on large tables

2003-10-03 Thread Jean-Luc Lachance
file. We all know this has been an issue many times. Having a different index file structure when the index is not UNIQUE would help too. The last page of a non unique index could hold more stats. Christopher Browne wrote: > > [EMAIL PROTECTED] (Jean-Luc Lachance) writes: > > That&

Re: [PERFORM] count(*) slow on large tables

2003-10-02 Thread Jean-Luc Lachance
That's one of the draw back of MVCC. I once suggested that the transaction number and other house keeping info be included in the index, but was told to forget it... It would solve once and for all the issue of seq_scan vs index_scan. It would simplify the aggregate problem. Bruno Wolff III wro

Re: [PERFORM] SELECT's take a long time compared to other DBMS

2003-09-04 Thread Jean-Luc Lachance
You forgot that the original poster's query was: SELECT * from This should require a simple table scan. NO need for stats. Either the table has not been properly vacuumed or he's got seq_scan off... JLL Nick Fankhauser wrote: > > > Yes I Analyze also, but there was no need to because it wa

Re: [PERFORM] Hardware performance

2003-07-17 Thread Jean-Luc Lachance
Sorry for the redundant duplication of the repetition. I should have read the follow-up messages. Joe Conway wrote: > > Jean-Luc Lachance wrote: > > I am currious. How can you have RAID 1+0 with only 2 drives? > > If you are thinking about partitioning the drives, won

Re: [PERFORM] Hardware performance

2003-07-17 Thread Jean-Luc Lachance
I am currious. How can you have RAID 1+0 with only 2 drives? If you are thinking about partitioning the drives, wont this defeate the purpose? JLL Joe Conway wrote: > > [...] > 2 drives, RAID 1+0: WAL > 2 drives, RAID 1+0: data > [...] ---(end of broadcast)--