• Welcome, Guest. Please login.
 
October 18, 2021, 11:12:50 PM

News:

Welcome to the SQLitening support forums!


Following up on Tutorial: Server Trips and RDC

Started by John Montenigro, November 29, 2009, 10:40:57 AM

Previous topic - Next topic

John Montenigro

I have just downloaded SQLitening, and I'm trying to read and absorb everything.

I read the tutorial about Server Trips and I'm wondering if I've understood correctly.

'Based on info at: http://www.sqlitening.com/support/index.php?topic=3128.0

%FirstRDC_Size  = 250000
%RDC_Size       = 500000


FUNCTION ServerTrips (ColumnsSelected) as LONG

   LOCAL lSumOfTheWidthsOfColumnsSelected, lHeader_Size, lNumberOfRows as LONG

   lHeader_Size    = ...
   lNumberOfRows   = ...

   lSumOfTheWidthsOfColumnsSelected = CalculateRowWidth(ColumnsSelected)

   IF lSumOfTheWidthsOfColumnsSelected < %FirstRDC_Size THEN
      FUNCTION = 1
   ELSE
      FUNCTION = (lHeader_Size + (lSumOfTheWidthsOfColumnsSelected * lNumberOfRows)) / %RDC_Size
   END IF

END FUNCTION

FUNCTION CalculateRowWidth(ColumnsSelected) as LONG
...

END FUNCTION


Would the above code correctly represent the basic idea of what was being described?
Thanks,
-John

Matt Humphreys

Perhaps given that there is always going to be one trip to the server and that a fractional trip cannot occur...

LOCAL lTotalDataSize as long

lTotalDataSize = (lHeader_Size + (lSumOfTheWidthsOfColumnsSelected * lNumberOfRows))

IF lTotalDataSize  > %FirstRDC_Size then
   FUNCTION = 1 + CEIL((lTotalDataSize  - %FirstRDC_Size ) / %RDC_Size)
ELSE
   FUNCTION = 1
END IF

Fred Meier

John, yes you understand it but the Ceil function is required as in Matt's example.

Keep in mind that the MaxChunkSize is changeable in the SQLiteningServer.Cfg file.

John Montenigro

OK, got it! Thanks for the confirmation.

Now to experiment some more...

-John