IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

What Rows are sent to DM?


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
saurabh39
Warnings : 1

Active User


Joined: 11 Apr 2008
Posts: 144
Location: Jamshedpur

PostPosted: Sat Mar 27, 2010 12:33 am
Reply with quote

Hi All,

The following is the process of sql execution -
SQL query is given to RDs, which optimises the query and gives it to DM. Then DM will send it to BM. And B<M in turn will give the pages from Buffer or raise a request for read from table. and then the data goes to DM. WHich applies Stage 1 predicates on it.

The question is, when stage 1 predicate is applied after sending the pages to DM, that means when a call is made to BM, the where clause has not been evaluated so what pages are to be sent to DM, how that is determined, How BM will know what pages to be sent.
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Sat Mar 27, 2010 1:53 am
Reply with quote

Tushar,

I think filtering is applied at both times during requesting & sending

Requesting Part
RDS(optimises the sql) --> DM(tries to decrease the amount of data to be accessed) --> BM(get the data)

Sending Part
BM(gets the data) --> DM(tries to decrease the amount of data received from BM by applying STAGE 1) --> RDS(Stage 2 predicates applied)

Sushanth
Back to top
View user's profile Send private message
saurabh39
Warnings : 1

Active User


Joined: 11 Apr 2008
Posts: 144
Location: Jamshedpur

PostPosted: Sat Mar 27, 2010 4:02 am
Reply with quote

Hi Sushant,

Quote:
Requesting Part
RDS(optimises the sql) --> DM(tries to decrease the amount of data to be accessed) --> BM(get the data)


If DM tries to decrease the amount of data, then on what basis does it do it, obviously it cannot be the where clause, because that is applied after BM sends the data.

Also, on what basis or criteria BM gets the data. Again where clause is not being used here.
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Sat Mar 27, 2010 6:52 pm
Reply with quote

Tushar,

DM tries to narrow down its search using indexes & statistics.

Tell me how there can be a search without using WHERE clause, the search without using where clause will be a tablespace scan. Indexes are created to avoid tablespace scan. So, WHERE clause will be considered by DM definately.

Sushanth
Back to top
View user's profile Send private message
saurabh39
Warnings : 1

Active User


Joined: 11 Apr 2008
Posts: 144
Location: Jamshedpur

PostPosted: Sat Mar 27, 2010 11:08 pm
Reply with quote

Hi Sushant,

If DM applies the stats and index before sending it to BM, does it mean STAGE 1 predicate is applied at DM before sending it to BM?
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Sun Mar 28, 2010 4:02 am
Reply with quote

Saurabh,

DM uses the available statistics, indexes and sends that info to BM to retreive rows. And later after BM gets the rows, sends it to DM, this is where Stage 1 is applied.

Sushanth
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Exclude rows with > than x occurre... DFSORT/ICETOOL 6
No new posts Convert single row multi cols to sing... DFSORT/ICETOOL 6
No new posts Compare latest 2 rows of a table usin... DB2 1
No new posts How to compare two rows of same table DB2 11
Search our Forums:

Back to Top