Comments (2)
@vishalkakadiya I think your solution should work fine. It taps into the same idea that is, always look for something that exists, instead of for something that doesn't. I suggest adding different values for a meta key, but having different meta-keys will most likely work just fine too.
I don't think indexing the meta_value column makes a lot of difference in this case, because the first thing the query will do is join the tables to contain only that meta_key. But then again, if we step into the millions of records within the join, then that might be a good replacement.
from engineering-best-practices.
@moraleida Hi 👋, you guys are doing awesome work with Engineering Practices! 🙌 Thank you for making these awesome docs.
I was recently checking this issue and would like to share my thoughts, not sure if this is a good idea for bigger picture but let me share:
NOT EXISTS
check: if the user makes a meta_key with appending_1
after the actual meta_key then it will be straight forward query to just checkmeta_key
=_publicize_pending_1
, so the end query will be as below:
$query = new \WP_Query(
array(
'suppress_filters' => true,
'meta_key' => '_publicize_pending_1',
)
);
The above query will fetch all the posts which are pending for publicizing, and I guess will be somewhat faster than checking with the value. As we all know, in the normal WP environment index is available on meta_key
only, not on the meta_value
, however the WordPress VIP platform indexing meta_value
in the combination of meta_key but in some limit of characters. So I guess we can think of this way as well for this issue, still correct me if I have interrupted in wrong discussions.
Thanks! 🙂
from engineering-best-practices.
Related Issues (20)
- Outdated Information in PHP HOT 1
- Confusion in the links on the Contributing Guidelines HOT 2
- Readme updates
- Codex References in PHP Section HOT 2
- Skip Links Example 404's
- Rename Master-Slave in Systems.md
- [JavaScript] Best practices for choosing third-party libraries and keep bundle size small.
- GitHub Security tab overtaken by our security.md file HOT 3
- Main nav on Best Practices is not displaying correctly. HOT 1
- Add Web Vitals Best Practices HOT 9
- [JavaScript] Avoid using aliases (such as webpack alias) in favor of relative imports HOT 2
- Visual Bugs on Submenus HOT 1
- Update reference to old Project/Theme/Plugin Scaffold with the new WP Scaffold
- Code review guidelines and best practices.
- Misspelling on Performace best practices
- Add recommended/endorsed plugins for addressing site security recommendations
- Fix typos and update non-evergreen content
- Fix PHP 7 recommendation in migration section
- Typos on Markup page
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from engineering-best-practices.