Re: Creating View Table Using the Date & Time
Ok, Thank you very much for the help. On Wed, Feb 14, 2018 at 12:43 PM, James Taylorwrote: > No, you’ll need to create a Phoenix table and use Phoenix APIs to write > your data. > > On Tue, Feb 13, 2018 at 9:52 PM Vaghawan Ojha > wrote: > >> Thank you James, my keys are something like this: 2018-02-01-BM50558- >> 1517454912.0-5-1517548497.261604 . the first few chars are the date. and >> these dates are stored in a seperate columns as BDATE as well. Do you think >> I could implement the rowtimestamp in the BDATE column? >> >> Thanks >> Vaghawan >> >> On Wed, Feb 14, 2018 at 7:47 AM, James Taylor >> wrote: >> >>> If the date time column is part of your pk, then you’d be able to use >>> the ROW_TIMESTAMP feature. >>> >>> On Tue, Feb 13, 2018 at 5:04 PM Vaghawan Ojha >>> wrote: >>> Yes, the datetime column is part of my primary key, but primary key also consists other strings. Thanks Vaghawan On Tue, Feb 13, 2018 at 11:05 PM, James Taylor wrote: > The standard way of doing this is to add a TTL for your table [1]. You > can do this through the ALTER TABLE call [2]. Is the date/time column part > of your primary key? If so, you can improve performance by declaring this > column as a ROW_TIMESTAMP [3]. > > A view is not going to help you - it's not materialized. > > Thanks, > James > > [1] http://hbase.apache.org/0.94/book/ttl.html > [2] https://phoenix.apache.org/language/index.html#alter > [3] https://phoenix.apache.org/rowtimestamp.html > > On Tue, Feb 13, 2018 at 2:42 AM, Vaghawan Ojha > wrote: > >> Hi, >> >> I'm using phoenix 4.12 with hbase 1.2.0, I've a table with few >> millions of rows, but I don't need much of the old data, Let's say the >> frequent data I need is data from 2 month back. >> >> the query become slow when I read the table using timestamp. So query >> would be like where date>some date and > >> I was thinking of creating a veiw table where I could put the latest >> two months data, but the data there should consist only the latest two >> months. The parent table is updated daily with the new data, so in my >> case >> whenever new day's data comes in, the last one day's data should be >> removed >> from the view, making sure that the view consists two month's data. (e.g >> it >> would always hold last 60 days data) >> I don't know if that is possible using create view. If it is how can >> I do it? >> >> Any suggestion would be appreciated. >> >> Thanks >> Vaghawan >> > > >>
Re: Creating View Table Using the Date & Time
No, you’ll need to create a Phoenix table and use Phoenix APIs to write your data. On Tue, Feb 13, 2018 at 9:52 PM Vaghawan Ojhawrote: > Thank you James, my keys are something like > this: 2018-02-01-BM50558-1517454912.0-5-1517548497.261604 . the first few > chars are the date. and these dates are stored in a seperate columns as > BDATE as well. Do you think I could implement the rowtimestamp in the BDATE > column? > > Thanks > Vaghawan > > On Wed, Feb 14, 2018 at 7:47 AM, James Taylor > wrote: > >> If the date time column is part of your pk, then you’d be able to use the >> ROW_TIMESTAMP feature. >> >> On Tue, Feb 13, 2018 at 5:04 PM Vaghawan Ojha >> wrote: >> >>> Yes, the datetime column is part of my primary key, but primary key also >>> consists other strings. >>> >>> Thanks >>> Vaghawan >>> >>> On Tue, Feb 13, 2018 at 11:05 PM, James Taylor >>> wrote: >>> The standard way of doing this is to add a TTL for your table [1]. You can do this through the ALTER TABLE call [2]. Is the date/time column part of your primary key? If so, you can improve performance by declaring this column as a ROW_TIMESTAMP [3]. A view is not going to help you - it's not materialized. Thanks, James [1] http://hbase.apache.org/0.94/book/ttl.html [2] https://phoenix.apache.org/language/index.html#alter [3] https://phoenix.apache.org/rowtimestamp.html On Tue, Feb 13, 2018 at 2:42 AM, Vaghawan Ojha wrote: > Hi, > > I'm using phoenix 4.12 with hbase 1.2.0, I've a table with few > millions of rows, but I don't need much of the old data, Let's say the > frequent data I need is data from 2 month back. > > the query become slow when I read the table using timestamp. So query > would be like where date>some date and > I was thinking of creating a veiw table where I could put the latest > two months data, but the data there should consist only the latest two > months. The parent table is updated daily with the new data, so in my case > whenever new day's data comes in, the last one day's data should be > removed > from the view, making sure that the view consists two month's data. (e.g > it > would always hold last 60 days data) > I don't know if that is possible using create view. If it is how can I > do it? > > Any suggestion would be appreciated. > > Thanks > Vaghawan > >>> >
Re: Creating View Table Using the Date & Time
Thank you James, my keys are something like this: 2018-02-01-BM50558-1517454912.0-5-1517548497.261604 . the first few chars are the date. and these dates are stored in a seperate columns as BDATE as well. Do you think I could implement the rowtimestamp in the BDATE column? Thanks Vaghawan On Wed, Feb 14, 2018 at 7:47 AM, James Taylorwrote: > If the date time column is part of your pk, then you’d be able to use the > ROW_TIMESTAMP feature. > > On Tue, Feb 13, 2018 at 5:04 PM Vaghawan Ojha > wrote: > >> Yes, the datetime column is part of my primary key, but primary key also >> consists other strings. >> >> Thanks >> Vaghawan >> >> On Tue, Feb 13, 2018 at 11:05 PM, James Taylor >> wrote: >> >>> The standard way of doing this is to add a TTL for your table [1]. You >>> can do this through the ALTER TABLE call [2]. Is the date/time column part >>> of your primary key? If so, you can improve performance by declaring this >>> column as a ROW_TIMESTAMP [3]. >>> >>> A view is not going to help you - it's not materialized. >>> >>> Thanks, >>> James >>> >>> [1] http://hbase.apache.org/0.94/book/ttl.html >>> [2] https://phoenix.apache.org/language/index.html#alter >>> [3] https://phoenix.apache.org/rowtimestamp.html >>> >>> On Tue, Feb 13, 2018 at 2:42 AM, Vaghawan Ojha >>> wrote: >>> Hi, I'm using phoenix 4.12 with hbase 1.2.0, I've a table with few millions of rows, but I don't need much of the old data, Let's say the frequent data I need is data from 2 month back. the query become slow when I read the table using timestamp. So query would be like where date>some date and >>> I was thinking of creating a veiw table where I could put the latest two months data, but the data there should consist only the latest two months. The parent table is updated daily with the new data, so in my case whenever new day's data comes in, the last one day's data should be removed from the view, making sure that the view consists two month's data. (e.g it would always hold last 60 days data) I don't know if that is possible using create view. If it is how can I do it? Any suggestion would be appreciated. Thanks Vaghawan >>> >>> >>
Re: Creating View Table Using the Date & Time
Yes, the datetime column is part of my primary key, but primary key also consists other strings. Thanks Vaghawan On Tue, Feb 13, 2018 at 11:05 PM, James Taylorwrote: > The standard way of doing this is to add a TTL for your table [1]. You can > do this through the ALTER TABLE call [2]. Is the date/time column part of > your primary key? If so, you can improve performance by declaring this > column as a ROW_TIMESTAMP [3]. > > A view is not going to help you - it's not materialized. > > Thanks, > James > > [1] http://hbase.apache.org/0.94/book/ttl.html > [2] https://phoenix.apache.org/language/index.html#alter > [3] https://phoenix.apache.org/rowtimestamp.html > > On Tue, Feb 13, 2018 at 2:42 AM, Vaghawan Ojha > wrote: > >> Hi, >> >> I'm using phoenix 4.12 with hbase 1.2.0, I've a table with few millions >> of rows, but I don't need much of the old data, Let's say the frequent data >> I need is data from 2 month back. >> >> the query become slow when I read the table using timestamp. So query >> would be like where date>some date and > >> I was thinking of creating a veiw table where I could put the latest two >> months data, but the data there should consist only the latest two months. >> The parent table is updated daily with the new data, so in my case whenever >> new day's data comes in, the last one day's data should be removed from the >> view, making sure that the view consists two month's data. (e.g it would >> always hold last 60 days data) >> I don't know if that is possible using create view. If it is how can I do >> it? >> >> Any suggestion would be appreciated. >> >> Thanks >> Vaghawan >> > >
Re: Creating View Table Using the Date & Time
The standard way of doing this is to add a TTL for your table [1]. You can do this through the ALTER TABLE call [2]. Is the date/time column part of your primary key? If so, you can improve performance by declaring this column as a ROW_TIMESTAMP [3]. A view is not going to help you - it's not materialized. Thanks, James [1] http://hbase.apache.org/0.94/book/ttl.html [2] https://phoenix.apache.org/language/index.html#alter [3] https://phoenix.apache.org/rowtimestamp.html On Tue, Feb 13, 2018 at 2:42 AM, Vaghawan Ojhawrote: > Hi, > > I'm using phoenix 4.12 with hbase 1.2.0, I've a table with few millions of > rows, but I don't need much of the old data, Let's say the frequent data I > need is data from 2 month back. > > the query become slow when I read the table using timestamp. So query > would be like where date>some date and > I was thinking of creating a veiw table where I could put the latest two > months data, but the data there should consist only the latest two months. > The parent table is updated daily with the new data, so in my case whenever > new day's data comes in, the last one day's data should be removed from the > view, making sure that the view consists two month's data. (e.g it would > always hold last 60 days data) > I don't know if that is possible using create view. If it is how can I do > it? > > Any suggestion would be appreciated. > > Thanks > Vaghawan >