Super slow speed on large data set of floating numbers for SELECT operation
See original GitHub issueSQLDelight Version
1.5.3
Application Operating System
Android
Describe the Bug
Problem
Perfoming the following operation:
Given a dataset of 1000 elements that contain floating numbers, perform SELECT * operation
Takes a huge amount time (>1500 milliseconds), but it shouldn’t
Code snippet
CREATE TABLE weatherLog(
id INTEGER PRIMARY KEY AUTOINCREMENT,
temperature REAL,
humidity REAL,
pressure REAL
);
selectAll:
SELECT *
FROM weatherLog;
override suspend fun loadAll() {
weatherLogQueries.selectAll()
}
Performance result
SQLDelight performance screenshot
Why is this a bug
The same operation takes no time on Room. Since both are wrappers over SQLite I expect the results of SQLDelight to be similar to Room. They are similar for strings. But not for real numbers, hence I assume there is a bug
Room performance screenshot
Stacktrace
There are no errors in stacktrace
Issue Analytics
- State:
- Created a year ago
- Comments:5
Top Results From Across the Web
Speed in Python - Practical Data Science
But understanding why programs like Python can sometimes be slow is still ... And because integers and floating point numbers are different things...
Read more >Chapter 4. Query Performance Optimization - O'Reilly
Slow Query Basics: Optimize Data Access. The most basic reason a query doesn't perform well is because it's working with too much data....
Read more >Why does changing 0.1f to 0 slow down performance by 10x?
Denormal (or subnormal) numbers are kind of a hack to get some extra values very close to zero out of the floating point...
Read more >What Every Computer Scientist Should Know About Floating ...
One approach represents floating-point numbers using a very large significand, ... But accurate operations are useful even in the face of inexact data, ......
Read more >Floating-point arithmetic - Wikipedia
For this reason, floating-point arithmetic is often used to allow very small and very large real numbers that require fast processing times.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
👍 indeed very weird. I can take a look
this isn’t running any SQL, it’s just creating the query type