mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Software

Reply
 
Thread Tools
Old 2023-02-19, 22:41   #1
Tyler Busby
 
Tyler Busby's Avatar
 
Jan 2023

2×31 Posts
Default Best RDBMS for arbitrarily large integers?

Hi! I wasn't sure where to ask, so I made a thread here. I was curious if anybody here had experience with using an RDBMS for storing things like large prime candidates to test, composites to factor, etc. My application would have a small enough scope to where I'd use the lightest-weight one possible (probably SQLite) if all things were equal. But it seems like the type of thing a certain RDBMS might have better support for (I'd guess postgres or maybe something I've never heard of).

Obviously you'd want to store large integers as more compact expressions and whatnot when possible. And I could, of course, spend all sorts of time implementing arbitrary integer features on top of blobs on a RDBMS system that doesn't really have great existing support, but I figured this is exactly the type of thing that someone has probably figured out before me.

I did attempt to see what RDBMS factordb is using, as I assume that's the most successful project close to what I'm hoping to implement to myself, but it doesn't seem to have been discussed anywhere that I could find (or on the website). And I'd bug Markus, but I already have a small feature request I've sent him, so I didn't want to bug him more :)

Thanks!
Tyler Busby is offline   Reply With Quote
Old 2023-02-19, 22:54   #2
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

468510 Posts
Default

https://www.sqlite.org/limits.html says 1,000,000,000 for text and blob.
paulunderwood is offline   Reply With Quote
Old 2023-02-20, 04:56   #3
axn
 
axn's Avatar
 
Jun 2003

23·683 Posts
Default

Postgres supports numbers upto 131k digits natively (i.e. you can do arithmetic with it).

Almost all DBs support LOBs (Large Objects) - both Binary and Character variants. Typical size is 2^31 bytes / characters. However, the DB only assists with storing -- any maths on it will need to be done outside.


I suspect FactorDB will be using either mysql or postgres, as these are the most popular "free" RDBMS.
axn is offline   Reply With Quote
Old 2023-02-20, 09:55   #4
xilman
Bamboozled!
 
xilman's Avatar
 
"๐’‰บ๐’ŒŒ๐’‡ท๐’†ท๐’€ญ"
May 2003
Down not across

2×17×347 Posts
Default

I keep my factoring data in PostgreSQL.

If you wish, I could provide you with the schema in use.
xilman is offline   Reply With Quote
Old 2023-02-20, 16:16   #5
Tyler Busby
 
Tyler Busby's Avatar
 
Jan 2023

2×31 Posts
Default

Quote:
Originally Posted by xilman View Post
I keep my factoring data in PostgreSQL.

If you wish, I could provide you with the schema in use.
That would be lovely if you don't mind! I'm sure it would be a great starting point.
Tyler Busby is offline   Reply With Quote
Old 2023-02-20, 16:26   #6
chris2be8
 
chris2be8's Avatar
 
Sep 2009

25·7·11 Posts
Default

Quote:
Originally Posted by Tyler Busby View Post
I did attempt to see what RDBMS factordb is using, as I assume that's the most successful project close to what I'm hoping to implement to myself, but it doesn't seem to have been discussed anywhere that I could find (or on the website).
I've seen messages like:
1040: SQLSTATE[HY000] [1040] Too many connections
come out on occcasion. Duckduckgo searches suggest it's from mysql/mariadb.

But that might be overkill for you.
chris2be8 is offline   Reply With Quote
Old 2023-02-20, 18:24   #7
Tyler Busby
 
Tyler Busby's Avatar
 
Jan 2023

768 Posts
Default

Quote:
Originally Posted by chris2be8 View Post
I've seen messages like:
1040: SQLSTATE[HY000] [1040] Too many connections
come out on occcasion. Duckduckgo searches suggest it's from mysql/mariadb.

But that might be overkill for you.
Precisely the type of information leakage I was hoping somebody here had caught :) Good to know!

I've always had a fondness for postgres, so I may rise to that level of overkill if xilman's schema suits my project. But realistically, storing text/blobs in sqlite would probably be fine for anything I can imagine right now (basically just personal factoring queues, storing/sorting prime candidates for sieving/pfgw, possibly reimplementing some factordb-esque features to assist with those two tasks)

Further down the line, I would maybe want to have this software able to interface with ecmnet client/server software to coordinate multiple computers (probably just my own) factoring against this queue, as that seems like less overhead than going the boinc route.

I mostly want to moderately automate finding the most tractable composites relating to OEIS sequences that need factoring efforts, and hammer them with YAFU :)

This also stems from the desire to know how much ecm an arbitrary composite on factordb has had run against it (even if just by me on a different day that I've forgotten about). It doesn't seem likely Markus will implement this type of self reporting (and probably for good reason, it's a difficult trust problem), but is maybe something that a third party could track and display with an extension, if the ECM is done via a trusted framework.

An example workflow: factorize a number on factordb -> there's a remaining C200 -> "ecmdb" extension annotates the composite as having no tracked ECM on it -> click the annotation -> "ecmdb" spins up an ecmnet server (or similar) and your extension boots the client with the server info -> if you find the factor, "ecmdb" reports it to factordb. If you don't find the factor after x curves and quit, ecmdb updates its internal ecm tracking and shows that "progress" on the factordb annotation for other "ecmdb" extension users, who can also use the ecmnet server if it was already created, or if they'd prefer not to, they will at least not duplicate ecm efforts.

I'll likely not implement that entire idea any time soon, but wanted to at least think through the design out loud :) since I have the day off today, I'll probably just get started on a little sqlite version to track composites that I'm interested in, and take it from there.
Tyler Busby is offline   Reply With Quote
Old 2023-02-20, 19:15   #8
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

22×13×107 Posts
Default

If you're looking for in-house only ECM accross several machines, you might look at ecmpi. I use it for my local machines and have scripts that will step through levels and even have it implemented as the ECM method for Aliqueit, via aliqueit.ini. I have a brief "How I. . ." in the blog area, if interested. As to the more extensive scripts, they're knd of thrown together for my specific setup, but I might be able to give some basics for those as well.
EdH is offline   Reply With Quote
Old 2023-02-20, 19:23   #9
xilman
Bamboozled!
 
xilman's Avatar
 
"๐’‰บ๐’ŒŒ๐’‡ท๐’†ท๐’€ญ"
May 2003
Down not across

2E1616 Posts
Default

Quote:
Originally Posted by Tyler Busby View Post
That would be lovely if you don't mind! I'm sure it would be a great starting point.
DM me with your email address.

I will provide some Perl scripts, one of which contains the schema and is used to initialize the DB. It will take me a little while to ensure that no secrets are revealed, such as the account names and passwords used.

I can also provide a populater pg_dump which well let you explore the database containing real data.

Paul
xilman is offline   Reply With Quote
Old 2023-02-20, 20:13   #10
Tyler Busby
 
Tyler Busby's Avatar
 
Jan 2023

2·31 Posts
Default

Quote:
Originally Posted by xilman View Post
DM me with your email address.

I will provide some Perl scripts, one of which contains the schema and is used to initialize the DB. It will take me a little while to ensure that no secrets are revealed, such as the account names and passwords used.

I can also provide a populater pg_dump which well let you explore the database containing real data.

Paul
That would be great, sent you my email! Thanks for doing this for me.

Quote:
Originally Posted by EdH View Post
If you're looking for in-house only ECM accross several machines, you might look at ecmpi. I use it for my local machines and have scripts that will step through levels and even have it implemented as the ECM method for Aliqueit, via aliqueit.ini. I have a brief "How I. . ." in the blog area, if interested. As to the more extensive scripts, they're knd of thrown together for my specific setup, but I might be able to give some basics for those as well.
Ah! That's a good recommendation as I didn't know about ecmpi. I'll keep it in mind going forward, but I think the computing power disparity between my best and second best machine is enough to where setting up ecmpi might be more trouble than it's worth until I have the rest of my system fleshed out. I do wonder if using ecmpi to coordinate simultaneous gpu and cpu ecm (from one machine) on a single composite would be a worthwhile endeavor, and if this amalgamation could be plugged into yafu for ecm.
Tyler Busby is offline   Reply With Quote
Old 2023-02-20, 23:34   #11
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

22·13·107 Posts
Default

I'm unfamiliar with ecmpi working with a GPU. Parallel processes could be scripted, but ecm.py or YAFU would be my choice for a single machine CPU tasking. GMP-ECM with CGBN would be my choice for GPU, but the GPU will only do stage 1. Stage 2 would still need to be done via CPU threads.

I actually have a GPU set up on a dual core, no hyper-threading, machine that sends the residues to machines with either 40/24/20 threads, depending on what's available at the time.

ETA: Just an additional note: I find my ecmpi cluster well outperforms my GPUs, even though my better GPU has 1536 nodes and my ecmpi cluster has ~ 200 nodes.

Last fiddled with by EdH on 2023-02-20 at 23:38
EdH is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
This is a sequence with integers MattcAnderson MattcAnderson 23 2021-04-19 18:19
large equation system over integers talork Other Mathematical Topics 26 2011-03-29 19:33
Integers in a grid Unregistered Homework Help 1 2010-05-06 20:09
Given a set of R integers... Joshua2 Puzzles 19 2009-11-08 00:36
2n+1 Integers davar55 Puzzles 8 2007-06-06 13:24

All times are UTC. The time now is 14:01.


Fri Jul 7 14:01:45 UTC 2023 up 323 days, 11:30, 0 users, load averages: 1.17, 1.14, 1.15

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.

โ‰  ยฑ โˆ“ รท ร— ยท โˆ’ โˆš โ€ฐ โŠ— โŠ• โŠ– โŠ˜ โŠ™ โ‰ค โ‰ฅ โ‰ฆ โ‰ง โ‰จ โ‰ฉ โ‰บ โ‰ป โ‰ผ โ‰ฝ โŠ โА โŠ‘ โŠ’ ยฒ ยณ ยฐ
โˆ  โˆŸ ยฐ โ‰… ~ โ€– โŸ‚ โซ›
โ‰ก โ‰œ โ‰ˆ โˆ โˆž โ‰ช โ‰ซ โŒŠโŒ‹ โŒˆโŒ‰ โˆ˜ โˆ โˆ โˆ‘ โˆง โˆจ โˆฉ โˆช โจ€ โŠ• โŠ— ๐–• ๐–– ๐–— โŠฒ โŠณ
โˆ… โˆ– โˆ โ†ฆ โ†ฃ โˆฉ โˆช โІ โŠ‚ โŠ„ โŠŠ โЇ โŠƒ โŠ… โŠ‹ โŠ– โˆˆ โˆ‰ โˆ‹ โˆŒ โ„• โ„ค โ„š โ„ โ„‚ โ„ต โ„ถ โ„ท โ„ธ ๐“Ÿ
ยฌ โˆจ โˆง โŠ• โ†’ โ† โ‡’ โ‡ โ‡” โˆ€ โˆƒ โˆ„ โˆด โˆต โŠค โŠฅ โŠข โŠจ โซค โŠฃ โ€ฆ โ‹ฏ โ‹ฎ โ‹ฐ โ‹ฑ
โˆซ โˆฌ โˆญ โˆฎ โˆฏ โˆฐ โˆ‡ โˆ† ฮด โˆ‚ โ„ฑ โ„’ โ„“
๐›ข๐›ผ ๐›ฃ๐›ฝ ๐›ค๐›พ ๐›ฅ๐›ฟ ๐›ฆ๐œ€๐œ– ๐›ง๐œ ๐›จ๐œ‚ ๐›ฉ๐œƒ๐œ— ๐›ช๐œ„ ๐›ซ๐œ… ๐›ฌ๐œ† ๐›ญ๐œ‡ ๐›ฎ๐œˆ ๐›ฏ๐œ‰ ๐›ฐ๐œŠ ๐›ฑ๐œ‹ ๐›ฒ๐œŒ ๐›ด๐œŽ๐œ ๐›ต๐œ ๐›ถ๐œ ๐›ท๐œ™๐œ‘ ๐›ธ๐œ’ ๐›น๐œ“ ๐›บ๐œ”