Join a Table with a BuisnessObject


Author
Message
Edhy Rijo
E
StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Ger,

Ger Cannoll (12/22/2011)
I think there are proabably two ways to do this:
1. Join ALL the tables to start with, I then end up with the Million Rows, but with a lot of additional 'Bloat', that I am going to be processing as I do the calculations (i.e. traversing down the Business Object)
2. Just select out the 7 fields , as above , and add in the Lookup's to the other tables as a separate piece of code, after the procerssing has been done.

Of the 2 ways outlined above, I am concerned that perhaps Option 1 is not going to be very efficient, as I am 'Carrying' all the Bloat as I am 'processing' the BO. I would have thought that Option 2 (or something similar) would have been a more efficient way of processing as I only 'Append' in the additional data , when I need it, just at the end....and hence my initial question... whats the best and most efficient way of doing this in a StrataFrame environment  


I have some process where I handle millions of records, for those process I had to build a stored procedure, using a BO to load 500k+ records which you would need to enumerate using bo.Getenumerable would be pretty slow.  On some cases I need to export some data to CSV and loading 1.5 million records into a datatable to be exported is just fine, but for you to process record by record could have a huge performance hit.  MS SQL server has several nice features that allows you to process millions of records in batch to do all sort of things and then you can just load that result into a BO to show your report.

I am not a SQL expert, for that I do use the services of a MS SQL MVP developer for the last 2 years with pretty good results in all the projects I have used him, so if you need some reference I will be more than happy to introduce you to him. 
To give you an example one of my process imports 800+ thousand records every week, do several calculations and matches against a lookup table which keeps growing with each imported batch, I have customers with more than 25 million records and the whole stored procedure process takes from 1 to 10 minutes to complete, when I was doing the same process via enumerating the records, the process could take from 30 minutes to 3 hours to complete, this MS SQL MVP make me a real believer of the power of MS SQL Server engine.

Edhy Rijo

Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
Hi Michel. Thanks for replying.

Had a quick look at this product and it seems to allow you to use Sql select type syntax for querying a Dataset. I could not determine if this product will allow you to Select from a Dataset table and JOIN a Database Table (that doies not exist in the dataset). I have left a question on their site. If it does this (i.e. can join say a Dataset Table to a Databse Table) it would be a grat help
Michel Levy
Michel Levy
StrataFrame User (421 reputation)StrataFrame User (421 reputation)StrataFrame User (421 reputation)StrataFrame User (421 reputation)StrataFrame User (421 reputation)StrataFrame User (421 reputation)StrataFrame User (421 reputation)StrataFrame User (421 reputation)StrataFrame User (421 reputation)
Group: StrataFrame Users
Posts: 193, Visits: 9K
Hi Ger,

I don't understand how you could join anything to a database table, if the code is not in a database object.

if you code where you have the dataset table, then you are out of the database, and the database tables are reachable only through a dataset. If you code where you have the table, then you are inside the database, and you need to have received the dataset as a table parameter, or a temp table to have be filled with the rows of the dataset.
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
Hi Edhy. Many thanks for very informative reply.

After reading it and considering it, I will difinitely have a look at using Stored Procedures now , particulalrly for any processing which involves large numbers  of rows. I agree with you that this should definitely be more efficient, and it should also future proof development to some extent in that the 'processing' will be kept in the datatbase, and away from the client side, in case the futore dictates changes to the Client Side, in an ever changing and rapidly evoving IT environment
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
Hi Michel.

After considering the very informative replies in this thread, I am definitiely going to look into Stored Procedures and User Functions as part of a solution to Heavy processing requirements.
Edhy Rijo
E
StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)StrataFrame VIP (4.5K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Ger Cannoll (12/25/2011)
Hi Edhy. Many thanks for very informative reply.

You are welcome Ger!!!

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search