You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Nikolai Tikhonov <nt...@apache.org> on 2017/02/01 16:46:45 UTC

Re: count from subquery is wrong

Hi!

It known limitation
http://apacheignite.gridgain.org/docs/dml#known-limitations. Ticket to
track the jira: https://issues.apache.org/jira/browse/IGNITE-4590


On Wed, Feb 1, 2017 at 12:10 AM, lawrencefinn <la...@gmail.com> wrote:

> We like to retrieve the count of possible items to allow pagination but
> doing
> a regular count is slow so we want to limit it to some large number.  I run
> the query [1] and it returns 2000, which makes no sense.  I am doing a
> limit
> 1000.  What is going on?  It doesn't seem to double every result set, just
> those at 1000
>
> [1]
> select count(*) from (select 1 one
> from "line-items".LineItem li
>   join "last-week-reports".Report rr
>   on (li.last_week_report_id = rr.id and rr.member_id = 3296  and rr.f_id
> =
> false)
>   join "last-week-line-item-pacings".LineItemPacing pacing
>   on (li.id = pacing.id)
> where li.member_id = 3296
> limit 1000)
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/count-from-subquery-is-wrong-tp10344.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>

Re: count from subquery is wrong

Posted by vkulichenko <va...@gmail.com>.
I think optimization is possible only if you don't have any conditions (i.e.
query like 'select count(*) from Table'). Ignite doesn't optimize this case
though.

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/count-from-subquery-is-wrong-tp10344p10407.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: count from subquery is wrong

Posted by lawrencefinn <la...@gmail.com>.
Hmmm has anyone else noticed that count queries are slow?  I guess because it
needs to go through the entire result set to get the count but it feels
slower than MySQL or PgSQL.  Do they do some interesting optimizations in
their DBMS?



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/count-from-subquery-is-wrong-tp10344p10372.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.