Pagination and first_rows hint
For a report region, how does HTML DB pagination work if the query has a first_rows hint in it?
The pagination scheme I am talking about is the "simplest" one, Rows X to Y with next/previous links.
Suppose I have a large resultset (in the thousands). first_rows is designed to optimize the execution plan for fast response time. So I get my first few pages fast. As successive pages are fetched, it would start to get slower and slower, right? Especially because the HTML DB engine fetches all the rows for every page over and over again and discards all the rows before the currently displayed window.
So, given a large resultset, is it advisable to first_rows hint the query?
Heck forget the size of the resultset, wouldnt it make sense to first_rows hint all queries since interactive web apps always fast response to queries?
Can someone please explain how all this works?
Thanks
I would expect most of the time a user would only
page through the first few pages - if they need toAbsent the first_rows hint, the CBO behaviour is to optimize for best overall performance (corresponding to the the all_rows hint)
Steve, I agree with you completely. So, since the user is going to page thru the first handful of pages anyway, why would I want to expend database resources to optimize for all_rows?
I think my concern about getting slower and slower is very much justified. If I have a query region using htmldb_item calls to create a manual tabular form, each next/previous link fetches all the records from 1 all over again and discards rows that fall before the requested rows. There would be tons of wasted calls to htmldb_item and the associated context switching between SQL and PL/SQL.
[When the pagination scheme is Rows X to Y, I fail to understand why HTML DB doesnt use the clever pagination technique Tom suggests at
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:127412348064
This would get just the rows needed and avoid unnecessary calls to htmldb_item. But I digress from the question I raised on this thread...]
Tyler, Tom is not a big fan of hints, but he does recommend 2 hints that "give information" to the CBO that it wouldnt otherwise have. Those 2 hints are first_rows and cardinality!
Thanks
Similar Messages
-
Using First_rows hints change the sql plan
Dear All,
I have a query with a first_rows hint and this causing it to used sub-optimal plan by choosing the wrong indexes.
Besides, its applied a conversion function to the where clause condition compared if the case if it is using the right plan.
Appreciate if you can throw some light on using the first_rows hint
Thanks
Rgds
UngHi, attached is the two plans as well the 10053 for the two plans. As you can see, with the first_rows hint, the consistent gets is 9049 while without the hints is only 5 blocks.
Execution Plan
0
SELECT STATEMENT Optimizer=HINT: FIRST_ROWS (Cost=4521 Card=3 Bytes=357)
1 0
TABLE ACCESS (BY INDEX ROWID) OF 'MHDISL' (Cost=4521 Card=3 Bytes=357)
2 1
INDEX (RANGE SCAN) OF 'MHDISL10' (NON-UNIQUE) (Cost=4520 Card=3)
Statistics
0 recursive calls
0 db block gets
9049 consistent gets
0 physical reads
0 redo size
2501 bytes sent via SQL*Net to client
656 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed
Execution Plan
0
SELECT STATEMENT Optimizer=CHOOSE (Cost=4 Card=3 Bytes=357)
1 0
TABLE ACCESS (BY INDEX ROWID) OF 'MHDISL' (Cost=4 Card=3 Bytes=357)
2 1
INDEX (RANGE SCAN) OF 'MHDISL00' (UNIQUE) (Cost=3 Card=3)
Statistics
0 recursive calls
0 db block gets
5 consistent gets
0 physical reads
0 redo size
2501 bytes sent via SQL*Net to client
656 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed
-------10053
/u01/app/oracle/admin/FMSB/udump/fmsb_ora_5484.trc
Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.7.0 - Production
ORACLE_HOME = /u01/app/oracle/product/9.2.0
System name: SunOS
Node name: ffmdb
Release: 5.8
Version: Generic_108528-22
Machine: sun4u
Instance name: FMSB
Redo thread mounted by this instance: 1
Oracle process number: 141
Unix process pid: 5484, image: oracle@ffmdb (TNS V1-V3)
*** 2009-01-20 15:21:54.490
*** SESSION ID:(201.51419) 2009-01-20 15:21:54.327
QUERY
seLECT /*+ first_Rows */* FROM MVXJDTA.MHDISL WHERE URCONO= 100
AND URDLIX=1000000001
ORDER BY URCONO,URDLIX,URRORC,URRIDN,URRIDL
*** SESSION ID:(201.51419) 2009-01-20 15:22:02.887
QUERY
DELETE FROM PLAN_TABLE WHERE STATEMENT_ID=:1
PARAMETERS USED BY THE OPTIMIZER
OPTIMIZER_FEATURES_ENABLE = 9.2.0
OPTIMIZER_MODE/GOAL = Choose
OPTIMIZERPERCENT_PARALLEL = 101
HASH_AREA_SIZE = 6144000
HASH_JOIN_ENABLED = TRUE
HASH_MULTIBLOCK_IO_COUNT = 0
SORT_AREA_SIZE = 3072000
OPTIMIZER_SEARCH_LIMIT = 5
PARTITION_VIEW_ENABLED = FALSE
ALWAYSSTAR_TRANSFORMATION = FALSE
BTREE_BITMAP_PLANS = TRUE
STAR_TRANSFORMATION_ENABLED = FALSE
COMPLEXVIEW_MERGING = TRUE
PUSHJOIN_PREDICATE = TRUE
PARALLEL_BROADCAST_ENABLED = TRUE
OPTIMIZER_MAX_PERMUTATIONS = 2000
OPTIMIZER_INDEX_CACHING = 0
SYSTEMINDEX_CACHING = 0
OPTIMIZER_INDEX_COST_ADJ = 100
OPTIMIZER_DYNAMIC_SAMPLING = 1
OPTIMIZERDYN_SMP_BLKS = 32
QUERY_REWRITE_ENABLED = FALSE
QUERY_REWRITE_INTEGRITY = ENFORCED
INDEXJOIN_ENABLED = TRUE
SORTELIMINATION_COST_RATIO = 0
OREXPAND_NVL_PREDICATE = TRUE
NEWINITIAL_JOIN_ORDERS = TRUE
ALWAYS_ANTI_JOIN = CHOOSE
ALWAYS_SEMI_JOIN = CHOOSE
OPTIMIZERMODE_FORCE = TRUE
OPTIMIZERUNDO_CHANGES = FALSE
UNNESTSUBQUERY = TRUE
PUSHJOIN_UNION_VIEW = TRUE
FASTFULL_SCAN_ENABLED = TRUE
OPTIMENHANCE_NNULL_DETECTION = TRUE
ORDEREDNESTED_LOOP = TRUE
NESTEDLOOP_FUDGE = 100
NOOR_EXPANSION = FALSE
QUERYCOST_REWRITE = TRUE
QUERY_REWRITE_EXPRESSION = TRUE
IMPROVEDROW_LENGTH_ENABLED = TRUE
USENOSEGMENT_INDEXES = FALSE
ENABLETYPE_DEP_SELECTIVITY = TRUE
IMPROVEDOUTERJOIN_CARD = TRUE
OPTIMIZERADJUST_FOR_NULLS = TRUE
OPTIMIZERCHOOSE_PERMUTATION = 0
USECOLUMN_STATS_FOR_FUNCTION = TRUE
SUBQUERYPRUNING_ENABLED = TRUE
SUBQUERYPRUNING_REDUCTION_FACTOR = 50
SUBQUERYPRUNING_COST_FACTOR = 20
LIKEWITH_BIND_AS_EQUALITY = FALSE
TABLESCAN_COST_PLUS_ONE = TRUE
SORTMERGEINEQUALITY_JOIN_OFF = FALSE
DEFAULTNON_EQUALITY_SEL_CHECK = TRUE
ONESIDECOLSTAT_FOR_EQUIJOINS = TRUE
OPTIMIZERCOST_MODEL = CHOOSE
GSETSALWAYS_USE_TEMPTABLES = FALSE
DB_FILE_MULTIBLOCK_READ_COUNT = 32
NEWSORT_COST_ESTIMATE = TRUE
GSANTI_SEMI_JOIN_ALLOWED = TRUE
CPUTO_IO = 0
PREDMOVE_AROUND = TRUE
BASE STATISTICAL INFORMATION
Table stats Table: MHDISL Alias: MHDISL
TOTAL :: CDN: 1592807 NBLKS: 27904 AVG_ROW_LEN: 119
-- Index stats
INDEX NAME: MHDISL00 COL#: 1 2 3 4 5
TOTAL :: LVLS: 2 #LB: 8769 #DK: 1599266 LB/K: 1 DB/K: 1 CLUF: 356837
INDEX NAME: MHDISL10 COL#: 1 3 4 5 2
TOTAL :: LVLS: 2 #LB: 9036 #DK: 1608279 LB/K: 1 DB/K: 1 CLUF: 424881
INDEX NAME: MHDISL30 COL#: 1 2 3 4 16 5
TOTAL :: LVLS: 2 #LB: 9493 #DK: 1599279 LB/K: 1 DB/K: 1 CLUF: 356844
INDEX NAME: MHDISL40 COL#: 1 2 9 10 11 3 4 5
TOTAL :: LVLS: 2 #LB: 11082 #DK: 1599282 LB/K: 1 DB/K: 1 CLUF: 388975
OPTIMIZERPERCENT_PARALLEL = 0
SINGLE TABLE ACCESS PATH
Column: URCONO Col#: 1 Table: MHDISL Alias: MHDISL
NDV: 2 NULLS: 0 DENS: 5.0000e-01 LO: 100 HI: 999
NO HISTOGRAM: #BKT: 1 #VAL: 2
Column: URDLIX Col#: 2 Table: MHDISL Alias: MHDISL
NDV: 295495 NULLS: 0 DENS: 3.3842e-06 LO: 1000000001 HI: 930000
1938
NO HISTOGRAM: #BKT: 1 #VAL: 2
TABLE: MHDISL ORIG CDN: 1592807 ROUNDED CDN: 3 CMPTD CDN: 3
Access path: tsc Resc: 1702 Resp: 1702
Skip scan: ss-sel 0 andv 292691
ss cost 292691
index io scan cost 1
Access path: index (scan)
Index: MHDISL00
TABLE: MHDISL
RSC_CPU: 0 RSC_IO: 4
IX_SEL: 1.6921e-06 TB_SEL: 1.6921e-06
Skip scan: ss-sel 0 andv 292691
ss cost 292691
index io scan cost 4518
Access path: index (scan)
Index: MHDISL10
TABLE: MHDISL
RSC_CPU: 0 RSC_IO: 4521
IX_SEL: 5.0000e-01 TB_SEL: 1.6921e-06
Skip scan: ss-sel 0 andv 292691
ss cost 292691
index io scan cost 1
Access path: index (scan)
Index: MHDISL30
TABLE: MHDISL
RSC_CPU: 0 RSC_IO: 4
IX_SEL: 1.6921e-06 TB_SEL: 1.6921e-06
Skip scan: ss-sel 0 andv 292691
ss cost 292691
index io scan cost 1
Access path: index (scan)
Index: MHDISL40
TABLE: MHDISL
RSC_CPU: 0 RSC_IO: 4
IX_SEL: 1.6921e-06 TB_SEL: 1.6921e-06
BEST_CST: 4.00 PATH: 4 Degree: 1
OPTIMIZER STATISTICS AND COMPUTATIONS
GENERAL PLANS
Join order[1]: MHDISL[MHDISL]#0
Best so far: TABLE#: 0 CST: 4 CDN: 3 BYTES: 357
****** Recost for ORDER BY (using index) ************
SINGLE TABLE ACCESS PATH
TABLE: MHDISL ORIG CDN: 1592807 ROUNDED CDN: 3 CMPTD CDN: 3
Access path: tsc Resc: 1702 Resp: 1702
Skip scan: ss-sel 0 andv 292691
ss cost 292691
index io scan cost 4518
Access path: index (scan)
Index: MHDISL10
TABLE: MHDISL
RSC_CPU: 0 RSC_IO: 4521
IX_SEL: 5.0000e-01 TB_SEL: 1.6921e-06
BEST_CST: 4521.00 PATH: 4 Degree: 1
Join order[1]: MHDISL[MHDISL]#0
Best so far: TABLE#: 0 CST: 4521 CDN: 3 BYTES: 357
SORT resource Sort statistics
Sort width: 7 Area size: 131072 Max Area size: 5242880
Degree: 1
Blocks to Sort: 1 Row size: 141 Rows: 3
Initial runs: 1 Merge passes: 1 IO Cost / pass: 2
Total IO sort cost: 2
Total CPU sort cost: 0
Total Temp space used: 0
Final - First Rows Plan:
JOIN ORDER: 1
CST: 4521 CDN: 3 RSC: 4521 RSP: 4521 BYTES: 357
IO-RSC: 4521 IO-RSP: 4521 CPU-RSC: 0 CPU-RSP: 0
First Rows Plan
QUERY
EXPLAIN PLAN SET STATEMENT_ID='PLUS114150' FOR seLECT /*+ first_Rows */* FROM MV
XJDTA.MHDISL WHERE URCONO= 100
AND URDLIX=1000000001
ORDER BY URCONO,URDLIX,URRORC,URRIDN,URRIDL
PLAN
Cost of plan: 4521
Operation...........Object name.....Options.........Id...Pid..
SELECT STATEMENT 0
TABLE ACCESS MHDISL BY INDEX ROWID 1
INDEX MHDISL10 RANGE SCAN 2 1
QUERY
SELECT ID ID_PLUS_EXP,PARENT_ID PARENT_ID_PLUS_EXP,LPAD(' ',2*(LEVEL-1))||OPERAT
ION||DECODE(OTHER_TAG,NULL,'','*')||DECODE(OPTIONS,NULL,'',' ('||OPTIONS||')')||
DECODE(OBJECT_NAME,NULL,'',' OF '''||OBJECT_NAME||'''')||DECODE(OBJECT_TYPE,NULL
,'',' ('||OBJECT_TYPE||')')||DECODE(ID,0,DECODE(OPTIMIZER,NULL,'',' Optimizer='|
|OPTIMIZER))||DECODE(COST,NULL,'',' (Cost='||COST||DECODE(CARDINALITY,NULL,'','
Card='||CARDINALITY)||DECODE(BYTES,NULL,'',' Bytes='||BYTES)||')') PLAN_PLUS_EXP
,OBJECT_NODE OBJECT_NODE_PLUS_EXP FROM PLAN_TABLE START WITH ID=0 AND STATEMENT_
ID=:1 CONNECT BY PRIOR ID=PARENT_ID AND STATEMENT_ID=:1 ORDER BY ID,POSITION
QUERY
SELECT ID ID_PLUS_EXP,OTHER_TAG OTHER_TAG_PLUS_EXP,OTHER OTHER_PLUS_EXP FROM PLA
N_TABLE WHERE STATEMENT_ID=:1 AND OTHER_TAG IS NOT NULL ORDER BY ID
QUERY
DELETE FROM PLAN_TABLE WHERE STATEMENT_ID=:1
*** 2009-01-20 15:29:36.507
*** SESSION ID:(201.51419) 2009-01-20 15:29:36.507
QUERY
SELECT * FROM MVXJDTA.MHDISL WHERE URCONO= 100
AND URDLIX=1000000001
ORDER BY URCONO,URDLIX,URRORC,URRIDN,URRIDL
*** SESSION ID:(201.51419) 2009-01-20 15:29:38.307
QUERY
DELETE FROM PLAN_TABLE WHERE STATEMENT_ID=:1
PARAMETERS USED BY THE OPTIMIZER
OPTIMIZER_FEATURES_ENABLE = 9.2.0
OPTIMIZER_MODE/GOAL = Choose
OPTIMIZERPERCENT_PARALLEL = 101
HASH_AREA_SIZE = 6144000
HASH_JOIN_ENABLED = TRUE
HASH_MULTIBLOCK_IO_COUNT = 0
SORT_AREA_SIZE = 3072000
OPTIMIZER_SEARCH_LIMIT = 5
PARTITION_VIEW_ENABLED = FALSE
ALWAYSSTAR_TRANSFORMATION = FALSE
BTREE_BITMAP_PLANS = TRUE
STAR_TRANSFORMATION_ENABLED = FALSE
COMPLEXVIEW_MERGING = TRUE
PUSHJOIN_PREDICATE = TRUE
PARALLEL_BROADCAST_ENABLED = TRUE
OPTIMIZER_MAX_PERMUTATIONS = 2000
OPTIMIZER_INDEX_CACHING = 0
SYSTEMINDEX_CACHING = 0
OPTIMIZER_INDEX_COST_ADJ = 100
OPTIMIZER_DYNAMIC_SAMPLING = 1
OPTIMIZERDYN_SMP_BLKS = 32
QUERY_REWRITE_ENABLED = FALSE
QUERY_REWRITE_INTEGRITY = ENFORCED
INDEXJOIN_ENABLED = TRUE
SORTELIMINATION_COST_RATIO = 0
OREXPAND_NVL_PREDICATE = TRUE
NEWINITIAL_JOIN_ORDERS = TRUE
ALWAYS_ANTI_JOIN = CHOOSE
ALWAYS_SEMI_JOIN = CHOOSE
OPTIMIZERMODE_FORCE = TRUE
OPTIMIZERUNDO_CHANGES = FALSE
UNNESTSUBQUERY = TRUE
PUSHJOIN_UNION_VIEW = TRUE
FASTFULL_SCAN_ENABLED = TRUE
OPTIMENHANCE_NNULL_DETECTION = TRUE
ORDEREDNESTED_LOOP = TRUE
NESTEDLOOP_FUDGE = 100
NOOR_EXPANSION = FALSE
QUERYCOST_REWRITE = TRUE
QUERY_REWRITE_EXPRESSION = TRUE
IMPROVEDROW_LENGTH_ENABLED = TRUE
USENOSEGMENT_INDEXES = FALSE
ENABLETYPE_DEP_SELECTIVITY = TRUE
IMPROVEDOUTERJOIN_CARD = TRUE
OPTIMIZERADJUST_FOR_NULLS = TRUE
OPTIMIZERCHOOSE_PERMUTATION = 0
USECOLUMN_STATS_FOR_FUNCTION = TRUE
SUBQUERYPRUNING_ENABLED = TRUE
SUBQUERYPRUNING_REDUCTION_FACTOR = 50
SUBQUERYPRUNING_COST_FACTOR = 20
LIKEWITH_BIND_AS_EQUALITY = FALSE
TABLESCAN_COST_PLUS_ONE = TRUE
SORTMERGEINEQUALITY_JOIN_OFF = FALSE
DEFAULTNON_EQUALITY_SEL_CHECK = TRUE
ONESIDECOLSTAT_FOR_EQUIJOINS = TRUE
OPTIMIZERCOST_MODEL = CHOOSE
GSETSALWAYS_USE_TEMPTABLES = FALSE
DB_FILE_MULTIBLOCK_READ_COUNT = 32
NEWSORT_COST_ESTIMATE = TRUE
GSANTI_SEMI_JOIN_ALLOWED = TRUE
CPUTO_IO = 0
PREDMOVE_AROUND = TRUE
BASE STATISTICAL INFORMATION
Table stats Table: MHDISL Alias: MHDISL
TOTAL :: CDN: 1592807 NBLKS: 27904 AVG_ROW_LEN: 119
-- Index stats
INDEX NAME: MHDISL00 COL#: 1 2 3 4 5
TOTAL :: LVLS: 2 #LB: 8769 #DK: 1599266 LB/K: 1 DB/K: 1 CLUF: 356837
INDEX NAME: MHDISL10 COL#: 1 3 4 5 2
TOTAL :: LVLS: 2 #LB: 9036 #DK: 1608279 LB/K: 1 DB/K: 1 CLUF: 424881
INDEX NAME: MHDISL30 COL#: 1 2 3 4 16 5
TOTAL :: LVLS: 2 #LB: 9493 #DK: 1599279 LB/K: 1 DB/K: 1 CLUF: 356844
INDEX NAME: MHDISL40 COL#: 1 2 9 10 11 3 4 5
TOTAL :: LVLS: 2 #LB: 11082 #DK: 1599282 LB/K: 1 DB/K: 1 CLUF: 388975
OPTIMIZERPERCENT_PARALLEL = 0
SINGLE TABLE ACCESS PATH
Column: URCONO Col#: 1 Table: MHDISL Alias: MHDISL
NDV: 2 NULLS: 0 DENS: 5.0000e-01 LO: 100 HI: 999
NO HISTOGRAM: #BKT: 1 #VAL: 2
Column: URDLIX Col#: 2 Table: MHDISL Alias: MHDISL
NDV: 295495 NULLS: 0 DENS: 3.3842e-06 LO: 1000000001 HI: 930000
1938
NO HISTOGRAM: #BKT: 1 #VAL: 2
TABLE: MHDISL ORIG CDN: 1592807 ROUNDED CDN: 3 CMPTD CDN: 3
Access path: tsc Resc: 1702 Resp: 1702
Skip scan: ss-sel 0 andv 292691
ss cost 292691
index io scan cost 1
Access path: index (scan)
Index: MHDISL00
TABLE: MHDISL
RSC_CPU: 0 RSC_IO: 4
IX_SEL: 1.6921e-06 TB_SEL: 1.6921e-06
Skip scan: ss-sel 0 andv 292691
ss cost 292691
index io scan cost 4518
Access path: index (scan)
Index: MHDISL10
TABLE: MHDISL
RSC_CPU: 0 RSC_IO: 4521
IX_SEL: 5.0000e-01 TB_SEL: 1.6921e-06
Skip scan: ss-sel 0 andv 292691
ss cost 292691
index io scan cost 1
Access path: index (scan)
Index: MHDISL30
TABLE: MHDISL
RSC_CPU: 0 RSC_IO: 4
IX_SEL: 1.6921e-06 TB_SEL: 1.6921e-06
Skip scan: ss-sel 0 andv 292691
ss cost 292691
index io scan cost 1
Access path: index (scan)
Index: MHDISL40
TABLE: MHDISL
RSC_CPU: 0 RSC_IO: 4
IX_SEL: 1.6921e-06 TB_SEL: 1.6921e-06
BEST_CST: 4.00 PATH: 4 Degree: 1
OPTIMIZER STATISTICS AND COMPUTATIONS
GENERAL PLANS
Join order[1]: MHDISL[MHDISL]#0
Best so far: TABLE#: 0 CST: 4 CDN: 3 BYTES: 357
****** Recost for ORDER BY (using index) ************
SINGLE TABLE ACCESS PATH
TABLE: MHDISL ORIG CDN: 1592807 ROUNDED CDN: 3 CMPTD CDN: 3
Access path: tsc Resc: 1702 Resp: 1702
Skip scan: ss-sel 0 andv 292691
ss cost 292691
index io scan cost 4518
Access path: index (scan)
Index: MHDISL10
index io scan cost 4518
Access path: index (scan)
Index: MHDISL10
TABLE: MHDISL
RSC_CPU: 0 RSC_IO: 4521
IX_SEL: 5.0000e-01 TB_SEL: 1.6921e-06
Skip scan: ss-sel 0 andv 292691
ss cost 292691
index io scan cost 1
Access path: index (scan)
Index: MHDISL30
TABLE: MHDISL
RSC_CPU: 0 RSC_IO: 4
IX_SEL: 1.6921e-06 TB_SEL: 1.6921e-06
Skip scan: ss-sel 0 andv 292691
ss cost 292691
index io scan cost 1
Access path: index (scan)
Index: MHDISL40
TABLE: MHDISL
RSC_CPU: 0 RSC_IO: 4
IX_SEL: 1.6921e-06 TB_SEL: 1.6921e-06
BEST_CST: 4.00 PATH: 4 Degree: 1
OPTIMIZER STATISTICS AND COMPUTATIONS
GENERAL PLANS
Join order[1]: MHDISL[MHDISL]#0
Best so far: TABLE#: 0 CST: 4 CDN: 3 BYTES: 357
****** Recost for ORDER BY (using index) ************
SINGLE TABLE ACCESS PATH
TABLE: MHDISL ORIG CDN: 1592807 ROUNDED CDN: 3 CMPTD CDN: 3
Access path: tsc Resc: 1702 Resp: 1702
Skip scan: ss-sel 0 andv 292691
ss cost 292691
index io scan cost 4518
Access path: index (scan)
Index: MHDISL10
TABLE: MHDISL
RSC_CPU: 0 RSC_IO: 4521
IX_SEL: 5.0000e-01 TB_SEL: 1.6921e-06
BEST_CST: 4521.00 PATH: 4 Degree: 1
Join order[1]: MHDISL[MHDISL]#0
SORT resource Sort statistics
Sort width: 7 Area size: 131072 Max Area size: 5242880
Degree: 1
Blocks to Sort: 1 Row size: 141 Rows: 3
Initial runs: 1 Merge passes: 1 IO Cost / pass: 2
Total IO sort cost: 2
Total CPU sort cost: 0
Total Temp space used: 0
Final - All Rows Plan:
JOIN ORDER: 1
CST: 4 CDN: 3 RSC: 4 RSP: 4 BYTES: 357
IO-RSC: 4 IO-RSP: 4 CPU-RSC: 0 CPU-RSP: 0
QUERY
EXPLAIN PLAN SET STATEMENT_ID='PLUS114150' FOR SELECT * FROM MVXJDTA.MHDISL WHE
RE URCONO= 100
AND URDLIX=1000000001 -
How to acheive Pagination and Dynamic sorting in Web layout.
Hi All,
I'm new to Oracle Reports. I use Report Builder 10.1.2.0.2.
I tried creating a template for simple tabular report. I modified the tempalte for Paper layout, Web layout ie modified .tdf, html, css files.
When the data is dispalyed in the web browser, i need to do Pagination and dynamic sorting (ie when the column heading is clicked, it needs to do sorting by that column).
In the jsp page of the report, it is possible but i want to incorporate this functionality in the Template. So that a single template can be used across multiple reprots with out any modification.
Can any one please tell me how to do this.
Please reply me at the earliest. Its very urgent.
Thanks & Regards,
P. Gayathri DeviIgor,
You'll need to switch from using Partial Page Rendering to full page submits on that report. In version 4.0 we should be getting more control over event handling in PPRs but to what extent is still unknown.
Regards,
Dan
http://danielmcghan.us
http://sourceforge.net/projects/tapigen
http://sourceforge.net/projects/plrecur -
JSF Custom component for table pagination and sorting
hi
i want such a custom component that render a table and table has the features of pagination and column sorting.
any one know from where i can get such a custom component.
(if this component is available with source then it would be more help full for me)
thnks & regards,
Haroon
Message was edited by:
HaroonAnwarPADHYARI know two companies that offer JSF component for table pagination and sorting and AJAX based :
http://www.teamdev.com/quipukit/demo/datatable/DataTable_filteringAndPaging.jsf
http://java.samples.infragistics.com/NetAdvantage/JSF/2006.1/
The problem? They are not open source..
And I am too looking forward on this subject, because I want to develop my own custom component and add some features. If someone has any tips, references or samples of their own, it would be really appreciated.
Thank you.
Paul -
What are the advantages of using CACHE and NOCACHE Hint
What are the advantages of using CACHE and NOCACHE Hint & difference of them.I saw one of oracle.sql script have CACHE & oracle rac script include NOCACHE .Why is that
924250 wrote:
In a SOA product include db scripts,when we install the product we want to execute the db script to create sequence both oracle RAC & Oracle db
Oracle DB
CREATE SEQUENCE REG_LOG_SEQUENCE START WITH 1 INCREMENT BY 1 NOCACHE
Oracle RAC DB
CREATE SEQUENCE REG_LOG_SEQUENCE START WITH 1 INCREMENT BY 1 CACHE 20 ORDERas sb mentioned, this has nothing to do with oracle hints.
you'll want to search the documentation about sequences. -
Sass scss code coloring and code hinting
Cannot get Dreamweaver to treat .scss files as style sheets with CSS code coloring and code hinting?
Have tried editing the MMDocumentTypes.xml file located in the /Applications/Adobe Dreamweaver CS5.5/Configuration/DocumentTypes folder, as recommended by other users having this issue. Still no code coloring or code hinting. I suspect there may be multiple MMDocumentTypes.xml files and I need to find the correct one?
O.S.: OSX Mavericks
Dreamweaver: CS5.5kms5038 wrote:
> I no longer have code coloring or code hints working on
Dreamweaver. I checked
> the preferences and everything is still set the same but
whenever I open an
> existing document it will not give me the code coloring
or code hints. I still
> get it when I open a new doc but nothing else. Any ideas
on how to fix this?
It sounds like DW does not recognize the file type of your
page. What is
the file extension?
Randy -
Hi,
Could someone give me a precise definition of what aligment hints and size hints are please?
Also, provide some online resources on this. (Sun Java tutorial does not provide enough info.)
Thanks in advance!
EricSun Java tutorial does not provide enough infoThats the best resource I've found.
Just dowload the examples and play with them, thats how you learn.
Then you can ask a specific question with specific code when you encounter a problem. -
RH 10 is suddenly flickering between pagination and displaying
I am trying to work on a topic, but RH 10 is "flickering"... the lower right hand corner status (at the very bottom of the PM pane) is flickering between "Pagination" and "Displaying". The font and font size is flickering, and the Paragraph and Character Styles pod list is flickering from "Normal" thru the list and then back to "Normal" in a split second. I cannot work in the topic...This seems to be happening no matter what topics I'm in... as well as if I create a new topic.
I did some PM organization of images and topics... and it was fine until then. I have made all the updates I can find, restarted my system, uninstalled and reinstalled RH and reapplied the updates.
What the heck is going on? HELP!Hi there
I'd be shocked (and very skeptical) if someone were to pop in and say something like: It happened because you had... (insert reason here).
The thing is, there are a multitude of things that could be done to a project to cause this or that kind of a result. So all we can do is really guess at things.
So having said that, here's some food for thought.
When you work with RoboHelp, lots and lots of files are involved that track different aspects of the project. The main project database exists as a "ProjectName.XPJ" file. And another database exists as a "ProjectName.CPD" file. I do believe I've noticed that RoboHelp will sort of "flicker" as it attempts to ensure these two files are in sync. Sometimes we find that the .CPD becomes corrupt and will need to be deleted. When we delete it, as RoboHelp opens the project with the missing CPD, it sees the CPD is missing and sets about baking up a fresh one. And that process can cause the flickering as the database is rebuilt. How long it may take and you would see this would vary depending on the complexity of your project.
Not sure if it helps or not, but perhaps it explains why you are seeing what you are seeing.
Cheers... Rick -
I have forgotten all my passwords and password hints. Is there a way to recover them?
I have forgotten all my passwords and password hints. Is there a way to reset them?
Which exact iBook model is it?
You can choose from this list:
http://www.everymac.com/systems/apple/ibook/index-ibook.html
Which version of the OS is installed? Do you have the Install disc for that version of the OS? -
TopLink 3.6.3 and Oracle hints.
Hi.
I'm wondering if is it possible to alter a TopLink expression build with the ExpressionBuilder API in order to insert an Oracle hint on it (eg: /*+RULE*/) I have done it in some of my "static" sentences as they are pure SQL but I can't find a way to do it in a dynamic query.
Sorry if this is a common issue and it has already been answered but I've searched the forums with no luck.
Thanks in advance.
Ignacio.This pointer (though old) was quite useful. Thanks to Doug.
We have an issue though. We are using Toplink Cursored Stream for retrieving the results from our queries.
query.useCursoredStream();
When we set a hint (query.setHintString("/*+ FIRST_ROWS */");) we see a vast improvement in the query that is fired by Toplink (wherein the hint is included):
CursoredStream cursor = (CursoredStream) serverSession.executeQuery(query, parameters);
And the problem we have is that when we need to retrieve the size of the cursor (size = cursor.size();), it fires a "select count(*) from ...." query where the hint is not applied and the resulting performance is bad.
Can someone suggest what we else we need to do to suggest hints to the "select count(*)" query that Toplink fires for getting cursor stream size. Using a scrollable cursor is not an option since it is not efficient enough for our requirements.
Thanks in advance
Message was edited by:
potu_s -
Expanding text boxes, pagination and expanding to another page
Attached is a link to a simple form which is actually part of a much larger form. It has several nested add and remove instances. I have three fairly simple issues I need to solve.
1. Is it possible to set a text box to allow it to grow in height as information is added that exceeds the size of the text box. This feature is available as a property in Microsoft Access as an example. I know you can allow multiple lines but you can see them all without the expanding feature.
2. This form is design to grow by adding instances. I would like to set up the pagination so it would flow to additional page(s). I think I would just like the line
to continue to flow to the next page without creating a break in the primary instance if that makes sense (the top level of the instances - mode). This level could theoretically by larger than one page so this is probably best route to go. Currently it's not flowing at all to the 2nd page.
3. Somehow I ended up with a 2nd page to the form. How do I delete that but yet have the expanding form automatically create a 2nd, 3rd (etc) page as required.
http://share.planswift.com/download/?file=W0H3U2V5-GOPO-FI9G-1UIG-OTYPHTB46HB
Thanks,
PatrickHi Patrick,
I can't make changes to your form at the moment, but there are a few things you need to bear in mind. If you want items to expand and push objects down, then you will need a Flowed layout.
See this example about making fields dynamic: http://assure.ly/g80MVY.
Also this looks at the difference between Flowed (where you want to get to) and Positioned (where you are now) subforms: http://assure.ly/eSGQMt.
Yes, just select the textfield and go to the LAyout palette. There under height, tick Expand to fit. If you preview this you will see that it expands, BUT will cross over objects beneath it. This is where you need to group objects in a Flowed subform, so that when it expands it will push objects down.
The page needs to be set to Flowed. There are pagination settings available under the Object palette and you can start with Place = Follow previous and then Continue filling parent. You also want to make sure that for the subforms (and textfields) you have set in the Object palette that content is allowed to break over pages.
Check your pagination settings.
Hope that helps,
Niall -
Fast Refresh MVs and HASH_SJ Hint
I am building fast refresh MVs on a 3rd party database to enable faster reporting. This is an interim solution whilst we build a new ETL process using CDC.
The source DB has no PKs, so I'm creating the MV logs with ROWID. When I refresh the MV (exec DBMS_MVIEW.REFRESH('<mview_name>') and trace the session I notice:
1. The query joins back to the base table - I think this is necessary as there are two base tables and the MV change could be instigated from either table independently. Therefore the changes might not be in the log.
2. However in this case shouldn't it be possible to just joij mv_log1 to base_table2 and ignore base_table1?
3. There is a HASH_SJ hint in this join, forcing a full table scan on the 7M row base_table1.
4. I am doing 1 update then refreshing the MV
5. In production this table would have many 10s of single row inserts and updates per minute
This is an excerpt from the tkprof'd trace file (I've hidden some table/column names)
FROM (SELECT MAS$.ROWID RID$
,MAS$.*
FROM <base_table1> MAS$
WHERE ROWID IN (SELECT /*+ HASH_SJ */
CHARTOROWID(MAS$.M_ROW$$) RID$
FROM <mview_log1> MAS$
WHERE MAS$.SNAPTIME$$ > sysdate-1/24 --:1
) AS OF SNAPSHOT (:2) JV$
,<base_table2> AS OF SNAPSHOT (:2) MAS$0
WHERE JV$.<col1>=MAS$0.<col1>
AND JV$.<col2>=MAS$0.<col2>
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 1 13.78 153.32 490874 551013 3 1
Fetch 0 0.00 0.00 0 0 0 0
total 2 13.78 153.32 490874 551013 3 1
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: ALL_ROWS
Parsing user id: 277 (<user>) (recursive depth: 1)
Rows Row Source Operation
1 TABLE ACCESS BY INDEX ROWID <base_table2>(cr=551010 pr=490874 pw=0 time=153321352 us)
3 NESTED LOOPS (cr=551009 pr=490874 pw=0 time=647 us)
1 VIEW (cr=551006 pr=490874 pw=0 time=153321282 us)
1 HASH JOIN RIGHT SEMI (cr=551006 pr=490874 pw=0 time=153321234 us)
2 TABLE ACCESS FULL <base_table1_mv_log> (cr=21 pr=0 pw=0 time=36 us)
7194644 TABLE ACCESS FULL <base_table1>(cr=550985 pr=490874 pw=0 time=158282171 us)
1 INDEX RANGE SCAN <base_table2_index> (cr=3 pr=0 pw=0 time=22 us)(object id 3495055)As you can see there are two rows in the MV log (one update, old and new values), the FTS on the base table ensure that the MV refresh is far from fast
I have tried this with refreshing on demand and commit with similar results. Implementing this would make my the application impossibly slow.
I will search the knowledge base once I am given access
SQL>select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for 64-bit Windows: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - ProductionThank you for taking the time to read/respond.
BenThanks for looking.
From the Knowledge Base it appears that Bug 6456841 might be the cause. I'll play around with the settings it suggests and see what happens.
the MV query is basically:
SELECT ...
FROM base_table1
,base_table2
WHERE base_table1.col1 = base_table2.col1
AND base_table1.col2 = base_table2.col2When 1 row in base_table1 is updated there is a FTS for that table, rather than:
1. getting the data from the MV log or
2. a Nested loop join to base_table1 from its mv_log on rowid
This is due to the oracle internal code putting a HASH_SJ hint in when joining the mv log to its base table
Ben -
I no longer have code coloring or code hints working on
Dreamweaver. I checked the preferences and everything is still set
the same but whenever I open an existing document it will not give
me the code coloring or code hints. I still get it when I open a
new doc but nothing else. Any ideas on how to fix this?kms5038 wrote:
> I no longer have code coloring or code hints working on
Dreamweaver. I checked
> the preferences and everything is still set the same but
whenever I open an
> existing document it will not give me the code coloring
or code hints. I still
> get it when I open a new doc but nothing else. Any ideas
on how to fix this?
It sounds like DW does not recognize the file type of your
page. What is
the file extension?
Randy -
Subquery Factoring and Materialized Hint
WITH t AS
(SELECT MAX (lDATE) tidate
FROM rate_Master
WHERE Code = 'G'
AND orno > 0
AND TYPE = 'L'
AND lDATE <= ':entereddate')
SELECT DECODE (:p1, 'B', RateB, 'S', RateS, Rate)
FROM rate_Master, t
WHERE Code = 'G'
AND orno > 0
AND TYPE = 'L'
AND NVL (lDATE, SYSDATE) = tidate;In the given example the sub query returns just one row because of the aggregate function max. Making this in to a With clause will be of any benefit ? Also i presume/understand that the subquery factoring would be really useful only when we try to make a sub query which returns more rows in a with clause. Is my intrepration right?
Secondly adding the /*+ Materialize */ hint to a With query is mandatory or the optimizer by itself will do it and make a temp table transformation. In my example i am forced to give the hint in the query. Please discuss and help
Thanks in advance.ramarun wrote:
WITH t AS
(SELECT MAX (lDATE) tidate
FROM rate_Master
WHERE Code = 'G'
AND orno > 0
AND TYPE = 'L'
AND lDATE <= ':entereddate')
SELECT DECODE (:p1, 'B', RateB, 'S', RateS, Rate)
FROM rate_Master, t
WHERE Code = 'G'
AND orno > 0
AND TYPE = 'L'
AND NVL (lDATE, SYSDATE) = tidate;In the given example the sub query returns just one row because of the aggregate function max. Making this in to a With clause will be of any benefit ? Also i presume/understand that the subquery factoring would be really useful only when we try to make a sub query which returns more rows in a with clause. Is my intrepration right?I am not aware of any performance Benefit due to use of With clause. IMO, It eases the job to write a Subquery multiple times in a query.
The solution you adopted has to hit the cache twice and hence do not look very performant. I will advise you to opt for Analytic functions (like the suggestion I provided in another thread). If the solution does not yeild correct results, then provide with a Script that we can replicate (Create table, Sample Insert statement and the expected output).
select decode(:p1, 'B', RateB, 'S', RateS, Rate)
from (
select RateB, RateS, Rate, NVL(ldate, sysdate) ldate, dense_rank() over (order by case when NVL(lDATE, SYSDATE) <= ':entereddate' then NVL(lDATE, SYSDATE) else to_date('01/01/1970', 'DD/MM/YYYY' end DESC) rn
from rate_Master
where Code = 'G'
and orno > 0
and type = 'L'
) a
where a.rn = 1;>
Secondly adding the /*+ Materialize */ hint to a With query is mandatory or the optimizer by itself will do it and make a temp table transformation. In my example i am forced to give the hint in the query. Please discuss and help
Usage of Hints is only for Debugging purposes and is not meant to be used in production code. It is when you have to ascertain the reason for CBO choosing a plan that you do not expect it to take, you use hints to force your plan and find the cost and analyze it. Hence, I do not support the idea of Hints for production code. -
Query Performance Issue (First_rows hint)
Dear friends, I am running a query on default optimizer mode (all_rows) but its not picking the right execution plan nor the right index but if changing optimizer mode into first_rows, its running insteadly. Tables statistics for concern tables are upto date. Same query was running fine some days back.
Any idea about this behavior ?
My culprit query as follow:
SELECT *
FROM (SELECT *
FROM (SELECT /*+ parallel(h,10) */
MSISDN,
IMSI,
SUBSCRIBER_TYPE,
CASE
WHEN INSTR(IN_SERVICE_NAMES, 'MTCIN') = 0 THEN
WHEN INSTR(IN_SERVICE_NAMES, 'MTCIN') <> 0 THEN
SUBSTR(IN_SERVICE_NAMES,
INSTR(IN_SERVICE_NAMES, 'MTCIN') + 5,
2)
END MTC
FROM RDMBKPIPRDAPP.HLS_OUT H
WHERE LOAD_PROC_ID = '20112501'
AND LOADING_COUNT = '1'
AND SUBSCRIBER_TYPE = 'Prepaid')) A
INNER JOIN (SELECT /*+ fu parallel(i,10) */
MSISDN, IN_ID, LTRIM(IN_ID, '0') IN_INID
FROM RDMBKPIPRDAPP.IN_OUT I
WHERE LOAD_PROC_ID = '20112501'
) B ON A.MSISDN = B.MSISDN
WHERE A.MOC <> B.IN_ID
Regards
Irfan AhmadIrfan_Ahmad wrote:
Dear friends, I am running a query on default optimizer mode (all_rows) but its not picking the right execution plan nor the right index but if changing optimizer mode into first_rows, its running insteadly. Tables statistics for concern tables are upto date. Same query was running fine some days back.
Any idea about this behavior ?
What is the "right" plan, what is the "wrong" plan, and what method do you use to convince yourself that the "right" plan IS the right plan ?
Please use the 'code' tags when reporting the execution plans so that they are easily readable. (See comments at end of note).
Regards
Jonathan Lewis
http://jonathanlewis.wordpress.com
http://www.jlcomp.demon.co.uk
To post code, statspack/AWR report, execution plans or trace files, start and end the section with the tag {noformat}{noformat} (lowercase, curly brackets, no spaces) so that the text appears in fixed format.
There is a +"Preview"+ tab at the top of the text entry panel. Use this to check what your message will look like before you post the message. If it looks a complete mess you're unlikely to get a response. (Click on the +"Plain text"+ tab if you want to edit the text to tidy it up.)
Maybe you are looking for
-
Only some of my installed loops are appearing in the loop browser
I'm fairly new at GB, but I thought I used to have more loops when it was first installed. One of the recent updates may have changed things? For example, I can now only see four Acoustic Pickings: 04/05/19/21. This is with no filters applied in the
-
Fast/most efficient way to cut out of multiple tracks at the same time
I try to select by dragging around but it lights up the entire length of each tract- I can use the scissors to manually cut the tracks but there has to be a better way...any ideas? Thanks, Don
-
SQL*Plus: Release 10.2.0.1.0 - Production on Sat Jan 19 20:21:21 2008 Copyright (c) 1982, 2005, Oracle. All rights reserved. SQL> SQL> Connected. SQL> SQL> alter database open resetlogs ERROR at line 1: ORA-01190: control file or data file 1 is from
-
How do I deal with Tokenized strings that are blank?
I'm writing a little application that writes data to a file. It sends data to the file as a "|" delineated string. Then I use tokenizer to break up the string as follows: try { String searchtext = SearchTxt.getText();
-
Uploading Bank Statement onto SAP (MT940 giving problems, there better way?
Hi All, We have received Bank Statements (MT940) which we tried to upload via FF.5. There seems to be some compatability issues as we always seem to have missing entries (External Transaction codes: 130,600,688,878,990). Firstly, I would like to know