Also, I’ve noticed that the collections that fail to build up the CSV have way more complex queries than the ones that get all the entries.
In my case the generated query for the failing CSV is
SELECT "parents"."id" AS t0_r0, "parents"."user_id" AS t0_r1, "parents"."created_at" AS t0_r2, "parents"."updated_at" AS t0_r3, "parents"."notes_for_caregiver" AS t0_r4, "parents"."payout_increase" AS t0_r5, "parents"."jobs_count" AS t0_r6, "parents"."shortlists_count" AS t0_r7, "parents"."different_sitters_count" AS t0_r8, "parents"."total_paid_on_subscriptions" AS t0_r9, "users"."id" AS t1_r0, "users"."email" AS t1_r1, "users"."encrypted_password" AS t1_r2, "users"."reset_password_token" AS t1_r3, "users"."reset_password_sent_at" AS t1_r4, "users"."remember_created_at" AS t1_r5, "users"."sign_in_count" AS t1_r6, "users"."current_sign_in_at" AS t1_r7, "users"."last_sign_in_at" AS t1_r8, "users"."current_sign_in_ip" AS t1_r9, "users"."last_sign_in_ip" AS t1_r10, "users"."confirmation_token" AS t1_r11, "users"."confirmed_at" AS t1_r12, "users"."confirmation_sent_at" AS t1_r13, "users"."unconfirmed_email" AS t1_r14, "users"."created_at" AS t1_r15, "users"."updated_at" AS t1_r16, "users"."validation_status" AS t1_r17, "users"."first_name" AS t1_r18, "users"."last_name" AS t1_r19, "users"."middle_name" AS t1_r20, "users"."no_middle_name" AS t1_r21, "users"."tos_accepted" AS t1_r22, "users"."avatar_processing" AS t1_r23, "users"."postal_code" AS t1_r24, "users"."admin" AS t1_r25, "users"."is_active" AS t1_r26, "users"."uuid" AS t1_r27, "users"."authentication_token" AS t1_r28, "users"."activated_on" AS t1_r29, "users"."hear_about_us" AS t1_r30, "users"."enterprise_booker" AS t1_r31, "users"."represented_entity_name" AS t1_r32, "users"."auth_provider" AS t1_r33, "users"."auth_uid" AS t1_r34, "users"."access_token" AS t1_r35, "users"."token_id" AS t1_r36, "users"."tos_acceptance_ip_v2" AS t1_r37, "users"."tos_accepted_v2" AS t1_r38, "customers"."id" AS t2_r0, "customers"."stripe_customer_id" AS t2_r1, "customers"."user_id" AS t2_r2, "customers"."created_at" AS t2_r3, "customers"."updated_at" AS t2_r4 FROM "parents" LEFT OUTER JOIN "users" ON "users"."id" = "parents"."user_id" LEFT OUTER JOIN "users" "users_parents_join" ON "users_parents_join"."id" = "parents"."user_id" LEFT OUTER JOIN "customers" ON "customers"."user_id" = "users_parents_join"."id" WHERE (LOWER("parents"."notes_for_caregiver") LIKE '%%') ORDER BY "parents"."id" ASC LIMIT $1;
If you look closely you should be able to see that in the WHERE condition is checking for the notes_for_caregiver
param.
I Ran this query manually and I’m only getting the entries exported on the csv.
If I remove this WHERE clause then I get all the expected results