Python Forum
Which is Faster, List or SQL
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Which is Faster, List or SQL
#10
(Mar-16-2017, 09:26 PM)nilamo Wrote:
(Mar-16-2017, 09:13 PM)zivoni Wrote: Maybe you can "partition" your list somehow and process it in smaller batches?

map/reduce with external computers?  *giddy excitement*

If you're doing this more than once, then you're probably storing the data somewhere.  Like a file maybe?  If you're reading it every time, adding new things, and repeating, every single day, with whatever you generate needing to be available for the future... I think you should go with a db.  Even something small like sqlite.  Then the db can handle picking a few at random for you to use to generate new urls, you can quickly check if those generated urls already exist, add them to the existing tables, and move on.  

This sounds a lot like the sort of problem a database is designed to solve.

I do store the results in a csv file, however i only read once and simply append any non matched urls (however this doesnt always work)

Its ok for the first 1000 URLs but after that it starts missing a few and duplicating a few, i run a second code that uses sets to clean it up after and i dropped ftom 154k to 150k when i last ran it.

I will look into creating a db as it will be easier to access multiple times rather than using a file.

to give you more of a scope this is for a demo of network usage on a cluster computer. going to use 10-20 Raspberry Pis' and generate as much traffic from differenct sources and protocols as possible.
Reply


Messages In This Thread
Which is Faster, List or SQL - by AceScottie - Mar-16-2017, 06:29 PM
RE: Which is Faster, List or SQL - by micseydel - Mar-16-2017, 06:33 PM
RE: Which is Faster, List or SQL - by AceScottie - Mar-16-2017, 06:45 PM
RE: Which is Faster, List or SQL - by Larz60+ - Mar-16-2017, 06:41 PM
RE: Which is Faster, List or SQL - by micseydel - Mar-16-2017, 07:09 PM
RE: Which is Faster, List or SQL - by wavic - Mar-16-2017, 07:23 PM
RE: Which is Faster, List or SQL - by micseydel - Mar-16-2017, 07:44 PM
RE: Which is Faster, List or SQL - by zivoni - Mar-16-2017, 09:13 PM
RE: Which is Faster, List or SQL - by nilamo - Mar-16-2017, 09:26 PM
RE: Which is Faster, List or SQL - by AceScottie - Mar-16-2017, 10:15 PM
RE: Which is Faster, List or SQL - by wavic - Mar-16-2017, 10:23 PM
RE: Which is Faster, List or SQL - by Larz60+ - Mar-17-2017, 02:31 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020