Skip to Content
0
Former Member
Apr 19, 2007 at 01:20 PM

Performance suggestions on SELECT and LOOP

12 Views

Hi All

I have following queries related to the performace issues.

1. Which of the below queries will run faster a or b

a. SELECT COUNT( * ) INTO cnt FROM mara .

b. SELECT COUNT( DISTINCT matnr ) INTO cnt FROM mara .

2. MATNR is a single key field in MARA however if use a table like BSIK where there is a composite primary key and used all Key field against DISTINCT keyword, will it work faster than COUNT( * ) or will be slower.

3. In the MOVE command, which one of the below work faster a or b.

a.

LOOP AT itab.

MOVE itab-matnr TO wtab-matnr.

MOVE itab-mtart TO wtab-mtart.

MOVE itab-maktx TO wtab-maktx.

ENDLOOP.

b.

LOOP AT itab.

MOVE: itab-matnr TO wtab-matnr,

itab-mtart TO wtab-mtart,

itab-maktx TO wtab-maktx.

ENDLOOP.

Thanks in Advance

Amol