You could encode this by iteratively requesting reasonably small chunks of time, until you meet or exceed the number of results you're looking for. When you expect to find very recent data in a measurement, this works well. Unfortunately, if the newest data is actually fairly old, you'll hit a few zero reads before you start getting data.
https://github.com/influxdata/influxdb/issues/5793 would make this kind of use case nicer. :) -0xe1a On Wed, Oct 5, 2016 at 12:29 PM, Sean Beckett <[email protected]> wrote: > If you don't know when the points are in time, then yes, using a WHERE > time clause is challenging. InfluxDB will happily return results from a > SELECT * query with no time boundaries, it's just going to be RAM-intensive > and may require more resources than the machine has, depending on the > number of points sampled. > > On Wed, Oct 5, 2016 at 9:15 AM, Mathias Herberts < > [email protected]> wrote: > >> If you set a WHERE time clause, how can you retrieve the N most recent >> points? It might be that those points lie outside of the time range >> specified in the WHERE clause, so you would need to set the widest time >> range possible which would basically lead to a full scan just as if the >> WHERE clause was not there. Am I mistaken? >> >> On Wednesday, October 5, 2016 at 5:04:13 PM UTC+2, Sean Beckett wrote: >>> >>> LIMIT does not yet restrict the number of points queried, only the >>> number of points returned. Add a "WHERE time" clause to prevent the query >>> from sampling all points in the measurement. >>> >>> On Wed, Oct 5, 2016 at 4:04 AM, <[email protected]> wrote: >>> >>>> >>>> I have stored around 4 crore records in a measurement. when i tried to >>>> to look into only 4 records using a select query, it is taking whole memory >>>> and result into my system get hanged. >>>> >>>> query i used is : select * from new_fuelitems limit 5 >>>> >>>> Can anyone help me on this. >>>> >>>> -- >>>> Remember to include the InfluxDB version number with all issue reports >>>> --- >>>> You received this message because you are subscribed to the Google >>>> Groups "InfluxDB" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> To post to this group, send email to [email protected]. >>>> Visit this group at https://groups.google.com/group/influxdb. >>>> To view this discussion on the web visit https://groups.google.com/d/ms >>>> gid/influxdb/b66c09d2-5e91-4de1-bad6-775a8b29e49a%40googlegroups.com. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> >>> >>> -- >>> Sean Beckett >>> Director of Support and Professional Services >>> InfluxDB >>> >> -- >> Remember to include the InfluxDB version number with all issue reports >> --- >> You received this message because you are subscribed to the Google Groups >> "InfluxDB" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> Visit this group at https://groups.google.com/group/influxdb. >> To view this discussion on the web visit https://groups.google.com/d/ms >> gid/influxdb/93538a6f-6cab-46b8-a8a5-5178aa76bf70%40googlegroups.com >> <https://groups.google.com/d/msgid/influxdb/93538a6f-6cab-46b8-a8a5-5178aa76bf70%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Sean Beckett > Director of Support and Professional Services > InfluxDB > > -- > Remember to include the InfluxDB version number with all issue reports > --- > You received this message because you are subscribed to the Google Groups > "InfluxDB" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/influxdb. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/influxdb/CALGqCvNLAFxJouv3s3yjFR0UsdSbLLZBMCvdCBdG34nzMT5Smw%40mail. > gmail.com > <https://groups.google.com/d/msgid/influxdb/CALGqCvNLAFxJouv3s3yjFR0UsdSbLLZBMCvdCBdG34nzMT5Smw%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- Remember to include the InfluxDB version number with all issue reports --- You received this message because you are subscribed to the Google Groups "InfluxDB" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/influxdb. To view this discussion on the web visit https://groups.google.com/d/msgid/influxdb/CAA2%2BnqGEmd--AXkys8Ao4E4%3DwMgacgJKtmqWiH3XULWMXUTiaA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
