Re: [PERFORM] Efficiency of timestamps

2003-07-08 Thread Martin Foster
Stephan Szabo wrote: Well, the reason I asked is to see both whether the estimates for the various columns were somewhere near reality (if not, then you may need to raise the statistics target for the column) which might affect whether it'd consider using a multi-column index for the conditions and

Re: [PERFORM] Efficiency of timestamps

2003-07-08 Thread Stephan Szabo
On Tue, 8 Jul 2003, Martin Foster wrote: > Stephan Szabo wrote: > > > The row estimate is high. How many rows meet the various conditions and > > some of the combinations? And how many rows does it estimate if you do a > > simpler query on those with explain? > > > > I still think some variety of

Re: [PERFORM] Efficiency of timestamps

2003-07-08 Thread Martin Foster
Stephan Szabo wrote: The row estimate is high. How many rows meet the various conditions and some of the combinations? And how many rows does it estimate if you do a simpler query on those with explain? I still think some variety of multi-column index to make the above index conditions would help

Re: [PERFORM] Efficiency of timestamps

2003-07-08 Thread Stephan Szabo
On Tue, 8 Jul 2003, Martin Foster wrote: > Stephan Szabo wrote: > > > > > > I think you might get better results with some kind of multi-column index. > > It's using the index to avoid a sort it looks like, but it's not helping > > to find the conditions. I can't remember the correct ordering, but

Re: [PERFORM] Efficiency of timestamps

2003-07-08 Thread Martin Foster
Stephan Szabo wrote: I think you might get better results with some kind of multi-column index. It's using the index to avoid a sort it looks like, but it's not helping to find the conditions. I can't remember the correct ordering, but maybe (posttimestamp, realmname, postidnumber). Having separ

Re: [PERFORM] Efficiency of timestamps

2003-07-08 Thread Stephan Szabo
On Tue, 8 Jul 2003, Martin Foster wrote: > As I keep looking through code to see where I can make things more > efficient, I noticed that in some cases timestamps seem horribly > inefficient. This leads to very long run times for certain queries. > > Here is an example: > > -- USING TIMESTAMPS

[PERFORM] Efficiency of timestamps

2003-07-08 Thread Martin Foster
As I keep looking through code to see where I can make things more efficient, I noticed that in some cases timestamps seem horribly inefficient. This leads to very long run times for certain queries. Here is an example: -- USING TIMESTAMPS TO NARROW DOWN -- SELECT Post.PostIDNumber, Post.P