I have the following query, the total number of ro...
# orm-help
k
I have the following query, the total number of rows that are returned is 10,068. The query will not work as is and it will hang. However if i set "take: 10068". It works and returns under 1 second. Whats going on?
Copy code
const options: Prisma.brandFindManyArgs = {
            distinct: ["name"],
            select: {
                id: true,
                name: true,
                website: true,
                company_size_li: true,
                image: {
                    select: {
                        id: true,
                        source: true,
                        dtype: true,
                    },
                },
            },
            //take: 10068,
        };
Copy code
SELECT DISTINCT b.name, b.id, b.website, b.company_size_li, i.id, i.source, i.dtype
FROM brand b
JOIN image i ON i.id = b.image_id
Copy code
SELECT count(DISTINCT b.id) // 10068
FROM brand b
JOIN image i ON i.id = b.image_id
1
n
Hey there 👋 this definitely seems fishy! 🤔 Can you maybe create an issue about this with this (ideally with a standalone reproduction) so that our Engineers can look into it? 🙂
k
@nikolasburk i already found the solution
👀 1
n
Ah good to know! What was the issue then?
k
was solved by setting QUERY_BATCH_SIZE=999
apparently when you ahve to many params, it hangs
(?,?,?....)