impact-graph
impact-graph copied to clipboard
Investigate wrong query #1
This query is taking a long time and it seems it was not well designed since it returns the same project data on each row with only different project addresses.
SELECT
"project"."id" AS "project_id",
"project"."title" AS "project_title",
"project"."slug" AS "project_slug",
"project"."slugHistory" AS "project_slugHistory",
"project"."admin" AS "project_admin",
"project"."description" AS "project_description",
"project"."descriptionSummary" AS "project_descriptionSummary",
"project"."traceCampaignId" AS "project_traceCampaignId",
"project"."givingBlocksId" AS "project_givingBlocksId",
"project"."changeId" AS "project_changeId",
"project"."website" AS "project_website",
"project"."youtube" AS "project_youtube",
"project"."creationDate" AS "project_creationDate",
"project"."updatedAt" AS "project_updatedAt",
"project"."organizationId" AS "project_organizationId",
"project"."coOrdinates" AS "project_coOrdinates",
"project"."image" AS "project_image",
"project"."impactLocation" AS "project_impactLocation",
"project"."balance" AS "project_balance",
"project"."stripeAccountId" AS "project_stripeAccountId",
"project"."walletAddress" AS "project_walletAddress",
"project"."verified" AS "project_verified",
"project"."verificationStatus" AS "project_verificationStatus",
"project"."isImported" AS "project_isImported",
"project"."giveBacks" AS "project_giveBacks",
"project"."qualityScore" AS "project_qualityScore",
"project"."contacts" AS "project_contacts",
"project"."statusId" AS "project_statusId",
"project"."adminUserId" AS "project_adminUserId",
"project"."totalDonations" AS "project_totalDonations",
"project"."totalTraceDonations" AS "project_totalTraceDonations",
"project"."totalReactions" AS "project_totalReactions",
"project"."totalProjectUpdates" AS "project_totalProjectUpdates",
"project"."listed" AS "project_listed",
"project"."reviewStatus" AS "project_reviewStatus",
"addresses"."id" AS "addresses_id",
"addresses"."title" AS "addresses_title",
"addresses"."networkId" AS "addresses_networkId",
"addresses"."chainType" AS "addresses_chainType",
"addresses"."address" AS "addresses_address",
"addresses"."projectId" AS "addresses_projectId",
"addresses"."userId" AS "addresses_userId",
"addresses"."isRecipient" AS "addresses_isRecipient",
"addresses"."updatedAt" AS "addresses_updatedAt",
"addresses"."createdAt" AS "addresses_createdAt",
"categories"."id" AS "categories_id",
"categories"."name" AS "categories_name",
"categories"."value" AS "categories_value",
"categories"."source" AS "categories_source",
"categories"."isActive" AS "categories_isActive",
"categories"."mainCategoryId" AS "categories_mainCategoryId"
FROM
"public"."project" "project"
LEFT JOIN "public"."project_address" "addresses" ON "addresses"."projectId" = "project"."id"
INNER JOIN "public"."project_categories_category" "project_categories" ON "project_categories"."projectId" = "project"."id"
INNER JOIN "public"."category" "categories" ON "categories"."id" = "project_categories"."categoryId"
AND ("categories"."isActive" = true )
WHERE
"project"."slug" = 'pcrf-palestine-childrens-relief-fund'
OR 'pcrf-palestine-childrens-relief-fund' = ANY (PROJECT."slugHistory")
The answer:
May be causing slowness; but Amin is not entirely sure. need to know how much improvement will we get if we take this up.
@RamRamez can you pls take this up
@aminlatifi can you please send me the file name containing this query? I couldn't find it.
@aminlatifi can you please send me the file name containing this query? I couldn't find it.
It must be by high chance the query generated by the TypeOrm for fetch project by slug. It's not written explicitly by us (developers)
@aminlatifi can you please send me the file name containing this query? I couldn't find it.
It must be by high chance the query generated by the TypeOrm for fetch project by slug. It's not written explicitly buy us (developers)
@RamRamez - What is the update on this issue?
@RamRamez - What is the update on this issue?
- [x] Optimizing single project page query
- [x] Optimizing donate project page query
- [x] Optimizing create project success page query
- [x] Optimizing verification form page query
- [x] Adding lazy loading to projectBySlug resolver
@maryjaf to test and verify Please test functionality of these pages:
- project creation success view
- single project view
- donate page
- verification flow
Please test functionality of these pages:
- project creation success view
- single project view
- donate page
- verification flow
-I haven't seen problem in project creation success view, verification flow and donate page
but there is two problems in single project view that I've mentioned on # 823 @RamRamez
https://github.com/Giveth/impact-graph/issues/825#issuecomment-2119841319 https://github.com/Giveth/impact-graph/issues/825#issuecomment-2119886720
@RamRamez are these issues that @maryjaf just reported related to the query changes you've done in this issue?
If they are no related let's move this issue to done?
@divine-comedian I think we can assume this issue as done and track two problems Maryam reported in issue #825
@divine-comedian @maryjaf can we close this?