English 中文(简体)
习俗领域解决办法的可衡量性
原标题:Scalability of Custom Fields solutions

我不想让大量用户使用言语,因此,在我接受作为今后合理活动而加以支持的同时,我也至少需要了解情况,并根据目前的业绩和可衡量性考虑行事。

我担心——我想有些你们的民会对此有看法——是关于习俗海报类型,特别是基督教协进会附属的习俗领域的业绩特征。 在我的具体案例中,我正在考虑对内容和交易数据使用许多CPT。 交易数据——数据结构严密——使用大量CF。 我不想开始正确或错误地认为:

  1. For content related entities and "reference data" … blog entries, topic definitions, articles, companies information, user profile, products, etc. I think that the WP CPT/CF data model is adequate and the SQL performance should be ok even if some queries are a bit long in the tooth.

  2. 就交易数据而言,如果我的情况可能代表每个用户每天5-10次“交易”,而这种数据反过来又会转化为50-100次国家信息服务局,而数据增长将迅速使查询工作不适时/不适当(与专业考试委员会相比,更多涉及专业考试委员会)。 考虑到Im, 用于100万个用户基,尽管我怀疑甚至1 000个用户基也会开始感受到痛苦。

为了说明这一点,请允许我以“霍斯特醇测试”为例。 I m 简化数据要求,只字不提,但请假设你想要捕获Cholesterol、HDL、LDL和Triglycerides。 然后,你希望向用户介绍其测试历史。 请问:

SELECT wp_posts.id, wp_posts.post_date
, MAX(CASE WHEN meta_key =  wpcf-which-day  THEN meta_value END) AS which_day
, MAX(CASE WHEN meta_key =  wpcf-biochem-lipids-total-cholestertol  THEN meta_value END) AS total_cholesterol
, MAX(CASE WHEN meta_key =  wpcf-biochem-lipids-ldl  THEN meta_value END) AS LDL
, MAX(CASE WHEN meta_key =  wpcf-biochem-lipids-hdl  THEN meta_value END) AS HDL
,    MAX(CASE WHEN meta_key =  wpcf-biochem-lipids-triglycerides  THEN meta_value END) AS Tri
FROM wp_posts LEFT JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id )
WHERE   (wp_posts.post_status =  publish  OR wp_posts.post_status =  private )
AND post_type = "measurements"
GROUP BY wp_posts.ID
HAVING MAX(CASE WHEN meta_key =  wpcf-measurement-type  THEN meta_value END) =  4 
ORDER BY MAX(CASE WHEN meta_key =  wpcf-which-day  THEN meta_value END) DESC

对于简单要求、正确的东西来说,先说什么? 不管怎样,请允许我证明,我不是WP,我的SQL,甚至非行专家,因此我不想不公平,而只是想得到一些反馈。 我是公正的吗? 你们是否以不同的方式来看待这个界线? 任何帮助都将受到高度赞赏。

最佳回答

我没有得到社区的答复,因此请允许我迅速回答(我仍然乐于听取其他意见)。

  • Custom Fields are a great addition to Wordpress
  • They provide an easy way to extend the datamodel for most practical needs and one which keeps people abstracted from the datamodel and need for SQL
  • They don t allow for storage of anything but VarChar data in the database for CF data which is not ideal
  • High transactional data sets are probably going to need to go outside of this model at some point

我认为,在业绩和灵活性之间的总体战斗中,CF选择了适当的平衡,但有利于灵活性的平衡,这意味着具有大量数据的应用领域在某些时候可能超出其效用。 我在应该选择这条线的地方没有任何umb子规则。

问题回答

暂无回答




相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

php return a specific row from query

Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...

Character Encodings in PHP and MySQL

Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...

Pagination Strategies for Complex (slow) Datasets

What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...

Averaging a total in mySQL

My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...

热门标签