Hi Pete,
Yes, I missed the 1 off the end, when I pasted the statement in.

I'll use the DESC LIMIT method as you suggest.
Thanks for all your help.

Haven't tried timing anything yet (don't panic), I've got an example.
Maybe my next thing to brush up on.
Regards, Bob.


----- Original Message ----- 
From: "Pete" <[EMAIL PROTECTED]>

> In message <[EMAIL PROTECTED]>, Mike Franks
> <[EMAIL PROTECTED]> writes
>>Instead, you perform efficient searches by creating indexes on certain
>>fields.  Even indexes *can* cause performance degradation (when
>>inserting or updating), so don't overdo it.
> 
> Once again, the words "it depends".  It depends on where you want the
> delays.  When you are inputting, or when you are outputting.
> 
> My staff are entering the data, with loads of indexes.  For them, there
> is a slight delay.  They know about it, and can deal with it.
> 
> My visitors are seeing no delays, because the indexes are done.
> 
> I *could* do it the other way round - no indexes, so that it is faster
> for the staff, and slower for the visitor.  
> 
> Logically,  the first method is better.  Give the public what they want.
> Speed...
> 
>>Once the column is indexed, your initial query will actually be fastest
>>in a large data base:
>>
>>select *
>>from table
>>where ....
>>order by indexed_date_column desc limit 1;
> 
> I am not sure (and, if I am totally honest, can't be arsed testing!) how
> much faster than MAX(), which could well use the same index.  
> 
> But DESC LIMIT is the preferred method, because everyone can read the
> code.



Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to