Develoopment Notes

Volatility

Performances

  1. ORDER BY random() : Basic but very slow

SQL SELECT name FROM anon.last_name ORDER BY random() LIMIT 1;

  1. OFFSET floor() :

SQL SELECT name FROM anon.last_name OFFSET floor(random()*(SELECT count(*) FROM anon.last_name)) LIMIT 1;

  1. TABLESAMPLE

SQL SELECT name FROM @extschema@.last_name TABLESAMPLE SYSTEM(1) LIMIT 1;

  1. tsm-system-rows

SQL SELECT name FROM @extschema@.last_name TABLESAMPLE SYSTEM_ROWS(1);

Links