[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference orarep::nomahs::rdb_60

Title:Oracle Rdb - Still a strategic database for DEC on Alpha AXP!
Notice:RDB_60 is archived, please use RDB_70..
Moderator:NOVA::SMITHISON
Created:Fri Mar 18 1994
Last Modified:Fri May 30 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:5118
Total number of notes:28246

5061.0. "How to estimate SORTWORK file sizes ?" by NOMAHS::SECRIST (Rdb WWS; [email protected]) Fri Feb 21 1997 15:07

    
    	Customer wants to know how to estimate the amount of
    	SORTWORK space required on disk to build a sorted
    	index with duplicates on a ~7-8 million row table
    	(that will grow to 10 million).  Any ideas ?
    
    	Currently CREATE INDEX dies with %SORT-E-WRITEERR and
        -SYSTEM-W-DEVICEFULL, device full... and he knows he
    	needs more disk, but being an older, resource-constrained
    	VAX he has to make a specific justification to management
    	and wants to make sure he covers his present and future
    	needs.  He is at Rdb V4.2 but wants to upgrade when he
    	can.
    
    	Are there logicals other than RDMS$BIND_SORT_WORKFILES
    	and RDMS$BIND_WORK_VM that should be used to minimize
    	sorting overhead (especially on disk) ?  Is there a
    	way to determine exactly how many SORTWORK files it
    	will use (I know it defaults to 2 and you can set it
    	to 10, but it doesn't mean it will USE 10, right ?)
    
    	I know the VMS sort used to have a simple algorithm to
    	calculate the amount of virtual memory that would be
    	consumed by a sort, which would have a bearing on this,
    	but I'll be darned if I can find it at the moment.
    
    	Regards,
    	rcs
    
T.RTitleUserPersonal
Name
DateLines
5061.1NOVA::SMITHIDon't understate or underestimate Rdb!Fri Feb 21 1997 16:3132
~Customer wants to know how to estimate the amount of SORTWORK space required
~on disk to build a sorted index with duplicates on a ~7-8 million row table
~(that will grow to 10 million).  Any ideas ?

The Rdb7b documentation contains a description of the "R" debug flag, you
might like to get the Tech Article on which the docs are based.  It will help
some in the estimation.
    
~    	Are there logicals other than RDMS$BIND_SORT_WORKFILES
~    	and RDMS$BIND_WORK_VM that should be used to minimize
~    	sorting overhead (especially on disk) ?

The logical RDMS$BIND_SORT_WORKFILES will only increase the sorting overhead,
it will use more work files...

The logical RDMS$BIND_WORK_VM is not used for sorting.

~Is there a way to determine exactly how many SORTWORK files it will use (I
~know it defaults to 2 and you can set it to 10, but it doesn't mean it will
~USE 10, right ?)
    
Yes it will use all the files you ask for, it may not utilize them all evenly
because of the ordering and nature of the data.

~I know the VMS sort used to have a simple algorithm to calculate the amount of
~virtual memory that would be consumed by a sort, which would have a bearing on
~this, but I'll be darned if I can find it at the moment.

Well did you try the SORT/MERGE manual?  Or maybe the SOR$ utility call
interface?

Ian
5061.2Is SORTWORK usage linear ?NOMAHS::SECRISTRdb WWS; [email protected]Tue Feb 25 1997 15:0324
    
    	If I build an index with 10 million rows and it uses SORTWORK
    	files, would the same index built on only 1/10th the rows use
    	~1/10th as much SORTWORK disk space ?  1/25th ?  Is the
    	growth of SORTWORK space linear with respect to a growth in
    	rows ?  Can I build an index using 1/25th of the rows and
    	multiply by 25 to find out how much SORTWORK space the "full"
    	index would take ?
    
    	If growth is linear the debug flag "R" etc. might be very
    	interesting.
    
    	Note that the SORT/MERGE manual has been merged into the
    	VMS User's Manual and no longer exists.  The SOR$ documentation
    	is also not of much help.  Ironically the memory-usage information
    	could be found in the Rdb Guide to Performance and Tuning,
    	Volume 1 (p. 4-214 in the V7.0 manuals):  "The Sort Utility (SORT)... 
    	uses the difference between these two parameters [WSEXTENT and 
    	WSQUOTA] to allocate VM for scratch space." e.g. 
    	WSEXTENT - WSQUOTA = <allocated VM>.
    
    	Regards,
    	rcs
    
5061.3calculationukvms3.uk.oracle.com::SHISCOCKstand and deliverMon Mar 03 1997 03:529
    
    Having just delivered the rdb/c course (v6.0) it does give a
    general calculation for sizing sortwork files for an index
    creation :
    
    vms blocks <= 1.4 * key size (bytes) x table cardinality / 512
    
    cheers,
    Steve
5061.4Using the formulaNOMAHS::SECRISTRdb WWS; [email protected]Wed Mar 05 1997 14:5916
    
    Thank you very much, Steve !  Am I correct in assuming that the
    formula is executed as:
    
    vms blocks <= (1.4 * key size (bytes) ) x (table cardinality / 512)
    
    and NOT (1.4 * key size (bytes) x table cardinality) / 512 ?
    
    Were any other useful estimates in the same section ?  Exactly
    which course was that ?  It'd be nice to see that information
    in the Rdb documentation !
    
    I appreciate your help -- thanks !
    
    rcs
    
5061.5When I learned maths ...svrav1.au.oracle.com::MBRADLEYI was dropped on my head as a baby. What&#039;s your excuse?Wed Mar 05 1997 19:0911
Richard,

>    vms blocks <= (1.4 * key size (bytes) ) x (table cardinality / 512)
>    
>    and NOT (1.4 * key size (bytes) x table cardinality) / 512 ?

Are these not equivalent?

G'day,

Mark.
5061.6Duh...NOMAHS::SECRISTRdb WWS; [email protected]Thu Mar 06 1997 02:167
    
    		; Are these not equivalent?
    
    	Gee, they are (blush) !  Maybe *I* was dropped on *my* head...
    
    	Thanks,
    	rcs
5061.7svrav1.au.oracle.com::MBRADLEYI was dropped on my head as a baby. What&#039;s your excuse?Thu Mar 06 1997 17:289
Richard,

>    	Gee, they are (blush) !  Maybe *I* was dropped on *my* head...

Coffee too strong? :-)

G'day,

Mark.