Skip to main content

CANNOT BE OPTIMIZED DUE TO QUERY TYPE

  • February 16, 2017
  • 1 reply
  • 11 views

David_P_1
Forum|alt.badge.img+2

Vertica 7.2.3 database designer:

Loading queries from '/home/dbadmin/dd/q'.
Processed 2 SQL statement(s), all accepted and considered in the design.
Query 1 optimization ratio or status is 1
Query 2 optimization ratio or status is CANNOT BE OPTIMIZED DUE TO QUERY TYPE
Generated deployment script successfully

The two queries are:
select t.id_u, count(t2.id_gw)
from tran_gw_stage t
left join tran_gw t2 on t2.card_id_gw=t.card_id_gw
and t2.merchant_name=t.merchant_name
group by t.id_u;

select t.id_u, count(t2.id_gw)
from tran_gw_stage t
left join tran_gw t2 on t2.card_id_gw=t.card_id_gw
and t2.merchant_category=t.merchant_category
group by t.id_u;

Both queries are valid, and have only only one column name different.
Why can query #2 not be optimized?

1 reply

Forum|alt.badge.img+2
  • Participating Frequently
  • February 16, 2017

I don't have much details about your schema and environment, but can you please remove first query and try DBD only with second query only ?