Recordsets - full360/sneaql GitHub Wiki

Recordsets

SneaQL provides a facility to store the results of a query in memory, to be used by other commands. Included in the core platform are the following commands:

  • recordset - stores the results of a SQL query as a named recorset in memory
  • iterate - iterates through each record in a stored recordset and executes the query in the context of the record being iterated

This is very powerful feature that provides basic looping functionality. If you are a ruby programmer, it is possible to create your own command tags to populate or utilize recordsets in many different ways.

NOTE: Recordsets are stored in memory on the machine running SneaQL. Returning large recordsets will fill up the memory on your machine and likely crash the underlying JVM! Things you should do:

  • Always put a TOP or LIMIT clause on your query to prevent unintentionally huge recordsets from being stored.
  • Only select the fields you need into your recordset (SELECT * is not your friend here!)
  • Increase your JVM heap size to provide some headroom. export JRUBY_OPTS="-J-Xmx8G -J-Xss8096k"