LJ::DB::time_range_to_ids

LJ::DB::time_range_to_ids — Performs a binary search on a table's primary id key looking for time boundaries as specified. Returns the boundary ids that were found, effectively simulating a key on 'time' for the specified table.

Use

LJ::DB::time_range_to_ids(opts);

Arguments

  • opts. A hashref of keys. Keys are: 'table' - table name to query; 'roles' - arrayref of db roles to use, in order. Defaults to ['slow']; 'idcol' - name of 'id' primary key column. 'timecol' - name of unixtime column to use for constraint; 'starttime' - starting unixtime time of rows to match; 'endtime' - ending unixtime of rows to match.

Info

This function shouldn't normally be used, but there are rare instances where it's useful.

Source:

cgi-bin/ljdb.pl

Returns:

startid, endid; id boundaries which should be used by the caller.