vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| > > Since that costs, I guess I would make it optional and combine it with > > materialized views that are automatically used at runtime, and can at > > the same time answer other aggregates or aggregates for groups. > > create materialized view xx_agg enable query rewrite as select > > count(*), sum (col1) from xx [group by col2]; > > > > I wonder how many times you really need a count(*) w/o where clause. > If I understand you correctly you are trying to optimize just this one case? I guess you have not read to the end. A materialized view with a group by as indicated in the example is able to answer all sorts of queries with or without where clauses ( e.g. ... where col2 = 'x'). Andreas ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match |
| ||||
| Zeugswetter Andreas DCP SD schrieb: >>>Since that costs, I guess I would make it optional and combine it > > with > >>>materialized views that are automatically used at runtime, and can > > at > >>>the same time answer other aggregates or aggregates for groups. >>>create materialized view xx_agg enable query rewrite as select >>>count(*), sum (col1) from xx [group by col2]; >>> >> >>I wonder how many times you really need a count(*) w/o where clause. >>If I understand you correctly you are trying to optimize just this one > > case? > > I guess you have not read to the end. A materialized view with a group > by > as indicated in the example is able to answer all sorts of queries > with or without where clauses ( e.g. ... where col2 = 'x'). But wouldn't that mean I need a materialized view (does we have that now or do I need to play the usual games with triggers?) for every possible where condition? ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly |