‎2008 Feb 15 3:42 PM
Dear All
I want to fetch some records from table FAGLFLEXA based on GL codes, company code, year, period, ledger and profit center. After that I have to classify them based on the document type which is not there in this table . I have to fetch it from table BKPF based on the document number. Now please tell me which is the best way to get better performance for the pgm.
1.Fetch data from faglflexa based on all conditions using index for gl & period. Then take document type from BKPF using for all entries in faglflexa. now map the doc type to faglflexa using read.
or
2.Create a view joining faglflexa & bkpf and fetching data from view.
or
3.using join in select statement in pgm.
If using view or join what is the order of fields for the where condition in select statements.
Pls tell me which will give best performance or is there any best method.
Pls note that there will be lakhs of records which will satisfy the whole conditions.
Regards
Sathar
‎2008 Feb 15 3:54 PM
The JOIN should give the best performance. The order shouldn't matter.
Rob
‎2008 Feb 16 12:31 PM
Hi Rob.
Thx for ur reply. Will join in report give a better performance than a view. Can u pls explain.
Rgds
Sathar
‎2008 Feb 16 6:57 PM
A view is implemented by a JOIN, so there's not much difference.
Your main performance drag will be in bringing the large amount of data back to the application. There's not much you can do about that.
Rob
‎2008 Feb 16 6:41 AM
Hi,
Do like this,
First create one view for these two tables in se11 then u can write select statement on this view at the report level.
or
first select statement in FAGLFLEXA in the report,
then,
if not l_FAGLFLEXA[] is initial.
select from BKPF for all entries in l_FAGLFLEXA[]
where = common fields.
endif.
reward points if useful,
seshu.
‎2008 Feb 16 12:34 PM
Hi seshu,
Thx for ur reply. But pls tell me which method will be better in performance pont of view. Note that my query will fetch around 1-2 lakhs of records in average.
Rgds
sathar
‎2008 Feb 16 12:53 PM
Hi,
create view in se11 then write a select statement on that,
it'll improve your performance.
reward points if useful,
seshu.
‎2008 Feb 18 10:24 AM
I would go with the first option of yours.
Get data from FAGLFLEXA table.
Using the data from FAGLFLEXA table get the data from BKPF table.
This i would prefer than going for joins or database views.
This would definitely be faster than the JOINS and database views.
I would totally agree with what Rob said. Sometimes the queries would bring several lacs of records to the application and you cant help without it.
Reward points if found helpful.
Thanks,
Balaji
‎2008 Feb 18 11:27 AM
> This would definitely be faster than the JOINS and database views
'definitely' is not argument! When I read 'definitely' in the forum, then the argument very often wrong.
That is also here the case. Joins are generally faster than FOR ALL ENTRIES!
And View are dictionary defined joins, now performance difference.#
Siegfried