What’s the most efficient way to get today’s birthday celebrants from a list of more than 100,000?
Hi there, @shu.teopengco… until I saw that it wasn’t performant, I would probably go the “straightest” route with a search on the relevant data type and a constraint where the birthday is the current date (and then do a count if that’s what you are going for, but your title seems to be a bit different from your actual question). That being said, you could go the backend route and schedule a workflow to run “off hours” every day to get the list of celebrants for that day.
Maybe there is an exact right way to do it from an efficiency perspective, and maybe someone can clue us both in there… but I’m thinking you just have to experiment and see what works best for you because there could be other factors at play that aren’t evident to folks who don’t know exactly what your app does.
Oh, here is one thing I do know for sure, though… don’t get the list by doing an advanced filter on a search… that is likely the least efficient way.
Hope this helps.
Hi there. Can you suggest a constraint in searches to find today’s birthday celebrant given their birthdays? Can’t think of a constraint that can do that in the search function as of the moment.
Well, first, for some context on date comparison’s from someone who knows a heck of a lot more about it than I do, check out this post…
Given that context, I might store the birthdate as both a date and text, and then your search constraint could be something like…
Hope this helps.
I think that will still not work. Considering the following:
User1 Birthday: 02/05/1990
Current Date: 02/05/2021
Using the constraint “Birthday = Current date formatted as 02/05/2021” will not get the User1 birthday because of the difference in the year.
As of the moment, my last resort is using advanced filter “Current Date = Birthday change year to current year”. But this one consumes a lot of performance on the client side when dealing with large amount of birthdays to look for.
Ug, sorry about that… you’re absolutely right, of course… my brain just ain’t workin’ right today.
I can think of another way that doesn’t involve an advanced filter… you could save the birth month and date to separate fields, and then you could use two constraints on the search, one that extracts the month from the current date/time and compares it to the birth month and one that extracts the date from the current date/time and compares it to the birth date.
Again, sorry for wasting your time with that last response (although, the date comparison stuff is definitely worth a read). At the very least, we keep popping this thread to the top of the stack so that maybe someone else might come along and be like, “Why in the hell don’t you just do it like this?!?”
Thanks bro. I’ll check that and maybe I can consider your solution.
I hope, someone jumps in and provide a better and more efficient solution.
For what it’s worth, I found this thread that might be of interest to you…
The “extract” route that I mentioned is brought up in that thread, too, and this particular response is why I suggested saving the month and date to separate fields…
Anyway, that’s enough out of me in this thread for sure.
This topic was automatically closed after 70 days. New replies are no longer allowed.