RE: [PHP-WIN] Random Code

From: Date: Fri, 26 Jan 2001 11:29:18 +0000
Subject: RE: [PHP-WIN] Random Code
Groups: php.windows 
Request: Send a blank email to php-windows+get-5219@lists.php.net to get a copy of this message
>-----Original Message----- >From: phobo [mailto:antiphobo@paradise.net.nz] >Sent: Tuesday, January 23, 2001 9:48 PM >To: php-windows@lists.php.net >Subject: Re: [PHP-WIN] Random Code > > >Oops, 36^8 :) > >This value would only have to generated perhaps a few times an hour, but >should't take more than a second to compute. These values ARE being stored >in a database; however, once this database gets to a million or so rows, it >would take a very long time to check it doesn't overlap, wont it? I don't belive it will take seconds to look up the result (that would be very bad performance of the RDBMS then...) If you just index the data properly, then most time probably will be spent transferring the answer over the network (that is if you use a network:). If your time constraints is within a second, and you do not need to generate the numbers more often than a few times in a hour, then why not do it? I have a table (among others) with 3.368.713 rows in my database. This is an execute example of an look up onto an attribute with an index in the database: I executed this query: select getdate() select count(*) from luAccNr where AccNr = 'X02612' select getdate() The result: -------------------------- 2001-01-26 12:14:24.717 (1 row(s) affected) pkAccNr AccNr Speice ----------- ---------------- ------ 629888 X02612 1 (1 row(s) affected) --------------------------- 2001-01-26 12:14:24.763 (1 row(s) affected) As you can see, the execution time for the query is not even a question of tenth of second, but down to about 50ms. And this includes to execute the getdate() functions too. Best regards, Anders

« previous php.windows (#5219) next »