Skip to content

Conversation

@franzns
Copy link
Collaborator

@franzns franzns commented Sep 23, 2025

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Sep 23, 2025

⚠️ No Changeset found

Latest commit: eca4870

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Comment on lines +267 to +276
const [dbPools, poolTokens] = await Promise.all([
(await prisma.prismaPool.findMany({
where: { chain, protocolVersion: 3, id: { in: changedIds } },
select: { id: true, type: true, hook: true, typeData: true },
})) as PoolWithMappedJsonFields[],
await prisma.prismaPoolToken.findMany({
where: { chain, poolId: { in: changedIds } },
include: { token: true },
}),
]);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can it be one query? just fetch pool tokens together with the pool using include?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought you benchmarked this to be more efficient?

Copy link
Collaborator Author

@franzns franzns Sep 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and actually the way it is built right now with the PoolWithMappedJsonFields[] doenst easily allow for a single query

Copy link
Collaborator Author

@franzns franzns Sep 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do a second pass over the whole sync at a later time

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

Successfully merging this pull request may close these issues.

3 participants