Another way of doing multi-threading - HTTP
#10

Quote:
Originally Posted by Y_Less
View Post
This is also very true. Are you using a naive linear search or something like a binary search?
Why think about linear and binary search algorithms? Let's not reinvent the wheel. When a database is set up properly the best technique to search a set of +/- 10000 data sets will be chosen by the DBMS.

Quote:
Originally Posted by S4t3K
View Post
3) Filling the database with all the ips manually would have taken a significative amount of time. I can't clearly tell you how much since I haven't ever tried something of this kind, but I think you can guess.
Use your programming knowledge to let the computer form the required queries and simultaneously insert them into your database.

Quote:
Originally Posted by S4t3K
View Post
Well, the list is really big (at least, I consider it as very big, +- 10'000 ips), and the time eleapsed from the moment I saw the first loading sentence ("Loading filterscript...") to the moment I saw the second one ("Filterscript loaded !"), I really felt the second eleapsed.
10000 data sets are nothing for a database. Just make sure to ...
Example (10000 IPs in table for testing purposes):

Code:
mysql> SELECT * FROM `ip_table`;
+-------------+
| ip          |
+-------------+
| -2145172593 |
| -2143952536 |
| -2143817842 |
| -2142775430 |
| -2141970877 |
| -2141543934 |
| -2141495142 |
| -2140798626 |
| -2140726879 |
| ...         |
| -2140185323 |
| -2140124424 |
|  2145686361 |
|  2146865570 |
|  2147010485 |
|  2147290286 |
+-------------+
10000 rows in set (0.00 sec)

mysql> SELECT NULL FROM `ip_table` WHERE `ip` = -1819749934;
Empty set (0.00 sec)

mysql> SELECT NULL FROM `ip_table` WHERE `ip` = 2145686361;
+------+
| NULL |
+------+
| NULL |
+------+
1 row in set (0.00 sec)
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 5 Guest(s)