select a.type, a.reason, a.published, a.id_RSSEpisode, b.id_RSSFeed, a.id_NewsItem, c.custom_playlist_name, b.duration from sa1.UserFrontPage a left join sa1.RSSEpisode b on a.id_RSSEpisode = b.id left join sa1.user_preference_vector_federated c on a.id_User = c.id_User and b.id_RSSFeed = c.id_RSSFeed where a.id_User = 1003630460 and a.type in (0, 1, 2, 3, 4, 11, 12, 13, 14, 15) order by a.published desc limit 0, 3 sa1.UserFrontPage sa1.RSSEpisode sa1.user_preference_vector_federated MariaDB [(none)]> desc sa1.UserFrontPage; +---------------+-------------+------+-----+-------------------+-------+ | Field | Type | Null | Key | Default | Extra | +---------------+-------------+------+-----+-------------------+-------+ | id_User | int(11) | YES | MUL | NULL | | | id_RSSEpisode | int(11) | YES | | NULL | | | id_NewsItem | int(11) | YES | | NULL | | | type | int(11) | YES | | NULL | | | reason | int(11) | YES | | NULL | | | published | timestamp | NO | | CURRENT_TIMESTAMP | | | deviceID | varchar(50) | YES | | NULL | | +---------------+-------------+------+-----+-------------------+-------+ 7 rows in set (0.00 sec) MariaDB [(none)]> show index from sa1.UserFrontPage; +---------------+------------+------------------------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | +---------------+------------+------------------------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | UserFrontPage | 0 | user_episode_news_unique_idx | 1 | id_User | A | 4791913 | NULL | NULL | YES | BTREE | | | | UserFrontPage | 0 | user_episode_news_unique_idx | 2 | id_RSSEpisode | A | 292306706 | NULL | NULL | YES | BTREE | | | | UserFrontPage | 0 | user_episode_news_unique_idx | 3 | id_NewsItem | A | 292306706 | NULL | NULL | YES | BTREE | | | | UserFrontPage | 1 | id_User_idx | 1 | id_User | A | 4362786 | NULL | NULL | YES | BTREE | | | +---------------+------------+------------------------------+--------------+---------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ 4 rows in set (0.00 sec) MariaDB [sa1]> desc RSSEpisode; +-------------------+---------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------------------+---------------------+------+-----+---------+----------------+ | id | int(10) | NO | PRI | NULL | auto_increment | | title | text | YES | | NULL | | | description | text | YES | | NULL | | | url | text | YES | MUL | NULL | | | duration | int(4) | YES | | NULL | | | published | datetime | YES | | NULL | | | id_RSSFeed | int(10) | YES | MUL | NULL | | | duration_expl | tinyint(2) unsigned | NO | | 0 | | | durationState | tinyint(2) | YES | | 0 | | | valid | tinyint(2) | YES | | 1 | | | cached | tinyint(2) | YES | | 0 | | | title_checksum | int(10) unsigned | YES | MUL | 0 | | | bitRate | smallint(6) | NO | | 0 | | | headerSizeInBytes | int(11) | YES | | NULL | | | type | tinyint(4) | YES | | NULL | | +-------------------+---------------------+------+-----+---------+----------------+ 15 rows in set (0.00 sec) MariaDB [(none)]> show index from sa1.RSSEpisode; +------------+------------+----------------------+--------------+----------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | +------------+------------+----------------------+--------------+----------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | RSSEpisode | 0 | PRIMARY | 1 | id | A | 25582416 | NULL | NULL | | BTREE | | | | RSSEpisode | 1 | feed | 1 | id_RSSFeed | A | 250808 | NULL | NULL | YES | BTREE | | | | RSSEpisode | 1 | index_RSSEpisode_url | 1 | url | A | 25582416 | 191 | NULL | YES | BTREE | | | | RSSEpisode | 1 | title_checksum_idx | 1 | title_checksum | A | 25582416 | NULL | NULL | YES | BTREE | | | | RSSEpisode | 1 | feed_type_idx | 1 | id_RSSFeed | A | 258408 | NULL | NULL | YES | BTREE | | | | RSSEpisode | 1 | feed_type_idx | 2 | type | A | 370759 | NULL | NULL | YES | BTREE | | | +------------+------------+----------------------+--------------+----------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ 6 rows in set (0.00 sec) MariaDB [sa1]> desc user_preference_vector_federated; +--------------------------+---------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------------------------+---------------+------+-----+---------+-------+ | id_User | int(10) | YES | MUL | NULL | | | id_RSSFeed | int(10) | YES | MUL | NULL | | | time | decimal(54,0) | YES | | NULL | | | upRating | decimal(45,0) | YES | | NULL | | | downRating | decimal(45,0) | YES | | NULL | | | emailShare | decimal(45,0) | YES | | NULL | | | fbShare | decimal(45,0) | YES | | NULL | | | twitterShare | decimal(45,0) | YES | | NULL | | | banFeed | decimal(45,0) | YES | | NULL | | | recoSelect | decimal(45,0) | YES | | NULL | | | searchSelect | decimal(45,0) | YES | | NULL | | | fbSelect | decimal(45,0) | YES | | NULL | | | duration | decimal(32,0) | YES | | NULL | | | listen_score | double(20,3) | YES | | NULL | | | episodes | bigint(21) | NO | | 0 | | | total_time_in_period | int(11) | YES | | NULL | | | id_Genre | int(11) | YES | MUL | NULL | | | id_Genre_parent | int(11) | YES | | NULL | | | id_RSSProvider | int(11) | YES | MUL | NULL | | | listen_score_total | double(20,3) | YES | | 0.000 | | | listen_score_percent | float(7,6) | YES | | NULL | | | fav_count | int(11) | YES | | 0 | | | thumb_up_score | float(7,3) | YES | | NULL | | | share_score | int(11) | YES | | NULL | | | thumb_down_score | float(7,3) | YES | | NULL | | | total_up_ratings_percent | float(7,4) | YES | | NULL | | | total_up_ratings | int(11) | YES | | NULL | | | fav_score | int(11) | YES | | 0 | | | total_score | int(11) | YES | | 0 | | | custom_playlist_name | varchar(255) | YES | | NULL | | +--------------------------+---------------+------+-----+---------+-------+ 30 rows in set (0.00 sec) MariaDB [(none)]> show index from sa1.user_preference_vector_federated; +----------------------------------+------------+---------------+--------------+----------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | +----------------------------------+------------+---------------+--------------+----------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | user_preference_vector_federated | 0 | user_feed_idx | 1 | id_User | NULL | NULL | NULL | NULL | YES | REMOTE | | | | user_preference_vector_federated | 0 | user_feed_idx | 2 | id_RSSFeed | NULL | NULL | NULL | NULL | YES | REMOTE | | | | user_preference_vector_federated | 1 | user_fav_idx | 1 | id_User | NULL | NULL | NULL | NULL | YES | REMOTE | | | | user_preference_vector_federated | 1 | user_fav_idx | 2 | fav_count | NULL | NULL | NULL | NULL | YES | REMOTE | | | | user_preference_vector_federated | 1 | feed_idx | 1 | id_RSSFeed | NULL | NULL | NULL | NULL | YES | REMOTE | | | | user_preference_vector_federated | 1 | user_idx | 1 | id_User | NULL | NULL | NULL | NULL | YES | REMOTE | | | | user_preference_vector_federated | 1 | genre_idx | 1 | id_Genre | NULL | NULL | NULL | NULL | YES | REMOTE | | | | user_preference_vector_federated | 1 | provider_idx | 1 | id_RSSProvider | NULL | NULL | NULL | NULL | YES | REMOTE | | | +----------------------------------+------------+---------------+--------------+----------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ 8 rows in set (0.02 sec) my.cnf file [client] port = 3306 socket = /var/lib/mysql/mysql.sock [isamchk] key_buffer_size = 16M [mysqld] auto_increment_increment = 1 auto_increment_offset = 1 back_log = 100 basedir = /usr bind_address = 0.0.0.0 binlog-format = STATEMENT character-set-client-handshake = FALSE character-set-server = utf8mb4 collation-server = utf8mb4_unicode_ci connect_timeout = 28800 core-file datadir = /var/lib/mysql/data default_storage_engine = INNODB expire_logs_days = 10 ignore_db_dirs = lost+found innodb_additional_mem_pool_size = 20M innodb_buffer_pool_instances = 8 innodb_buffer_pool_size = 16G innodb_checksums = 1 innodb_data_file_path = ibdata1:512M:autoextend innodb_data_home_dir = /var/lib/mysql/ibdata innodb_doublewrite = 1 innodb_fast_shutdown = 0 innodb_file_format = barracuda innodb_file_per_table = 1 innodb_flush_log_at_trx_commit = 2 innodb_flush_method = O_DIRECT innodb_locks_unsafe_for_binlog = 0 innodb_log_buffer_size = 16M innodb_log_file_size = 2000M innodb_log_files_in_group = 2 innodb_max_purge_lag = 0 innodb_purge_threads = 1 innodb_thread_concurrency = 8 interactive_timeout = 28800 key_buffer_size = 2G log-bin = /var/lib/mysql/binlog/mysql-bin log-error = /var/log/mariadb/log/mariadb.log log_slave_updates = true long_query_time = 1 max_allowed_packet = 256M max_binlog_size = 100M max_connect_errors = 1000 max_connections = 800 max_heap_table_size = 64M max_tmp_tables = 64 myisam_sort_buffer_size = 32M net_read_timeout = 15 net_write_timeout = 30 open_files_limit = 65535 pid-file = /var/lib/mysql/mysql.pid port = 3306 query_cache_limit = 1048576 query_cache_size = 1M query_cache_type = 2 read_buffer_size = 8M read_rnd_buffer_size = 8M server_id = 183595275 skip-external-locking skip-name-resolve skip-slave-start slave_compressed_protocol = 1 slow_query_log = 0 slow_query_log_file = /var/log/mariadb/log/slow.log socket = /var/lib/mysql/mysql.sock sort_buffer_size = 8M ssl = false ssl-ca = /etc/mysql/cacert.pem ssl-cert = /etc/mysql/server-cert.pem ssl-key = /etc/mysql/server-key.pem sync_binlog = 2 table_cache = 3000 thread_cache_size = 128 thread_stack = 256K tmp_table_size = 64M tmpdir = /tmp transaction-isolation = REPEATABLE-READ user = mysql wait_timeout = 28800 [mysqld-5.0] myisam-recover = BACKUP [mysqld-5.1] myisam-recover = BACKUP [mysqld-5.5] myisam-recover = BACKUP [mysqld-5.6] myisam-recover-options = BACKUP [mysqld-5.7] myisam-recover-options = BACKUP [mysqld_safe] log-error = /var/log/mariadb/mariadb.log nice = 0 socket = /var/lib/mysql/mysql.sock [mysqldump] max_allowed_packet = 16M quick quote-names