Partition Pruning on Interval Range Partitioned Table not happening when SYSDATE used in Where Clause
We have tables that are interval range partitioned on a DATE column, with a partition for each day - all very standard and straight out of Oracle doc.
A 3rd party application queries the tables to find number of rows based on date range that is on the column used for the partition key.
This application uses date range specified relative to current date - i.e. for last two days would be "..startdate > SYSDATE -2 " - but partition pruning does not take place and the explain plan shows that every partition is included.
By presenting the query using the date in a variable partition pruning does table place, and query obviously performs much better.
DB is 11.2.0.3 on RHEL6, and default parameters set - i.e. nothing changed that would influence optimizer behavior to something unusual.
I can't work out why this would be so. It very easy to reproduce with simple test case below.
I'd be very interested to hear any thoughts on why it is this way and whether anything can be done to permit the partition pruning to work with a query including SYSDATE as it would be difficult to get the application code changed.
Furthermore to make a case to change the code I would need an explanation of why querying using SYSDATE is not good practice, and I don't know of any such information.
1) Create simple partitioned table
CREATETABLE part_test
(id NUMBER NOT NULL,
starttime DATE NOT NULL,
CONSTRAINT pk_part_test PRIMARY KEY (id))
PARTITION BY RANGE (starttime) INTERVAL (NUMTODSINTERVAL(1,'day')) (PARTITION p0 VALUES LESS THAN (TO_DATE('01-01-2013','DD-MM-YYYY')));
2) Populate table 1million rows spread between 10 partitions
BEGIN
FOR i IN 1..1000000
LOOP
INSERT INTO part_test (id, starttime) VALUES (i, SYSDATE - DBMS_RANDOM.value(low => 1, high => 10));
END LOOP;
END;
EXEC dbms_stats.gather_table_stats('SUPER_CONF','PART_TEST');
3) Query the Table for data from last 2 days using SYSDATE in clause
EXPLAIN PLAN FOR
SELECT count(*)
FROM part_test
WHERE starttime >= SYSDATE - 2;
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |
| 0 | SELECT STATEMENT | | 1 | 8 | 7895 (1)| 00:00:01 | | |
| 1 | SORT AGGREGATE | | 1 | 8 | | | | |
| 2 | PARTITION RANGE ITERATOR| | 111K| 867K| 7895 (1)| 00:00:01 | KEY |1048575|
|* 3 | TABLE ACCESS FULL | PART_TEST | 111K| 867K| 7895 (1)| 00:00:01 | KEY |1048575|
Predicate Information (identified by operation id):
3 - filter("STARTTIME">=SYSDATE@!-2)
4) Now do the same query but with SYSDATE - 2 presented as a literal value.
This query returns the same answer but very different cost.
EXPLAIN PLAN FOR
SELECT count(*)
FROM part_test
WHERE starttime >= (to_date('23122013:0950','DDMMYYYY:HH24MI'))-2;
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |
| 0 | SELECT STATEMENT | | 1 | 8 | 131 (0)| 00:00:01 | | |
| 1 | SORT AGGREGATE | | 1 | 8 | | | | |
| 2 | PARTITION RANGE ITERATOR| | 111K| 867K| 131 (0)| 00:00:01 | 356 |1048575|
|* 3 | TABLE ACCESS FULL | PART_TEST | 111K| 867K| 131 (0)| 00:00:01 | 356 |1048575|
Predicate Information (identified by operation id):
3 - filter("STARTTIME">=TO_DATE(' 2013-12-21 09:50:00', 'syyyy-mm-dd hh24:mi:ss'))
thanks in anticipation
Jim
As Jonathan has already pointed out there are situations where the CBO knows that partition pruning will occur but is unable to identify those partitions at parse time. The CBO will then use a dynamic pruning which means determine the partitions to eliminate dynamically at run time. This is why you see the KEY information instead of a known partition number. This is to occur mainly when you compare a function to your partition key i.e. where partition_key = function. And SYSDATE is a function. For the other bizarre PSTOP number (1048575) see this blog
http://hourim.wordpress.com/2013/11/08/interval-partitioning-and-pstop-in-execution-plan/
Best regards
Mohamed Houri
Similar Messages
-
Red Hat Enterprise Linux Test Page - why am I directed to this page when I go to a specific website. It does not happen when I use other browsers so there is not a problem with the website.
Just started happening yesterday.Clear the cache and the cookies from sites that cause problems.
"Clear the Cache":
*Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
"Remove Cookies" from sites causing problems:
*Tools > Options > Privacy > Cookies: "Show Cookies"
Do you see any prefs related to that <b>knoxnews<i></i>.com</b> site on the <b>about:config</b> page if you enter that URL in the Filter?
*http://kb.mozillazine.org/about:config
Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
*Don't make any changes on the Safe mode start window.
*https://support.mozilla.com/kb/Safe+Mode -
I read many financial documents during the day. I sometimes print only a selected segment of an article or a financial statement. When I print selected only, the top line or 2 lines is omitted from the print document. It does not happen in explorer.
I used Firefox for years, and this just started in the last 3 weeks or so. I can get around it by just selecting 2 lines above what I want to print. But, it is annoying.* [[Printing a web page]]
* [[Firefox prints incorrectly]]
Check and tell if its working. -
In Facebook, when I click on any individual photo it will not display. Everything, including the caption, displays fine but not the picture itself. If I use AOL as my browser this does not happen, only on Firefox.
Check the image exceptions: Tools > Options > Content: Load Images: Exceptions - See [[Options window - Content panel]]
A way to see which images are blocked is to click the favicon (<i>Site Identification</i> icon) on the left side of the location bar.<br />
A click on the "More Information" button will open the Security tab of the "Page Info" window (also accessible via "Tools > Page Info").<br />
Open the <i>Media</i> tab of the "Page Info" window.<br />
Select the first image and scroll down though the list with the Down arrow key.<br />
If an image in the list is grayed and there is a check-mark in the box "<i>Block Images from...</i>" then remove that mark to unblock the images from that domain.<br />
See also [[Images or animations do not show]] and http://kb.mozillazine.org/Images_or_animations_do_not_load -
This may have happened when Firefox was updating to version 4 it was trying to connect forever and I x'ed out of the update screen. But I am not sure that this caused the problem. I have reinstalled Java, but this did not help. I tried to reset the computer do an older date, and the system will not let me reset.
This issue can be caused by an extension that isn't working properly.
Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
* Don't make any changes on the Safe mode start window.
* https://support.mozilla.com/kb/Safe+Mode
* [[Troubleshooting extensions and themes]]
If it does work in Safe-mode then disable all extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
* Use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
* Close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")
In Firefox 4 you can use one of these to start in <u>[[Safe mode]]</u>:
* Help > Restart with Add-ons Disabled
* Hold down the Shift key while double clicking the Firefox desktop shortcut (Windows) -
Partitioned IOT of Object Type - mapping table not allowed for bitmap index
Hi,
looks like a feature available for standard Partitioned IOTs is not supported for object based tables, namely the MAPPING TABLE construct to support secondary local bitmap indexes.
Can you confirm behaviour is as expected/documented?
If so, is a fix/enhancement to support mapping table for object-based Partitioned IOTs in the pipeline?
Results for partition-wise load using pipelined table function are very good, look-ups across tens of millions of rows are excellent.
Environment = Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
OS = Oracle Enterprise Linux Server release 5.2 (Carthage) 2.6.18 92.el5 (32-bit)
Here's the potted test-case...
1) First the non object based Partitioned IOT - data is range-partitioned across the alphabet
CREATE TABLE IOT_Table (
textData VARCHAR2(10),
numberData NUMBER(10,0),
CONSTRAINT IOT_Table_PK PRIMARY KEY(textData))
ORGANIZATION INDEX MAPPING TABLE PCTFREE 0 TABLESPACE Firewire
PARTITION BY RANGE (textData)
(PARTITION Text_Part_A VALUES LESS THAN ('B') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_B VALUES LESS THAN ('C') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_C VALUES LESS THAN ('D') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_D VALUES LESS THAN ('E') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_E VALUES LESS THAN ('F') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_F VALUES LESS THAN ('G') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_G VALUES LESS THAN ('H') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_H VALUES LESS THAN ('I') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_I VALUES LESS THAN ('J') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_J VALUES LESS THAN ('K') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_K VALUES LESS THAN ('L') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_L VALUES LESS THAN ('M') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_M VALUES LESS THAN ('N') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_N VALUES LESS THAN ('O') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_O VALUES LESS THAN ('P') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_P VALUES LESS THAN ('Q') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_Q VALUES LESS THAN ('R') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_R VALUES LESS THAN ('S') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_S VALUES LESS THAN ('T') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_T VALUES LESS THAN ('U') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_U VALUES LESS THAN ('V') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_V VALUES LESS THAN ('W') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_W VALUES LESS THAN ('X') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_X VALUES LESS THAN ('Y') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_Y VALUES LESS THAN ('Z') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_Z VALUES LESS THAN (MAXVALUE) PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0))
NOLOGGING PARALLEL -- FLASHBACK ARCHIVE IOT_Flashback_Data
SQL> table IOT_TABLE created.
2) Create the local secondary bitmap index utilising the underlying mapping table
CREATE BITMAP INDEX IOT_Table_BMI1 ON IOT_Table (numberData)
LOCAL STORAGE (INITIAL 1M PCTINCREASE 0 NEXT 512K) NOLOGGING PARALLEL;
SQL> bitmap index IOT_TABLE_BMI1 created.
3) Quick test to confirm all ok
SQL> INSERT INTO IOT_Table VALUES ('ABC123',100);
SQL> 1 rows inserted.
SQL> SELECT * FROM IOT_Table;
TEXTDATA NUMBERDATA
ABC123 100
4) Now create a minimal object type to use as the template for object table
CREATE TYPE IOT_type AS OBJECT
textData VARCHAR2(10 CHAR),
numberData NUMBER(10,0)
) FINAL
SQL> TYPE IOT_type compiled
5) Attempt to create an object-based range partitioned IOT, including MAPPING TABLE clause as per step (1)
CREATE TABLE IOTObj_Table OF IOT_type (textData PRIMARY KEY)
OBJECT IDENTIFIER IS PRIMARY KEY ORGANIZATION INDEX
MAPPING TABLE -- we'd like to use this feature to enable use of Bitmap Indexes...
PCTFREE 0 TABLESPACE Firewire
PARTITION BY RANGE (textData)
(PARTITION Text_Part_A VALUES LESS THAN ('B') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_B VALUES LESS THAN ('C') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_C VALUES LESS THAN ('D') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_D VALUES LESS THAN ('E') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_E VALUES LESS THAN ('F') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_F VALUES LESS THAN ('G') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_G VALUES LESS THAN ('H') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_H VALUES LESS THAN ('I') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_I VALUES LESS THAN ('J') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_J VALUES LESS THAN ('K') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_K VALUES LESS THAN ('L') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_L VALUES LESS THAN ('M') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_M VALUES LESS THAN ('N') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_N VALUES LESS THAN ('O') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_O VALUES LESS THAN ('P') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_P VALUES LESS THAN ('Q') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_Q VALUES LESS THAN ('R') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_R VALUES LESS THAN ('S') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_S VALUES LESS THAN ('T') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_T VALUES LESS THAN ('U') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_U VALUES LESS THAN ('V') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_V VALUES LESS THAN ('W') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_W VALUES LESS THAN ('X') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_X VALUES LESS THAN ('Y') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_Y VALUES LESS THAN ('Z') PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0),
PARTITION Text_Part_Z VALUES LESS THAN (MAXVALUE) PCTFREE 0 TABLESPACE Firewire Storage (Initial 10M Next 1M PCTIncrease 0))
NOLOGGING PARALLEL -- FLASHBACK ARCHIVE IOT_Flashback_Data
This errors out with the following...
SQL Error: ORA-25182: feature not currently available for index-organized tables
25182. 00000 - "feature not currently available for index-organized tables"
*Cause: An attempt was made to use one or more of the following feature(s) not
currently supported for index-organized tables:
CREATE TABLE with LOB/BFILE/VARRAY columns,
partitioning/PARALLEL/CREATE TABLE AS SELECT options,
ALTER TABLE with ADD/MODIFY column options, CREATE INDEX
*Action: Do not use the disallowed feature(s) in this release.
6) Re-running the create table statement in step 5 without the MAPPING TABLE clause works fine. Not surprisingly an attempt to create a secondary local bitmap index on this table fails as there's no mapping table, like so...
CREATE BITMAP INDEX IOTObj_Table_BMI1 ON IOTObj_Table (numberData)
LOCAL STORAGE (INITIAL 1M PCTINCREASE 0 NEXT 512K) NOLOGGING PARALLEL;
CREATE TABLE with LOB/BFILE/VARRAY columns,
partitioning/PARALLEL/CREATE TABLE AS SELECT options,
ALTER TABLE with ADD/MODIFY column options, CREATE INDEX
*Action: Do not use the disallowed feature(s) in this release.
CREATE BITMAP INDEX IOTObj_Table_BMI1 ON IOTObj_Table (numberData)
LOCAL STORAGE (INITIAL 1M PCTINCREASE 0 NEXT 512K) NOLOGGING PARALLEL
Error at Command Line:99 Column:13
Error report:
SQL Error: ORA-00903: invalid table name
00903. 00000 - "invalid table name"
7) Creating a secondary local b-tree index is fine, like so...
SQL> CREATE INDEX IOTObj_Table_I1 ON IOTObj_Table (numberData)
LOCAL STORAGE (INITIAL 1M PCTINCREASE 0 NEXT 512K) NOLOGGING PARALLEL;
index IOTOBJ_TABLE_I1 created.
8) A quick test to ensure object table ok...
SQL> INSERT INTO IOTObj_Table VALUES (IOT_Type('DEF456',500));
SQL> 1 rows inserted.
SQL> SELECT * FROM IOTObj_Table;
TEXTDATA NUMBERDATA
DEF456 500Thanks Dan,
the intention is to range partition based on the initial character, so A* -> Text_Part_A, B* -> Text_Part_B, and so on.
Here's an example, using an empty IOTObj_Table as created previously.
1) Set up & confirm some test data (two 'D's, one 'N', and two 'Z's)
SQL> INSERT INTO IOTObj_Table VALUES (IOT_Type('DEF456',500));
SQL> INSERT INTO IOTObj_Table VALUES (IOT_Type('DDD111',510));
SQL> INSERT INTO IOTObj_Table VALUES (IOT_Type('N3000',515));
SQL> INSERT INTO IOTObj_Table VALUES (IOT_Type('ZZ1212',520));
SQL> INSERT INTO IOTObj_Table VALUES (IOT_Type('Z111X',530));
SQL> COMMIT;
SQL> SELECT * FROM IOTObj_Table;
TEXTDATA NUMBERDATA
DDD111 510
DEF456 500
N3000 515
Z111X 530
ZZ1212 520
2) Just to prove our IOT is enforcing the Primary Key based on the TextData attribute, try to insert a duplicate
SQL> INSERT INTO IOTObj_Table VALUES (IOT_Type('Z111X',530));
Error starting at line 141 in command:
INSERT INTO IOTObj_Table VALUES (IOT_Type('Z111X',530))
Error report:
SQL Error: ORA-00001: unique constraint (OCDataSystems.SYS_IOT_TOP_84235) violated
00001. 00000 - "unique constraint (%s.%s) violated"
*Cause: An UPDATE or INSERT statement attempted to insert a duplicate key.
For Trusted Oracle configured in DBMS MAC mode, you may see
this message if a duplicate entry exists at a different level.
*Action: Either remove the unique restriction or do not insert the key.
3) Now confirm that our data has been slotted into the range-based partition we expect using the PARTITION clause of SELECT...
- The two 'D's...
SQL> SELECT * FROM IOTObj_Table PARTITION (Text_Part_D);
TEXTDATA NUMBERDATA
DDD111 510
DEF456 500
- The single 'N'...
SQL> SELECT * FROM IOTObj_Table PARTITION (Text_Part_N);
TEXTDATA NUMBERDATA
N3000 515
- The two 'Z's...
SQL> SELECT * FROM IOTObj_Table PARTITION (Text_Part_Z);
TEXTDATA NUMBERDATA
Z111X 530
ZZ1212 520
4) And to wrap up confirm an empty partition
SELECT * FROM IOTObj_Table PARTITION (Text_Part_W); -
Non-Partitioned Global Index on Range-Partitioned Table.
Hi All,
Is it possible to create Non-Partitioned Global Index on Range-Partitioned Table?
We have 4 indexes on CS_BILLING range-partitioned table, in which one is CBS_CLIENT_CODE(*local partitioned index*) and others are unknown types of index to me??
Means other 3 indexes are what type indexes ...either non-partitioned global index OR non-partitioned normal index??
Also if we create index as :(create index i_name on t_name(c_name)) By default it will create Global index. Please correct me......
Please help me in identifying other 3 indexes types by referring below ouputs!!!
select INDEX_NAME,TABLE_NAME,PARTITIONING_TYPE,LOCALITY from dba_part_indexes where TABLE_NAME='CS_BILLING';
INDEX_NAME TABLE_NAME PARTITI LOCALI
CSB_CLIENT_CODE CS_BILLING RANGE LOCAL
select index_name,index_type,table_name,table_type,PARTITIONED from dba_indexes where table_name='CS_BILLING';
INDEX_NAME INDEX_TYPE TABLE_NAME TABLE_TYPE PAR
CSB_CREATE_DATE NORMAL CS_BILLING TABLE NO
CSB_SUBMIT_ORDER NORMAL CS_BILLING TABLE NO
CSB_CLIENT_CODE NORMAL CS_BILLING TABLE YES
CSB_ORDER_NBR NORMAL CS_BILLING TABLE NO
select INDEX_OWNER,INDEX_NAME,TABLE_NAME,COLUMN_NAME from dba_ind_columns where TABLE_NAME='CS_BILLING';
INDEX_OWNER INDEX_NAME TABLE_NAME COLUMN_NAME
RPADMIN CSB_CREATE_DATE CS_BILLING CREATE_DATE
RPADMIN CSB_SUBMIT_ORDER CS_BILLING SUBMIT_TO_INVOICE
RPADMIN CSB_SUBMIT_ORDER CS_BILLING ORDER_NBR
RPADMIN CSB_CLIENT_CODE CS_BILLING CLIENT_CODE
RPADMIN CSB_ORDER_NBR CS_BILLING ORDER_NBR
select dip.index_name, dpi.locality, dip.partition_name, dip.status
from dba_part_indexes dpi, dba_ind_partitions dip
where dpi.table_name ='CS_BILLING'
and dpi.index_name = dip.index_name;
INDEX_NAME LOCALI PARTITION_NAME STATUS
CSB_CLIENT_CODE LOCAL CSB_2006_4Q USABLE
CSB_CLIENT_CODE LOCAL CSB_2006_3Q USABLE
CSB_CLIENT_CODE LOCAL CSB_2007_1Q USABLE
CSB_CLIENT_CODE LOCAL CSB_2007_2Q USABLE
CSB_CLIENT_CODE LOCAL CSB_2007_3Q USABLE
CSB_CLIENT_CODE LOCAL CSB_2007_4Q USABLE
CSB_CLIENT_CODE LOCAL CSB_2008_1Q USABLE
CSB_CLIENT_CODE LOCAL CSB_2008_2Q USABLE
CSB_CLIENT_CODE LOCAL CSB_2008_3Q USABLE
CSB_CLIENT_CODE LOCAL CSB_2008_4Q USABLE
CSB_CLIENT_CODE LOCAL CSB_2009_1Q USABLE
CSB_CLIENT_CODE LOCAL CSB_2009_2Q USABLE
CSB_CLIENT_CODE LOCAL CSB_2009_3Q USABLE
CSB_CLIENT_CODE LOCAL CSB_2009_4Q USABLE
select * from dba_part_indexes
where table_name ='CS_BILLING'
and locality = 'GLOBAL';
no rows selected
-Yasser
Edited by: YasserRACDBA on Mar 5, 2009 11:45 PMYaseer,
Is it possible to create Non-Partitioned and Global Index on Range-Partitioned Table?
Yes
We have 4 indexes on CS_BILLING range-partitioned table, in which one is CBS_CLIENT_CODE(*local partitioned index*) and others are unknown types of index to me??
Means other 3 indexes are what type indexes ...either non-partitioned global index OR non-partitioned normal index??
You got local index and 3 non-partitioned "NORMAL" b-tree tyep indexes
Also if we create index as :(create index i_name on t_name(c_name)) By default it will create Global index. Please correct me......
Above staement will create non-partitioned index
Here is an example of creating global partitioned indexes
CREATE INDEX month_ix ON sales(sales_month)
GLOBAL PARTITION BY RANGE(sales_month)
(PARTITION pm1_ix VALUES LESS THAN (2)
PARTITION pm2_ix VALUES LESS THAN (3)
PARTITION pm3_ix VALUES LESS THAN (4)
PARTITION pm12_ix VALUES LESS THAN (MAXVALUE));Regards -
Can I use SYSDATE in the WHERE clause to limit the date range of a query
Hi,
Basicaly the subject title(Can I use SYSDATE in the WHERE clause to limit the date range of a query) is my question.
Is this possible and if it is how can I use it. Do I need to join the table to DUAL?
Thanks in advance.
SteliosAs previous poster said, no data is null value, no value. If you want something, you have nvl function to replace null value by an other more significative value in your query.<br>
<br>
Nicolas. -
Trying to use a where clause from a table
hi,
I have a report and I need to use a where clause that is archived in a table, it is a different one depending on the row (colour=blue or number = 88..) I have tryied with ref cursor, dinamis sql, functions, packages and could not get it, any suggestion??
thanksYou may use Lexical Rerefences: "Lexical references are placeholders for text that you embed in a SELECT statement. You can use lexical references to replace the clauses appearing after SELECT, FROM, WHERE, GROUP BY, ORDER BY, HAVING, CONNECT BY, and START WITH....."
-
When I try to play music downloaded from itunes on my iPhone 4S it says 'this URL is not found on the server'. This does not happen when I play the same music on my iPad. The music plays fine. The message also comes up when I try and login to iTunes on my iMac. Can anyone help?
I too am having the same issue as the OP.
Your USER AGENT information is Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/600.3.18 (KHTML, like Gecko) Version/8.0.3 Safari/600.3.18
Every webserver that receives a request from your browser is able to determine the HTTP USER AGENT information unless it has been removed by some software (e.g. firewall) before the request was trasmitted. -
When I compose an email in either gmail or yahoo, the cursor lags behind for about 2 seconds. This does not happen when I compose an email with Safari or Chrome. I am using a Mac with Firefox version 3.6.3. Any idea why this happens?
== This happened ==
Every time Firefox openedtry
The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information.
Note: ''This will cause you to lose any Extensions, Open websites, and some Preferences.''
To Reset Firefox do the following:
#Go to Firefox > Help > Troubleshooting Information.
#Click the "Reset Firefox" button.
#Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
#Firefox will open with all factory defaults applied.
Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
Did this fix your problems? Please report back to us!
Thank you. -
Why do text messages from my iPad appear to some people as if they came from my email address instead of my phone number? This does not happen when I send text messages from my iPhone.
You need to link your iPhone number to Messages - and Facetime if you use it. For Messages go to Settings>Messages>Send and Receive at>You can be reached by iMessage at. If your phone number is showing there, select it as your Contact address. If it doesn't appear in there, take a look at the end of this article for help.
iOS and OS X: Link your phone number and Apple ID for use with FaceTime and iMessage - Apple Support -
How do I download a slide show with captions and music to my IPad? It is not happening when I sync.
The way that you would transfer photos from iPhoto to the iPad would be to sync with iTunes. Connect the iPad to your Mac with the cable and launch iTunes. Select your iPad under the devices heading on the left. Then click on the Photos tab in the iTunes window on the right. You can select the folder from which you want to sync your photos in the drop down menu bar - so select iPhoto there. Then select the album or events that you want to sync from the windows below. After you have made your selections, click on Apply in the lower right corner of iTunes.
I am not sure how the iPad will handle a slide show in the photos app that was created on your Mac. You can create basic slide shows on the iPad using the different albums, events or faces that you have in the Photo app, but as for the captioning that you have already set up, I don't know how that will work in the app when you sync the slide show. -
I purchased my Macbook (17") through a certified apple tecnition in August 2012, it was refurbished and the motherboard was completely replaced. I do a lot of photo editing, but I have been unable to do so because of the red vibrating lines that interrupt my screen. The issue disappears temporarily when I tap on the computer, and the problem does not occur when I use external display or try to screen capture the problem. I brought the computer back to the technition I purchased it from and he said that it was a problem with my fan, so I have two new fans but the issue is still occuring. He says he doesnt know whats wrong. Does anyone have any information on this issue?
Here is an image of the issue
http://www.flickr.com/photos/67839707@N08/8884847081/I recommend having your Mac serviced by someone competent. A force sufficient to "blow apart" the fans was clearly excessive and may have damaged the display cable, as well as any number of other problems.
Dust is properly cleaned with a vacuum, preferably one designed for computer service, and they are not cheap.
Compressed air should never be used. It just blows dust everywhere, often into places where it can no longer be removed. -
This sentence (in french version) "le fichier ne commence pas par '%PDF-'" appears when I try to open some (not all, mainly bigger than 1Mo) PDF files within Firefox (does not happen when I download the file)
You mention Thunderbird, has the PDF file been emailed to you? If it has this support page from Adobe may help - http://www.adobe.com/fr/support/toptech/acrobat/319294/
Maybe you are looking for
-
ORA-02018: database link of same name has an open connection
Hi All, Am getting the above error msg from a procedure (packaged or not, doesn't seem to matter), run from a .SQL script through sqlPlus, where I've created a DB link, fired off a bunch of queries against it using dynamic SQL, and then tried to drop
-
I downloaded Mountain Lion on my Macbook Air, and it works without a hitch except for internet connectivity. It keeps losing the signal. My Macbook using the same connection is solid as a rock and never loses the connection. Is there something I can
-
Database adapter not returning all the records
I've taken over a BPEL from a developer who left the organization and have been having an issue during our User Acceptance Testing. We are querying a table that will return the insurance enrollment information for employee's and their dependants. Whe
-
I am trying to get this to work so I can try http://redcareditor.com/ but I am having problems: ==> Making package: ruby-gtkmozembed 0.18.1-1 x86_64 (Wed May 6 17:28:00 EDT 2009) ==> Checking Runtime Dependencies... ==> Checking Buildtime Dependencie
-
How to download the Javadoc for Java 7
I can't find the download for the Javadoc for Java 7. This is needed for the NetBeans auto help function. Where is it please?