Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Re: Problem with database under Win32

by NetWallah (Canon)
on Nov 23, 2003 at 16:47 UTC ( #309301=note: print w/replies, xml ) Need Help??


in reply to Re: Problem with database under Win32
in thread Problem with database under Win32

Using SELECT TOP 1 From ..... ORDER BY ID DESC may be faster than trying a "Max".

I am not a SQL weenie though - you may want to check with your DBA as to why the subquery seems "slower".

  • Comment on Re: Re: Problem with database under Win32

Replies are listed 'Best First'.
Re: Re: Re: Problem with database under Win32
by l3nz (Friar) on Nov 23, 2003 at 19:34 UTC
    I am not sure - if you MAX() an index, you usually get top performance with no disk access at all; in any other case you need a table scan to know all the values, so you can max() them. My actual query is not any way similar to the one I am presenting here (it's a five-page belemoth, just in the case you wonder, even with all repeated subqueries extracted!)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://309301]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (1)
As of 2022-01-17 04:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (51 votes). Check out past polls.

    Notices?