Home » RDBMS Server » Performance Tuning » select partition issue (11.2.0.1.0 Windos XP)
select partition issue [message #523171] Thu, 15 September 2011 20:06 Go to next message
andy huang
Messages: 498
Registered: July 2011
Senior Member
Dear all,
I was confused by partitioed table, when i select a partition of table, how does oracle to scan blocks? it scan all blocks of table or scan a single partition blocks only?

SQL> Explain Plan For
  2  Select Count(1) From Tb_Hxl_List Partition(p_L3);

Explained.

SQL> Select * From Table(dbms_xplan.display);

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
|   0 | SELECT STATEMENT       |             |     1 |    18   (0)| 00:00:01 |
|   1 |  SORT AGGREGATE        |             |     1 |            |          |
|   2 |   PARTITION LIST SINGLE|             | 33115 |    18   (0)| 00:00:01 |
|   3 |    TABLE ACCESS FULL   | TB_HXL_LIST | 33115 |    18   (0)| 00:00:01 |
Re: select partition issue [message #523172 is a reply to message #523171] Thu, 15 September 2011 20:18 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>I was confused by partitioed table, when i select a partition of table, how does oracle to scan blocks?
>it scan all blocks of table or scan a single partition blocks only?

Oracle does what is required to return proper result set.
If result set resides in single partition, then only one partition is accessed.
If result set requires multiple partitions, then multiple partitions are accessed.
Re: select partition issue [message #523173 is a reply to message #523172] Thu, 15 September 2011 20:23 Go to previous messageGo to next message
andy huang
Messages: 498
Registered: July 2011
Senior Member
hi,
That means if i want to get a partition data,it scan a partition only? but the sql plan show TABLE ACCESS FULL,why?
Re: select partition issue [message #523174 is a reply to message #523173] Thu, 15 September 2011 20:27 Go to previous message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
http://www.lmgtfy.com/?q=oracle+"PARTITION LIST SINGLE"



[Edit MC: fix link]

[Updated on: Thu, 15 September 2011 23:21] by Moderator

Report message to a moderator

Previous Topic: "NOT IN" REPLACE WITH "MINUS"
Next Topic: session_cached_cursors
Goto Forum:
  


Current Time: Fri Apr 19 03:54:43 CDT 2024