Reputation: 631
Is there a way to make the result of query length less than 1 MB in SQLite database to keep on performance?
SELECT this
FROM THERE
WHERE something < 1MB
Upvotes: 0
Views: 337
Reputation:
SQLite has a function length(X)
. With it you could do this:
SELECT this
FROM there
WHERE length(something) < (1024 * 1024);
Edit: If you want the total result of your query to be smaller than a specific size (measured in what: number of characters?), you will have to LIMIT
your query.
SELECT this
FROM there
LIMIT 100;
Of course, 100
is just some random number I picked for the example. You'll have to measure your queries to get a limit appropriate for your performance requirenments.
Edit2: LIMIT
and OFFSET
make a nice couple:
SELECT this
FROM there
OFFSET 100
LIMIT 100;
This will select the "next" 100 records from your table using standard sorting.
Details about SELECT
in SQLite: http://sqlite.org/lang_select.html
Upvotes: 0