Also. I see another issue here. The query is getting executed twice
select
c1_0.id,
c1_0.address,
c1_0.city,
c1_0.contact_name,
c1_0.country,
c1_0.created_date,
c1_0.customer_name,
c1_0.last_modified_date,
c1_0.postal_code
from
customer_entity c1_0 offset ? rows fetch first ? rows only
Hibernate:
select
count(c1_0.id)
from
customer_entity c1_0
Hibernate:
select
c1_0.id,
c1_0.address,
c1_0.city,
c1_0.contact_name,
c1_0.country,
c1_0.created_date,
c1_0.customer_name,
c1_0.last_modified_date,
c1_0.postal_code
from
customer_entity c1_0 offset ? rows fetch first ? rows only
Hibernate:
select
count(c1_0.id)
from
customer_entity c1_0
That sounds potentially like this one: Components with data provider issue double fetch request if a filter is set · Issue #4345 · vaadin/flow · GitHub
yes same issue
updated the issue with my issue. Looks it is there for a long time
My observation is, it is happening when there are more than 50 records in the table
That means, everyone using Grid have this issue
The default pagesize is 50
if your UI displays more than 50 rows it will execute the fetch twice
Call
grid.setPageSize(200); // or whatever number of rows you are displaying
Then you will get only one fetch call
If I set the value to 10, it is making 8 calls
Then there are probabyl 80 rows visible
is visiblity depends on the grid size/scrren size ?
yes it fetched 80 rows but I need only 10 at a time
yes
so how this pageSize works ? Looks there is some indirect relationship with row count
when there are 1000 records, and pagesize = 100, how many times the query will execute ? 10 times or 10*2 = 20 times ?
If 100 rows are visible in the grid the there will be one query
if you start scrolling it will reload