Re: [PERFORM] Identical Queries

2007-03-01 Thread Chad Wagner
On 3/1/07, Rob Schall <[EMAIL PROTECTED]> wrote: There are 4 entries (wanted to make the playing field level for this test). There are 2 with true for istf and 2 with false. Then the difference here has to do with using orignum vs destnum as the join criteria. There must be more intersection

Re: [PERFORM] Very slow queries

2007-01-31 Thread Chad Wagner
On 1/31/07, Sidar López Cruz <[EMAIL PROTECTED]> wrote: Executing these query take: Query returned successfully: 290 rows affected, 2542387 ms execution time. I think that's too many time I would post the plans that you are getting, otherwise just mentioning the execution time is not very hel

Re: [PERFORM] Very slow queries

2007-01-30 Thread Chad Wagner
On 1/30/07, Sidar López Cruz <[EMAIL PROTECTED]> wrote: query: Delete From ceroriesgo.salarios Where numero_patrono Not In (Select numero_patrono From ceroriesgo.patronos) Seq Scan on salarios (cost=51021.78..298803854359.95 rows=14240077 width=6) Filter: (NOT (subplan)) SubPlan -> Ma

Re: [PERFORM] Querying distinct values from a large table

2007-01-30 Thread Chad Wagner
On 1/30/07, Luke Lonergan <[EMAIL PROTECTED]> wrote: Not that it helps Igor, but we've implemented single pass sort/unique, grouping and limit optimizations and it speeds things up to a single seqscan over the data, from 2-5 times faster than a typical external sort. Was that integrated back

Re: [PERFORM] Querying distinct values from a large table

2007-01-30 Thread Chad Wagner
On 1/30/07, Simon Riggs <[EMAIL PROTECTED]> wrote: > explain analyze select distinct a, b from tbl > > EXPLAIN ANALYZE output is: > > Unique (cost=500327.32..525646.88 rows=1848 width=6) (actual > time=52719.868..56126.356 rows=5390 loops=1) > -> Sort (cost=500327.32..508767.17 rows=337

Re: [PERFORM] extract(field from timestamp) vs date dimension

2007-01-23 Thread Chad Wagner
On 1/23/07, Tobias Brox <[EMAIL PROTECTED]> wrote: Ralph Kimball seems to be some kind of guru on data warehousing, and in his books he's strongly recommending to have a date dimension - simply a table describing all dates in the system, and having I would tend to agree with this line of thou

Re: [PERFORM] Configuration Advice

2007-01-17 Thread Chad Wagner
On 1/17/07, Steve <[EMAIL PROTECTED]> wrote: However, I will look into this and see if I can figure out this average value. This may be a valid idea, and I'll look some more at it. It must be, Oracle sells it pretty heavily as a data warehousing feature ;). Oracle calls it a materia

Re: [PERFORM] Configuration Advice

2007-01-17 Thread Chad Wagner
On 1/17/07, Steve <[EMAIL PROTECTED]> wrote: However, each night we load data from a legacy cobol system into the SQL system and then we summarize that data to make the reports faster. This load process is intensely insert/update driven but also has a hefty amount of selects as well. This load

Re: [PERFORM] PG8.2.1 choosing slow seqscan over idx scan

2007-01-17 Thread Chad Wagner
On 1/17/07, Jeremy Haile <[EMAIL PROTECTED]> wrote: Maybe - I tried running the same query for an older time range that is less likely to be cached. The index scan took longer than my previous example, but still only took 16 seconds, compared to the 87 seconds required to seqscan the table. Wh

Re: [PERFORM] PG8.2.1 choosing slow seqscan over idx scan

2007-01-16 Thread Chad Wagner
On 1/16/07, Jeremy Haile <[EMAIL PROTECTED]> wrote: The table is heavily inserted and deleted from. Recently I had done a very large delete. That's what I suspected. Here is the results of the query you sent me: (sorry it's hard to read) "transaction_date";0;8;172593;-0.194848 Just curi

Re: [PERFORM] PG8.2.1 choosing slow seqscan over idx scan

2007-01-16 Thread Chad Wagner
On 1/16/07, Jeremy Haile <[EMAIL PROTECTED]> wrote: Even if unrelated, do you think disk fragmentation would have negative effects? Is it worth trying to defragment the drive on a regular basis in Windows? Out of curiosity, is this table heavily updated or deleted from? Perhaps there is an