entity-attribute-value

Query statistic is taking 99% of the query time

给你一囗甜甜゛ 提交于 2019-12-09 20:43:46
问题 I have an SQL query which take about 1.81s seconds to execute. I profiled it in phpMyAdmin and I saw that 99% of the time is spend on 'statistics'. Interestingly if I add one more join, the time goes up to about 23 seconds and if I remove 1 join the time goes down to about 0.26 seconds. I have tried to put the product_id = in the where the the attribute_id = in the join. It does not improve the performance and the 'statistics' still use 99% of the time. I have tried group by p.id which does

Creating user roles

删除回忆录丶 提交于 2019-12-08 19:20:34
I am doing new project in symfony1.4. Now this project requires users to log-in and browse, and as any project of this type requires a way of restricting users based on roles. I don't want to implement this in obvious way, i.e to have roles attribute for each user and have pre-defined roles and assign these to users. The problem with this is it's not very flexible as more roles get defined later. I was thinking on the lines of using an EAV model here, (not sure I can do that in symfony). What you guys think, do you have any better suggestions to make user roles much more flexible when they get

Storing changes on entities: Is MySQL the proper solution?

情到浓时终转凉″ 提交于 2019-12-08 15:33:19
问题 i want to store changes that i do on my "entity" table. This should be like a log. Currently it is implemented with this table in MySQL: CREATE TABLE `entitychange` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `entity_id` int(10) unsigned NOT NULL, `entitytype` enum('STRING_1','STRING_2','SOMEBOOL','SOMEDOUBLE','SOMETIMESTAMP') NOT NULL DEFAULT 'STRING_1', `when` TIMESTAMP NOT NULL, `value` TEXT, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; entity_id = the primary key of my

Database EAV model, record listing as per search

[亡魂溺海] 提交于 2019-12-08 10:49:19
问题 I am building a dynamic application. I have three tables : ( EAV model style) Items ( ItemId, ItemName) Fields (FieldId, FieldName) Field Values ( ItemID, FieldId, Value) Can you tell me how to write SINGLE query to get starting 20 records from ALL items where FieldId=4 is equal to TRUE. Expected Result : Columns => ItemID | Name | Field1 | Field2 | Field3 Each Row=> ItemId | ItemName| Value1 | Value2 | Value3 Important concerns : Number of fields per item are not known I need one to write

Java Frameworks that support Entity-Attribute-Value Models

一世执手 提交于 2019-12-08 07:45:13
问题 I am interested in developing a portal-based application that works with EAV models and would like to know if there are any Java frameworks that aid in this type of development? salesforce.com uses EAV and currently has twenty tables. The framework I seek should allow it to be configurable to different EAV implementations 回答1: Sesame is a more modern RDF API compared to Jena. RDF can be seen as a variant of the EAV model. The framework I seek should allow it to be configurable to different

Creating user roles

三世轮回 提交于 2019-12-08 07:26:45
问题 I am doing new project in symfony1.4. Now this project requires users to log-in and browse, and as any project of this type requires a way of restricting users based on roles. I don't want to implement this in obvious way, i.e to have roles attribute for each user and have pre-defined roles and assign these to users. The problem with this is it's not very flexible as more roles get defined later. I was thinking on the lines of using an EAV model here, (not sure I can do that in symfony). What

MySQL: how to convert to EAV - Part 2?

被刻印的时光 ゝ 提交于 2019-12-08 05:09:57
问题 Here's Part 1: MySQL: how to convert to EAV? Now I want to also do something different. Say I have the following table: TABLE: one ======================================= | id | fk_id | attribute | value | ======================================= | 1 | 10 | first_name | John | | 2 | 10 | last_name | Doe | | 3 | 55 | first_name | Bob | | 4 | 55 | last_name | Smith | --------------------------------------- I want to convert it to this EAV model: TABLE: attribute =================== | id |

Generic DB Table

对着背影说爱祢 提交于 2019-12-08 02:05:29
问题 Is there any name for the following DB table design: Basically we have generic columns representing key/value pair. id | k1 | v1 | k2 | v2 | k3 | v3 | .... 1 | name | sam | last_name| smith | NULL | NULL | ... In my application, I have many tables that have only one row and I would like to merge them into a generic table that has X number of columns with each rows representing singular table rows. Thanks in advance. 回答1: Entity-Attribute-Value. Also called a "Name-Value Table" or an "Open

EAV Select query from spreaded value tables

[亡魂溺海] 提交于 2019-12-07 23:01:30
问题 I have the following SQL Server database structure I have to use to query data. The model could be wrong; I appreciate arguments if that's the case so I can ask for changes. If not, I need a query to get tabbed data in the format I will detail below. The structure goes like this: CLIENTS : ClientID ClientName ----------------------- 1 James 2 Leonard 3 Montgomery ATTRIBUTES : AttributeID AttributeName ----------------------------- 1 Rank 2 Date 3 Salary 4 FileRecordsAmount ATTRIBUTES_STRING :

Django Rest Framework & Entity–attribute–value model (EAV) Data Model

我只是一个虾纸丫 提交于 2019-12-07 14:59:02
问题 from django.db import models # django user from django.contrib.auth.models import User class Entity(models.Model): """ Entity of EAV """ entity = models.CharField(max_length=216, null=False, default='entity_name', name='entity', verbose_name='Entity of EAV', db_index=True, unique=True ) class Asset(models.Model): """ Asset of EAV """ asset = models.CharField(max_length=216, null=False, default='asset', name='asset', verbose_name='Asset of EAV' ) entity = models.ForeignKey(to=Entity) class