Alex Teslik wrote:
On Wed, 30 May 2007 15:18:18 -0400, John Elrick wrote
After running a simple test, I confirmed a suspicion. VACUUM
doesn't reorder the ROWIDs, so you still have breaks.
My tests show otherwise:
SNIP
did I do something incorrectly?
Not incorrectly, just
Here's a naive solution, which requires some programming language
around the SQL:
BEGIN TRANSACTION
n = (SELECT count(*) from table)
i = RandBetween(0, n)
row = (SELECT * from table LIMIT 1 OFFSET i)
END TRANSACTION
I'm posting this because I suspect that this naive solution isn't
correct, but I
On Wed, 30 May 2007 15:18:18 -0400, John Elrick wrote
> After running a simple test, I confirmed a suspicion. VACUUM
> doesn't reorder the ROWIDs, so you still have breaks.
My tests show otherwise:
[alex]# cat 01_vacuum_table_test.sql
CREATE TABLE foo (
string varchar(1) not null
);
INSERT I
Is there a way I can modify my query to attain a much more equal
distribution? It doesn't have to be perfect, but right now it is too
noticiably weighted.
What about this:
SELECT * FROM Table LIMIT 1 OFFSET round((CAST(random(*) as
float)/(9223372036854775807)+1)/2*(SELECT COUNT(*) FROM Tabl
Alex Teslik wrote:
Hello,
I'm working on a project that requires random images to be chosen from a
live database for a dynamic homepage. I found this link from Dr. Hipp that
details a very fast approach to selecting random rows:
http://www.mail-archive.com/sqlite-users@sqlite.org/msg14652.ht
Hello,
I'm working on a project that requires random images to be chosen from a
live database for a dynamic homepage. I found this link from Dr. Hipp that
details a very fast approach to selecting random rows:
http://www.mail-archive.com/sqlite-users@sqlite.org/msg14652.html
Unfortunately,
6 matches
Mail list logo