Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limiting records returned by a query does not work #91

Open
devIonutApostol opened this issue Nov 2, 2023 · 3 comments
Open

Limiting records returned by a query does not work #91

devIonutApostol opened this issue Nov 2, 2023 · 3 comments

Comments

@devIonutApostol
Copy link

devIonutApostol commented Nov 2, 2023

We are trying to limit the records returned by a query using statement max records or policy short query but it does not work. In the example bellow we expect ~10 records, but for some cases we get 100k. At this point we are using C# client version 5.3.2 but upgrading to 5.4.x or even 6.x does not change this behavior.

        var queryPolicy = new QueryPolicy
        {
            shortQuery = true,
            totalTimeout = 10000,
            readModeSC = ReadModeSC.ALLOW_REPLICA,
            includeBinData = false,
            maxRetries = 0,
        };
        
        var stmt = new Statement();
        stmt.SetNamespace("namespace");
        stmt.SetSetName("setname");
        stmt.MaxRecords = 10;
        stmt.SetFilter(Filter.Equal("binname", "binvalue"));

        
        var result = client.Query(queryPolicy, stmt);
        
        int count = 0;
        while (result.Next())
        {
            count++;
        }
        
        Console.WriteLine(count);`
@shannonklaus
Copy link
Collaborator

Can you tell me what server version you were using? I ran a test using server EE 7.0.0 and C# client version 7.0.1 and I am unable to replicate the issue you are seeing.

@devIonutApostol
Copy link
Author

@shannonklaus we are using EE 5.7

@shannonklaus
Copy link
Collaborator

MaxRecords is supported by the server starting in EE 6.0.0. I tested with EE 6.0.0 and C# client 5.3.2 and MaxRecords is working for me, so I recommend upgrading to at least EE 6.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants