View previous topic :: View next topic
|
Author |
Message |
saurabh39 Warnings : 1 Active User
Joined: 11 Apr 2008 Posts: 144 Location: Jamshedpur
|
|
|
|
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 |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
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 |
|
|
saurabh39 Warnings : 1 Active User
Joined: 11 Apr 2008 Posts: 144 Location: Jamshedpur
|
|
|
|
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 |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
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 |
|
|
saurabh39 Warnings : 1 Active User
Joined: 11 Apr 2008 Posts: 144 Location: Jamshedpur
|
|
|
|
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 |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
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 |
|
|
|