database-performance

database design - categories and sub-categories [closed]

守給你的承諾、 提交于 2019-12-10 01:36:45
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 4 years ago . I need to implement Categorization and Sub-Categorization on something which is a bit similar to golden pages. Assume I have the following table: Category Table CategoryId, Title 10, Home 20, Business 30, Hobbies I have two options to code the sub-categorization. OPTION 1 -

Firebase Android: slow “join” using many listeners, seems to contradict documentation

故事扮演 提交于 2019-12-09 17:27:45
问题 Implementing an Android+Firebase app, which has a many-to-many relationship: User <-> Widget (Widgets can be shared to multiple users). Considerations: List all the Widgets that a User has. A User can only see the Widgets which are shared to him/her. Be able to see all Users to whom a given Widget is shared. A single Widget can be owned/administered by multiple Users with equal rights (modify Widget and change to whom it is shared). Similar to how Google Drive does sharing to specific users.

MySQL fetch time optimization

烂漫一生 提交于 2019-12-09 12:28:18
问题 oI have a table with 2 millions of registers, but it will grow much more soon. Basically this table contains points of interest of an image with respective descriptors. When I'm trying to execute query that selects points that are spatially near to the query points, total execution time takes too long. More precisely Duration / Fetch = 0.484 sec / 27.441 sec. And the query is quite simple, which returns only ~17000 rows. My query is: SELECT fp.fingerprint_id, fp.coord_x, fp.coord_y, fp.angle,

Oracle preferred columns lengths

为君一笑 提交于 2019-12-09 04:51:34
问题 Does the multiplication factor of a column's length somehow influence the database performance? In other words, what is the difference between the performance of the following two tables: TBL1: - CLMN1 VARCHAR2(63) - CLMN2 VARCHAR2(129) - CLMN3 VARCHAR2(250) and TBL2: - CLMN1 VARCHAR2(64) - CLMN2 VARCHAR2(128) - CLMN3 VARCHAR2(256) Should we always attempt to make a column's length to some power of 2 or does only the maximum size matter? Some of the developers claim that there is some link

Doctrine2: Limiting with Left Joins / Pagination - Best Practice

拟墨画扇 提交于 2019-12-08 17:19:15
问题 i have a big query (in my query builder) and a lot of left joins. So i get Articles with their comments and tags and so on. Let's say i have the following dql: $dql = 'SELECT blogpost, comment, tags FROM BlogPost blogpost LEFT JOIN blogpost.comments comments LEFT JOIN blogpost.tags tags'; Now let's say my database has more than 100 blogposts but i only want the first 10, but with all the comments of those 10 and all their tags, if they exist. If i use setMaxResults it limits the Rows. So i

What's TOO BIG for a database?

徘徊边缘 提交于 2019-12-08 16:29:22
问题 I have a buddy who runs a web app for people listing cars for sale. There are a few thousand clients who use it, and each client has hundreds and sometimes thousands of rows in the database (some have been on for 5 years with hundreds of cars selling each month, and 10s of rows per sale (comments, messages, etc)). He has run this system in one SQL Server database in one physical server with like 20GB or RAM and a couple processors for the whole time, with no problems. Is this some sort of

How to enable FEDERATED engine in XAMPP

半腔热情 提交于 2019-12-08 13:28:43
问题 How can I enable the FEDERATED storage engine in the MySQL that comes with XAMPP distribution? I am using Version 1.8.3 of XAMPP with MySQL Version 5.6.16-log. The INFORMATION_SCHEMA.ENGINES table shows that FEDERATED support is NO. 回答1: In my.ini or my.cnf you should deactivate the option skip-federated For my my.ini I had to change: # commented in by lampp security # skip-networking skip-federated to # commented in by lampp security # skip-networking # skip-federated 来源: https:/

Constant-time index for string column on Oracle database

谁说我不能喝 提交于 2019-12-08 12:39:21
问题 I have an orders table. The table belongs to a multi-tenant application, so there are orders from several merchants in the same table. The table stores hundreds of millions of records. There are two relevant columns for this question: MerchantID , an integer storing the merchant's unique ID TransactionID , a string identifying the transaction I want to know whether there is an efficient index to do the following: Enforce a unique constraint on Transaction ID for each Merchant ID . The

How to pair low/high cardinality columns as composite indexes?

风格不统一 提交于 2019-12-08 12:23:20
问题 This question concerns to Oracle DB, so if there are general answers I would like to know. As I am discarding information from Derby/MySQL and other DBs regarding this subject. Let's say I have several queries using the following columns on its WHERE clause: Column | Cardinality | Selectivity _______|__________________________ A | low | low B | high | low C | low | low D | high | high E | low | low F | low | low -- Queries SELECT * FROM T WHERE A:=? AND B:=? SELECT * FROM T WHERE A:=? AND B:=

Bulk insert with EF

爱⌒轻易说出口 提交于 2019-12-08 10:38:18
问题 I need to insert some objects (about 4 million) in the database using C# and EF (using .NET 3.5). My method that adds the objects is in a for: private DBModelContainer AddToContext(DBModelContainer db, tblMyTable item, int count) { db.AddTottblMyTable (item); if ((count % 10000== 0) || (count == this.toGenerate)) { try { db.SaveChanges(); } catch (Exception e) { Console.WriteLine(e.StackTrace); } } return db; } How to detach the added objects (of type tblMyTable) from the context object? I