CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Database with large JSON column takes long time to load even in view #6739
Replies: 1 comment · 5 replies
-
How many Could you provide a code sample how you are sending the request? Could you provide a sample payload of these big JSON objects or at least their size? I'll try to create a test setup a little bit later today and will investigate it in more details. |
Beta Was this translation helpful? Give feedback.
All reactions
-
My test database was seeded with 100k Test data seed script// node index.js
import Pocketbase from "pocketbase"
const pb = new Pocketbase("https://127.0.0.1:8090")
await pb.collection("_superusers").authWithPassword("test@example.com", "1234567890")
pb.autoCancellation(false)
const usersPromises = [];
for (let i = 0; i < 10; i++) {
usersPromises.push(pb.collection("users").create({
"email": i + "_test@example.com",
"name": i + "_test",
"password": "1234567890",
"passwordConfirm": "1234567890",
}))
}
const users = await Promise.all(usersPromises);
const largeTxt = "a".repeat(1000000);
for (let user of users) {
for (let i = 0; i < 100; i++) {
const replsPromises = []
for (let j = 0; j < 100; j++) {
const prefix = `${i}_${j}_`;
replsPromises.push(pb.collection("repls").create({
user: user.id,
name: prefix + `test`,
files: {
"abc": prefix + largeTxt,
},
}))
}
await Promise.all(replsPromises)
}
} Test requests:
1. No
2. With
As seen above we can directly make 2 observations:
So to summarise:
If this doesn't help, please elaborate more on your use case and the requests you are sending. |
Beta Was this translation helpful? Give feedback.
All reactions
-
Regarding the earlier mentioned issue with the way how we construct the CREATE INDEX `idx_9w4jJvgBb8` ON `repls` (`user`, `id`) (note that the combined index columns order is important) Results locally in ~1.3s response time for both with and without |
Beta Was this translation helpful? Give feedback.
All reactions
-
Mmm i tried to create such index but from the admin ui i can't select |
Beta Was this translation helpful? Give feedback.
All reactions
-
Uh scratch that, just realized i can edit the sql field while creating the idx |
Beta Was this translation helpful? Give feedback.
All reactions
-
Just for info in case someone stumble here: with v0.27.2 |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 1
This discussion was converted from issue #6739 on April 18, 2025 13:53.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I have a decently simple database of which the exported tables looks like this
the
repls.files
column contains very big JSON objects like suggested in #3859 (reply in thread) .The problem arise when i try to filter this
repls
table byuser_id
because the query takes way to long (more than 60 seconds)...as you can see i tried to create a VIEW that excludes the files from therepls
table and in the admin UI it does load very quickly...however as soon as i try to filer byuser_id
here too it takes way too long. I also tried to add anindex
onuser_id
but unexpectedly this make things worse and even loading the table without filtering takes a lot of time.Any suggestion on how to fix this?
Beta Was this translation helpful? Give feedback.
All reactions