Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PostgreSQL and C multiple connections

Tags:

c

sql

I am writing a CUDA code which requires data from database I want to get 400 random rows from a database stored in PostgreSQL. If I retrieve each of the rows sequentially, it will make my code very slow and it will not serve the purpose of parallelism and speedup. So, I want some C library or function which can create multiple connections with PostgreSQL and retrieve data faster.

Is there something in C which will help me do that?

like image 393
user1439690 Avatar asked Feb 13 '26 08:02

user1439690


1 Answers

Perhaps a query like this would suit you:

SELECT * FROM tablename ORDER BY RANDOM() LIMIT 400;
like image 163
NovaDenizen Avatar answered Feb 14 '26 21:02

NovaDenizen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!