<HTML><BODY>
<DIV>Yes this data Is static...I should have mentioned that. </DIV>
<DIV>&nbsp;</DIV>
<DIV>Jeremy<BR></DIV>
<BLOCKQUOTE style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; 
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">-----Original 
Message-----<BR>From: "Stephen Bertram" 
&lt;stephen.bertram@ensynergy.co.nz&gt;<BR>To: "NZ Borland Developers Group 
- Delphi List" &lt;delphi@ns3.123.co.nz&gt;<BR>Date: Fri, 8 Oct 2004 
10:13:10 +1300<BR>Subject: RE: [DUG] there has to be a better way to do 
this....<BR><BR>
<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">You are right in 
this case Kyley as the data is static – I can’t see major changes to the ISD 
codes every 10 minutes </SPAN></FONT><FONT face=Wingdings color=navy size=2>
<SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Wingdings">J</SPAN>
</FONT><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; 
COLOR: navy; FONT-FAMILY: Arial">.<?xml:namespace prefix = o /><o:p></o:p>
</SPAN></FONT></DIV>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p>
</SPAN></FONT></DIV>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">But in general, 
where you are searching against a changing database, it is preferable to run 
the query aganst the live data provided that you are dealing with a 
manageable number of simultaneous users (&lt; 1000).<o:p></o:p></SPAN></FONT>
</DIV>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p>
</SPAN></FONT></DIV>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">$0.02<o:p></o:p>
</SPAN></FONT></DIV>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p>
</SPAN></FONT></DIV>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Stephen<o:p></o:p>
</SPAN></FONT></DIV>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p>
</SPAN></FONT></DIV>
<DIV>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT 
face="Times New Roman" color=black size=3><SPAN lang=EN-US style="FONT-SIZE: 
12pt; COLOR: windowtext">
<HR tabIndex=-1 align=center width="100%" SIZE=2>
</SPAN></FONT></DIV>
<P class=MsoNormal><B><FONT face=Tahoma color=black size=2><SPAN lang=EN-US 
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: windowtext; FONT-FAMILY: 
Tahoma">From:</SPAN></FONT></B><FONT face=Tahoma color=black size=2><SPAN 
lang=EN-US style="FONT-SIZE: 10pt; COLOR: windowtext; FONT-FAMILY: Tahoma"> 
delphi-bounces@ns3.123.co.nz [mailto:delphi-bounces@ns3.123.co.nz] <B><SPAN 
style="FONT-WEIGHT: bold">On Behalf Of </SPAN></B>Kyley Harris<BR><B><SPAN 
style="FONT-WEIGHT: bold">Sent:</SPAN></B> Friday, 8 October 2004 9:51 
a.m.<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> vss@vss.co.nz; 
<?xml:namespace prefix = st1 /><st1:PersonName w:st="on">NZ Borland 
Developers Group - Delphi List</st1:PersonName><BR><B><SPAN 
style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: [DUG] there has to be a 
better way to do this....</SPAN></FONT><FONT color=black><SPAN lang=EN-US 
style="COLOR: windowtext"><o:p></o:p></SPAN></FONT></DIV></DIV>
<P class=MsoNormal><FONT face="Times New Roman" color=black size=3><SPAN 
style="FONT-SIZE: 12pt"><o:p>&nbsp;</o:p></SPAN></FONT></DIV>
<P class=MsoNormal><FONT face="Times New Roman" color=black size=3><SPAN 
style="FONT-SIZE: 12pt">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: <o:p></o:p></SPAN></FONT></DIV>

<DIV>
<P class=MsoNormal><FONT face=Arial color=black size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">HI All.</SPAN></FONT><o:p></o:p>
</DIV></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" color=black size=3><SPAN 
style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></DIV></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial color=black size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">We have a database that stores 
phone numbers but Country Code and location code.</SPAN></FONT><o:p></o:p>
</DIV></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" color=black size=3><SPAN 
style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></DIV></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial color=black size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">i.e. 0061 - <st1:country-region 
w:st="on"><st1:place w:st="on">australia</st1:place></st1:country-region>, 
&nbsp;786 - gold coast</SPAN></FONT><o:p></o:p></DIV></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" color=black size=3><SPAN 
style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></DIV></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial color=black size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">We pass a number to a function, 
and this function finds where the number is for.</SPAN></FONT><o:p></o:p>
</DIV></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" color=black size=3><SPAN 
style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></DIV></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial color=black size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">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)</SPAN></FONT><o:p></o:p></DIV></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial color=black size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">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.</SPAN></FONT><o:p></o:p></DIV></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" color=black size=3><SPAN 
style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></DIV></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial color=black size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">There HAS to be a better way to 
do this !</SPAN></FONT><o:p></o:p></DIV></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial color=black size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">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?</SPAN></FONT><o:p></o:p></DIV></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" color=black size=3><SPAN 
style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></DIV></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial color=black size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">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).</SPAN></FONT><o:p></o:p></DIV></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" color=black size=3><SPAN 
style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></DIV></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial color=black size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">If anyone has some thoughts, let 
me know.....this should get the list going again :-D</SPAN></FONT><o:p></o:p>
</DIV></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" color=black size=3><SPAN 
style="FONT-SIZE: 12pt">&nbsp;<o:p></o:p></SPAN></FONT></DIV></DIV>
<DIV>
<P class=MsoNormal><FONT face=Arial color=black size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Jeremy</SPAN></FONT><o:p></o:p>
</DIV></DIV><PRE wrap=""><FONT face="Courier New" color=black size=2><SPAN 
style="FONT-SIZE: 10pt"><o:p>&nbsp;</o:p></SPAN></FONT></PRE><PRE 
style="TEXT-ALIGN: center"><FONT face="Courier New" color=black size=2><SPAN 
style="FONT-SIZE: 10pt">

<HR align=center width="90%" SIZE=4>

</SPAN></FONT></PRE><PRE><FONT face="Courier New" color=black size=2><SPAN 
style="FONT-SIZE: 10pt"><o:p>&nbsp;</o:p></SPAN></FONT></PRE><PRE><FONT 
face="Courier New" color=black size=2><SPAN style="FONT-SIZE: 10pt">
_______________________________________________<o:p></o:p></SPAN></FONT>
</PRE><PRE><st1:place w:st="on"><FONT face="Courier New" color=black size=2>
<SPAN style="FONT-SIZE: 10pt">Delphi</SPAN></FONT></st1:place> mailing 
list<o:p></o:p></PRE><PRE><FONT face="Courier New" color=black size=2><SPAN 
style="FONT-SIZE: 10pt"><A href="mailto:Delphi@ns3.123.co.nz">
Delphi@ns3.123.co.nz</A><o:p></o:p></SPAN></FONT></PRE><PRE><FONT 
face="Courier New" color=black size=2><SPAN style="FONT-SIZE: 10pt"><A 
href="http://ns3.123.co.nz/mailman/listinfo/delphi">
http://ns3.123.co.nz/mailman/listinfo/delphi</A><o:p></o:p></SPAN></FONT>
</PRE><PRE><FONT face="Courier New" color=black size=2><SPAN 
style="FONT-SIZE: 10pt">&nbsp; <o:p></o:p></SPAN></FONT></PRE></DIV>
<DIV>
<DIV><FONT size=2>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
<BR>This communication contains information that is confidential and the 
copyright of ensynergy Limited or a third party. <BR><BR>If you are not the 
intended recipient of this communication please delete and destroy all 
copies and telephone ensynergy Limited on +64 9 3551591 immediately. If you 
are the intended recipient of this communication you should not copy, 
disclose or distribute this communication without the authority of ensynergy 
Limited. <BR><BR>Any views expressed in this communication are those of the 
individual sender, except where the sender specifically states them to be 
the views of ensynergy Limited. <BR><BR>Except as required by law, ensynergy 
Limited does not represent, warrant and/or guarantee that the integrity of 
this communication has been maintained nor that the communication is free of 
errors, virus, interception or interference. <BR></FONT></DIV></DIV>
</BLOCKQUOTE>
</BODY></HTML>