database-indexes
How to index this table (a_level, b_level, item_id)
I have a table of items, each of it has an a_level, b_level, and an item_id. Any b_level is dedicated to only one a_level (example: b_level 14 is \"child\" of a_level 2 only)[详细]
2023-04-12 09:11 分类:问答MySQL - Index to speed up queries with aggregate functions
As I understand, an index on a typical database table will provide a more efficient row look up. Does a similar construct exist for making queries with aggregate functions more efficient?[详细]
2023-04-07 02:12 分类:问答Query against two integer columns take an absurd amount of time
I have a query that gets generated (by Django) like this: SELECT `geo_ip`.`id`, `geo_ip`.`start_ip`, `geo_ip`.`end_ip`, `geo_ip`.`start`,[详细]
2023-04-06 00:13 分类:问答MySQL SELECT IN() statement and InnoDB Index fails
I have a query that does this: SELECT `threaded_comments`.* FROM `threaded_comments` WHERE `threaded_comments`.`parent_id` IN (4, 5)[详细]
2023-03-30 02:02 分类:问答Does rename_column take care of indexes?
Say, we have something like this: add_column :users, :single, :boolean add_index :users, :single and then later we do[详细]
2023-03-20 20:50 分类:问答Given a query, how do you know which indices to add?
Is there some tool that does this? You give it a SQL query and it gives suggestions. For example, I\'m trying to optimize the following query:[详细]
2023-03-19 02:44 分类:问答Should I add an index on a counter-cache column in Ruby on Rails 3.0
Environment: Rails 3.0.4, MySQL, Ruby 1.8.7 I have the following table: create_table \"countries\", :force => true do |t|[详细]
2023-02-16 15:12 分类:问答Can MYSQL use an index for a WHERE ... IN query?
We currently have a query in our app like this: SELECT * FROM combos WHERE text = \'[text]\' We\'re putting a category_id column on combos, and the query will change to this:[详细]
2023-02-05 18:12 分类:问答Database design question - which is the best solution?
I\'m using Firebird 2.1 and I\'m looking for the best way to solve this issue. I\'m writing a calendaring application. Different users\' calendar entries are stored in a big Calendar table. Each cale[详细]
2023-01-25 18:20 分类:问答Database indexes - does the table size matter?
What I mean is: Does a table with 20 columns benefit more from indexing a certain field (one that\'s used in search-ish queries) than a table that has just 4 columns?[详细]
2023-01-25 17:45 分类:问答