Re: [PERFORM] cache table

2004-05-04 Thread scott.marlowe
On Mon, 3 May 2004, Joseph Shraibman wrote: I have a big table with some int fields. I frequently need to do queries like: SELECT if2, count(*) FROM table WHERE if1 = 20 GROUP BY if2; The problem is that this is slow and frequently requires a seqscan. I'd like to cache the results in

Re: [PERFORM] cache table

2004-05-04 Thread Joseph Shraibman
scott.marlowe wrote: I think you might be interested in materialized views. You could create this as a materialized view which should be very fast to just select * from. That seems to be the count table I envisioned. It just hides the details for me. It still has the problems of an extra

[PERFORM] cache table

2004-05-03 Thread Joseph Shraibman
I have a big table with some int fields. I frequently need to do queries like: SELECT if2, count(*) FROM table WHERE if1 = 20 GROUP BY if2; The problem is that this is slow and frequently requires a seqscan. I'd like to cache the results in a second table and update the counts with triggers,