Hi, I’m using a postgres database deployed as a docker container on a $15/mo Droplet (with swap). I’ve replicated the container for an A vs. B ‘Volume vs local filing system’ speed test.
Where the database files are : [A] on local machine file system/disk <---- takes 10s [B] on a 10GB Volume <— takes 34s
A query on a 7 million row table (see below) takes 10 secs on [A] and 34 secs on [B]
SELECT * FROM ( SELECT val1,val2, cdatetime, a, b, c, d FROM events_table WHERE cdatetime >= ‘2022-01-16T12:26’ AND cdatetime < ‘2022-01-17T15:26’ ORDER BY cdatetime DESC ) as sub_sigevent WHERE sub_sigevent.d = 59 AND sub_sigevent.a = 6 AND sub_sigevent.b = 3 AND sub_sigevent.c = 7
As Volumes are networked memory in effect, I assume this is caused by the slow connection to the Volume compared to local filing system. So it would appear there’s no way round this, other than to try a time series specific data base such as ClickHouse (OSS version of InfluxDB) that scales better.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
Click below to sign up and get $100 of credit to try our products over 60 days!