Re: Cobol Linear search Vs Perfrom Until

From: Michael Mattias (michael.mattias_at_gte.net)
Date: 07/17/04


Date: Sat, 17 Jul 2004 12:38:01 GMT


"Glenn Someone" <dontspamme@whydoyouneedmyaddressspammers.com> wrote in
message news:cr4hf0pvffrpbcjaqesblqubkvgm9mtdql@4ax.com...
> But one important caveat. It's never a good thing performance wise to
> sort a table just to be able to perform a binary search, unless the
> payback for doing it is significant. While the binary search beats
> the pants off the sequential search, sorting the data can and will
> negate that benefit and then some, unless you do perform 1000's of
> searches.

In this particular case, it certainly appears worth the effort..

The OP said his change from SEARCH ALL to SEARCH had resulted in a
twelvefold increase in run time (a number which, frankly, causes me to doubt
the quality of either the change in implementation or the measurement
technique... although asked, I can't find the number of table items
involved, so it's possible).

I have often said, and published the same thoughts, that performance tuning
is ALWAYS about specific cases... there is no "silver bullet" which solves
all performance problems...

Except... there is one technique which ALWAYS produces the best results:
applied imagination.

--
Michael Mattias
Tal Systems, Inc.
Racine WI
mmattias@talsystems.com


Relevant Pages

  • Re: ORDER BY and IDENTITY
    ... >> Technique 2) to produce identity values that don't reflect the sort. ... >> The way I see it, if Technique 1 doesn't guarantee anything, I'd be very ... >> BG, SQL Server MVP ...
    (microsoft.public.sqlserver.programming)
  • Re: ORDER BY and IDENTITY
    ... > Technique 2) to produce identity values that don't reflect the sort. ... > The way I see it, if Technique 1 doesn't guarantee anything, I'd be very ... >> resulting in the Sort operation happening before the Compute Scalar ...
    (microsoft.public.sqlserver.programming)
  • Re: ANN: Kamaelia 0.2.0 released!
    ... If you want a server to split and serve audio, ... >> (I mean proper encryption here, the sort GCHQ or the NSA can't break) ... That's pretty much a well-known technique ...
    (comp.lang.python)
  • Re: ORDER BY and IDENTITY
    ... I guess I'm the MVP you're referring to here, ... Technique 2) to produce identity values that don't reflect the sort. ... The way I see it, if Technique 1 doesn't guarantee anything, I'd be very ...
    (microsoft.public.sqlserver.programming)
  • Re: A faster way of finding historical highs/lows
    ... >>using sort(), then a binary search. ... By binary search, ... If you have this in a relational database, ... database can answer the question quicker for you, ...
    (comp.lang.python)