You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kylin.apache.org by dong wang <el...@gmail.com> on 2015/05/12 10:25:20 UTC

is there an efficient way to get the row count of the returned result

Hi all,

Re: is there an efficient way to get the row count of the returned result

Posted by Luke Han <lu...@gmail.com>.
Before the query success executed, nobody knows the "row count", especially
with filtering and group by.
After the query executed successfully, you already have the result set to
count them.

There's one JIRA to support pagination in Kylin:
https://issues.apache.org/jira/browse/KYLIN-207

Please leave your comments there.

Thanks.


Best Regards!
---------------------

Luke Han

2015-05-18 15:16 GMT+08:00 Li Yang <li...@apache.org>:

> sub-query is also what I can think of..
>
> On Wed, May 13, 2015 at 9:55 AM, ShaoFeng Shi <sh...@apache.org>
> wrote:
>
> > Dong, sorry I didn't get your point...  this is a common question for all
> > database applications I think; sending a count query before the detail
> > query is a common way to achieve this; There are other SQL ways just like
> > your mentioned; but in my mind, Kylin doesn't have specific support on
> > this.
> >
> > Yang and others, please correct me if I'm wrong.
> >
> >
> > 2015-05-12 17:19 GMT+08:00 dong wang <el...@gmail.com>:
> >
> > > if so, it will ignore the where and group by, thus , the result should
> be
> > > incorrect, currently, we use a sub-query to achieve it
> > >
> > > 2015-05-12 17:02 GMT+08:00 Shi, Shaofeng <sh...@ebay.com>:
> > >
> > > > Why not execute a ³select count(dt)² query before running this detail
> > > > query?
> > > >
> > > > On 5/12/15, 4:29 PM, "dong wang" <el...@gmail.com> wrote:
> > > >
> > > > >For example,  if we have the SQL: select dt from test1 where dt >=
> > > > >'2015-04-11' and dt <= '2015-05-11'  group by col1, col2, col3,  is
> > > there
> > > > >a
> > > > >way to directly get the row count of result for this SQL,  it's very
> > > > >useful
> > > > >when paging, since users must get the total row count first, then
> > divide
> > > > >the number of each page the get the total number of pages
> > > > >
> > > > >
> > > > >2015-05-12 16:25 GMT+08:00 dong wang <el...@gmail.com>:
> > > > >
> > > > >> Hi all,
> > > > >>
> > > > >>
> > > >
> > > >
> > >
> >
>

Re: is there an efficient way to get the row count of the returned result

Posted by Li Yang <li...@apache.org>.
sub-query is also what I can think of..

On Wed, May 13, 2015 at 9:55 AM, ShaoFeng Shi <sh...@apache.org>
wrote:

> Dong, sorry I didn't get your point...  this is a common question for all
> database applications I think; sending a count query before the detail
> query is a common way to achieve this; There are other SQL ways just like
> your mentioned; but in my mind, Kylin doesn't have specific support on
> this.
>
> Yang and others, please correct me if I'm wrong.
>
>
> 2015-05-12 17:19 GMT+08:00 dong wang <el...@gmail.com>:
>
> > if so, it will ignore the where and group by, thus , the result should be
> > incorrect, currently, we use a sub-query to achieve it
> >
> > 2015-05-12 17:02 GMT+08:00 Shi, Shaofeng <sh...@ebay.com>:
> >
> > > Why not execute a ³select count(dt)² query before running this detail
> > > query?
> > >
> > > On 5/12/15, 4:29 PM, "dong wang" <el...@gmail.com> wrote:
> > >
> > > >For example,  if we have the SQL: select dt from test1 where dt >=
> > > >'2015-04-11' and dt <= '2015-05-11'  group by col1, col2, col3,  is
> > there
> > > >a
> > > >way to directly get the row count of result for this SQL,  it's very
> > > >useful
> > > >when paging, since users must get the total row count first, then
> divide
> > > >the number of each page the get the total number of pages
> > > >
> > > >
> > > >2015-05-12 16:25 GMT+08:00 dong wang <el...@gmail.com>:
> > > >
> > > >> Hi all,
> > > >>
> > > >>
> > >
> > >
> >
>

Re: is there an efficient way to get the row count of the returned result

Posted by ShaoFeng Shi <sh...@apache.org>.
Dong, sorry I didn't get your point...  this is a common question for all
database applications I think; sending a count query before the detail
query is a common way to achieve this; There are other SQL ways just like
your mentioned; but in my mind, Kylin doesn't have specific support on
this.

Yang and others, please correct me if I'm wrong.


2015-05-12 17:19 GMT+08:00 dong wang <el...@gmail.com>:

> if so, it will ignore the where and group by, thus , the result should be
> incorrect, currently, we use a sub-query to achieve it
>
> 2015-05-12 17:02 GMT+08:00 Shi, Shaofeng <sh...@ebay.com>:
>
> > Why not execute a ³select count(dt)² query before running this detail
> > query?
> >
> > On 5/12/15, 4:29 PM, "dong wang" <el...@gmail.com> wrote:
> >
> > >For example,  if we have the SQL: select dt from test1 where dt >=
> > >'2015-04-11' and dt <= '2015-05-11'  group by col1, col2, col3,  is
> there
> > >a
> > >way to directly get the row count of result for this SQL,  it's very
> > >useful
> > >when paging, since users must get the total row count first, then divide
> > >the number of each page the get the total number of pages
> > >
> > >
> > >2015-05-12 16:25 GMT+08:00 dong wang <el...@gmail.com>:
> > >
> > >> Hi all,
> > >>
> > >>
> >
> >
>

Re: is there an efficient way to get the row count of the returned result

Posted by dong wang <el...@gmail.com>.
if so, it will ignore the where and group by, thus , the result should be
incorrect, currently, we use a sub-query to achieve it

2015-05-12 17:02 GMT+08:00 Shi, Shaofeng <sh...@ebay.com>:

> Why not execute a ³select count(dt)² query before running this detail
> query?
>
> On 5/12/15, 4:29 PM, "dong wang" <el...@gmail.com> wrote:
>
> >For example,  if we have the SQL: select dt from test1 where dt >=
> >'2015-04-11' and dt <= '2015-05-11'  group by col1, col2, col3,  is there
> >a
> >way to directly get the row count of result for this SQL,  it's very
> >useful
> >when paging, since users must get the total row count first, then divide
> >the number of each page the get the total number of pages
> >
> >
> >2015-05-12 16:25 GMT+08:00 dong wang <el...@gmail.com>:
> >
> >> Hi all,
> >>
> >>
>
>

Re: is there an efficient way to get the row count of the returned result

Posted by "Shi, Shaofeng" <sh...@ebay.com>.
Why not execute a ³select count(dt)² query before running this detail
query? 

On 5/12/15, 4:29 PM, "dong wang" <el...@gmail.com> wrote:

>For example,  if we have the SQL: select dt from test1 where dt >=
>'2015-04-11' and dt <= '2015-05-11'  group by col1, col2, col3,  is there
>a
>way to directly get the row count of result for this SQL,  it's very
>useful
>when paging, since users must get the total row count first, then divide
>the number of each page the get the total number of pages
>
>
>2015-05-12 16:25 GMT+08:00 dong wang <el...@gmail.com>:
>
>> Hi all,
>>
>>


Re: is there an efficient way to get the row count of the returned result

Posted by dong wang <el...@gmail.com>.
For example,  if we have the SQL: select dt from test1 where dt >=
'2015-04-11' and dt <= '2015-05-11'  group by col1, col2, col3,  is there a
way to directly get the row count of result for this SQL,  it's very useful
when paging, since users must get the total row count first, then divide
the number of each page the get the total number of pages


2015-05-12 16:25 GMT+08:00 dong wang <el...@gmail.com>:

> Hi all,
>
>