[sqlite] 10 minute Avg

2015-11-19 Thread R Smith
> Thanks, > Andrew S. > > -Original Message- > From: sqlite-users-bounces at mailinglists.sqlite.org > [mailto:sqlite-users-bounces at mailinglists.sqlite.org] On Behalf Of R Smith > Sent: Thursday, November 19, 2015 7:40 AM > To: sqlite-users at mailinglists.sqlite.org &

[sqlite] 10 minute Avg

2015-11-19 Thread R Smith
On 2015/11/19 4:49 PM, Andrew Stewart wrote: > Hi, > Had a question regarding what I am trying to do. One thing that I have > noticed is that it is slow to do this. I do not have any indexes created and > there is no primary index on this table. > I am using a 'DateTime' variable

[sqlite] 10 minute Avg

2015-11-19 Thread Simon Slavin
On 19 Nov 2015, at 4:32pm, Eric Rubin-Smith wrote: > To be pedantic, an integer can take up to 9 bytes. > https://www.sqlite.org/fileformat.html#varint Heh. I took my '8 bytes' from section 2.1 of the same document. Simon.

[sqlite] 10 minute Avg

2015-11-19 Thread Simon Slavin
On 19 Nov 2015, at 4:06pm, Andrew Stewart wrote: >Would storing the dateTime as Integer make the database and indexes > smaller? Yes. An integer will take a maximum of 8 bytes to store. A string's storage needs at least one byte per character in the string. And the format you're

[sqlite] 10 minute Avg

2015-11-19 Thread Andrew Stewart
-bounces at mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of R Smith Sent: Thursday, November 19, 2015 7:40 AM To: sqlite-users at mailinglists.sqlite.org Subject: Re: [sqlite] 10 minute Avg On 2015/11/19 4:49 PM, Andrew Stewart wrote: > Hi, >

[sqlite] 10 minute Avg

2015-11-19 Thread Simon Slavin
> On 19 Nov 2015, at 2:49pm, Andrew Stewart > wrote: > > Had a question regarding what I am trying to do. One thing that I have > noticed is that it is slow to do this. I do not have any indexes created and > there is no primary index on this table. I bet whatever you're doing, a

[sqlite] 10 minute Avg

2015-11-19 Thread Andrew Stewart
, Andrew S. -Original Message- From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of R Smith Sent: Wednesday, November 18, 2015 2:06 PM To: sqlite-users at mailinglists.sqlite.org Subject: Re: [sqlite] 10 minute Avg On 2015

[sqlite] 10 minute Avg

2015-11-19 Thread Eric Rubin-Smith
On Thu, Nov 19, 2015 at 11:26 AM, Simon Slavin wrote: > > On 19 Nov 2015, at 4:06pm, Andrew Stewart > wrote: > > >Would storing the dateTime as Integer make the database and > indexes smaller? > > Yes. An integer will take a maximum of 8 bytes to store. A string's > storage needs at

[sqlite] 10 minute Avg

2015-11-19 Thread R Smith
f that does what is needed, Cheers! Ryan > > -Original Message- > From: sqlite-users-bounces at mailinglists.sqlite.org > [mailto:sqlite-users-bounces at mailinglists.sqlite.org] On Behalf Of R Smith > Sent: Wednesday, November 18, 2015 10:06 AM > To: sqlite-users at mailinglists.s

[sqlite] 10 minute Avg

2015-11-18 Thread R Smith
Slight alteration, the Left Join should contain the full filter to show empty time-slots, if that is what you want rather, like this: WITH BDT(startDateTime,endDateTime,IntervalSeconds) AS ( SELECT '2015-11-17 00:00:00', '2015-11-18 00:00:00', '+600 seconds' ), TIV(startTime,endTime) AS (

[sqlite] 10 minute Avg

2015-11-18 Thread R Smith
Quite easy to do with a CTE, like this: WITH BDT(startDateTime,endDateTime,IntervalSeconds) AS ( SELECT '2015-11-17 00:00:00', '2015-11-18 00:00:00', '+600 seconds' ), TIV(startTime,endTime) AS ( SELECT startDateTime, datetime(startDateTime,IntervalSeconds) FROM BDT UNION ALL

[sqlite] 10 minute Avg

2015-11-18 Thread Andrew Stewart
sers at mailinglists.sqlite.org Subject: Re: [sqlite] 10 minute Avg Slight alteration, the Left Join should contain the full filter to show empty time-slots, if that is what you want rather, like this: WITH BDT(startDateTime,endDateTime,IntervalSeconds) AS ( SELECT '2015-11-17 00:00:00', '2015-11-18 00:0

[sqlite] 10 minute Avg

2015-11-18 Thread Tim Streater
On 18 Nov 2015 at 16:52, Andrew Stewart wrote: > Hi Richard, > I figured out what you did. Not exactly what I am after. College had a > suggestion. I am going to work on adjusting the structure to storing > time/date as BIGINT and do the math on that. I need to be able to adjust the >

[sqlite] 10 minute Avg

2015-11-18 Thread Andrew Stewart
' Subject: Re: [sqlite] 10 minute Avg Hi Richard, That gave me 10 hour intervals not 10 minute. Which is the part that controls the frequency? Thanks, Andrew S. -Original Message- From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-boun

[sqlite] 10 minute Avg

2015-11-18 Thread Andrew Stewart
Sent: Wednesday, November 18, 2015 8:41 AM To: SQLite mailing list Subject: Re: [sqlite] 10 minute Avg On 11/18/15, Andrew Stewart wrote: > Hi, > I am trying to generate 10 minute average data for a > day from a data set. Table is created by the following: > &g

[sqlite] 10 minute Avg

2015-11-18 Thread Andrew Stewart
Hi, I am trying to generate 10 minute average data for a day from a data set. Table is created by the following: CREATE TABLE dataStreamRecord (fwParameterID INTEGER NOT NULL, dateTime DATETIME NOT NULL, data INTEGER NOT NULL); Sample Data fwParameterID,dateTime,data

[sqlite] 10 minute Avg

2015-11-18 Thread Richard Hipp
On 11/18/15, Andrew Stewart wrote: > Hi, > I am trying to generate 10 minute average data for a day > from a data set. Table is created by the following: > > CREATE TABLE dataStreamRecord (fwParameterID INTEGER NOT NULL, dateTime > DATETIME NOT NULL, data INTEGER NOT NULL); > >