Hi Ahmed, It does not, it only reads enough rows to satisfy the clients request. Although, that may be a bit of an oversimplification as it has to scan through sstable files, read indices, pass over tombstones and so on, but it will stop reading new rows once it has read the number of rows the driver has requested. If you have a really wide partition or a lot of tombstones in the partition, you may find your query performance being slow in general when reading rows from that partition.
Thanks, Andy On Wed, Apr 25, 2018 at 3:08 AM, Ahmed Eljami <ahmed.elj...@gmail.com> wrote: > Hi Andy, > > Thanks. > > When the driver requests X rows, C* will load the whole partition (All > rows) before reply to driver ? > > Thanls. > > 2018-04-24 18:11 GMT+02:00 Andy Tolbert <andrew.tolb...@datastax.com>: > >> Hi Ahmed, >> >> The java driver docs do a good job explaining how the driver uses paging, >> including providing a sequence diagram that describes the flow of the >> process: https://docs.datastax.com/en/developer/java- >> driver/3.5/manual/paging/ >> >> The driver requests X rows (5000 by default, controlled via >> QueryOptions.setFetchSize >> <https://docs.datastax.com/en/drivers/java/3.5/com/datastax/driver/core/QueryOptions.html#setFetchSize-int->) >> at a time. When C* replies, it returns a 'paging state' id which >> identifies where in the result set (partition and clustering key) to >> continue retrieving the next set of rows. When you continue iterating over >> the result set in the java driver and hit the end of the current page, it >> will send another request to C* using that paging state to get the next set >> of rows. >> >> Thanks, >> Andy >> >> On Tue, Apr 24, 2018 at 9:49 AM, Ahmed Eljami <ahmed.elj...@gmail.com> >> wrote: >> >>> Hello, >>> >>> Can someone explain me how paging is implemented ? >>> >>> according to the doc of datastax, the goal being to avoid loading much >>> results in memory. >>> >>> Does it mean that the whole partition is not upload to heap memory? >>> >>> >>> C* version: 2.1 >>> >>> Java Driver version: 3.0 >>> >>> Best regards >>> >>> >> > > > -- > Cordialement; > > Ahmed ELJAMI >