<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
how obscene is 1500 records in memory? on a 3ghz machine with 1gb of
ram thats like wondering if your wallet will miss 5 cents.<br>
<br>
I'll happily cache 100000 records in memory, as long as its updated
properly, and do my seeks un 300ms on that kind of search. RAM is no
magical wonderbeing. the purpose of increasing ram is so that you can
use it for such things,<br>
<br>
Jeremy Coulter wrote:
<blockquote cite="mid051f01c4aca4$236ac3b0$0201a8c0@vssmain" type="cite">
  <meta http-equiv="Content-Type" content="text/html; ">
  <title>Message</title>
  <meta content="MSHTML 6.00.2800.1458" name="GENERATOR">
  <div><span class="109472219-07102004"><font face="Arial" size="2">HI
All.</font></span></div>
  <div><span class="109472219-07102004"></span>&nbsp;</div>
  <div><span class="109472219-07102004"><font face="Arial" size="2">We
have a database that stores phone numbers but Country Code and location
code.</font></span></div>
  <div><span class="109472219-07102004"></span>&nbsp;</div>
  <div><span class="109472219-07102004"><font face="Arial" size="2">i.e.
0061 - australia, &nbsp;786 - gold coast</font></span></div>
  <div><span class="109472219-07102004"></span>&nbsp;</div>
  <div><span class="109472219-07102004"><font face="Arial" size="2">We
pass a number to a function, and this function finds where the number
is for.</font></span></div>
  <div><span class="109472219-07102004"></span>&nbsp;</div>
  <div><span class="109472219-07102004"><font face="Arial" size="2">The
location code has a max length of 9 numbers, and so what I do is
currently loop&nbsp;FOR x:=9 downto 1, and it querys the DB i.e. select *
from the_table where location = copy(number,1,x)</font></span></div>
  <div><span class="109472219-07102004"><font face="Arial" size="2">BUT
I REALLY thik this is bad...whilst it works, its not prob. the best
thing to do....i.e. potentually 9 querys to a db.</font></span></div>
  <div><span class="109472219-07102004"></span>&nbsp;</div>
  <div><span class="109472219-07102004"><font face="Arial" size="2">There
HAS to be a better way to do this !</font></span></div>
  <div><span class="109472219-07102004"><font face="Arial" size="2">I
did think maybe of storing the data into a collection and itterating
thru the collection which would be a HELL of a lot faster than going to
the DB, but how obscene would it be to store over 1500 records into
memory?</font></span></div>
  <div><span class="109472219-07102004"></span>&nbsp;</div>
  <div><span class="109472219-07102004"><font face="Arial" size="2">I
thought there might be away to do it even in an SQL statement, but I
cant think of how to structure it....this is an Access DB too, although
after xmas it will be MS SQL Server (and MSDE).</font></span></div>
  <div><span class="109472219-07102004"></span>&nbsp;</div>
  <div><span class="109472219-07102004"><font face="Arial" size="2">If
anyone has some thoughts, let me know.....this should get the list
going again :-D</font></span></div>
  <div><span class="109472219-07102004"></span>&nbsp;</div>
  <div><span class="109472219-07102004"><font face="Arial" size="2">Jeremy</font></span></div>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
Delphi mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Delphi@ns3.123.co.nz">Delphi@ns3.123.co.nz</a>
<a class="moz-txt-link-freetext" href="http://ns3.123.co.nz/mailman/listinfo/delphi">http://ns3.123.co.nz/mailman/listinfo/delphi</a>
  </pre>
</blockquote>
</body>
</html>