Internet Computer Mobile Games

why must i specify an index in query? (1 reply)

SELECT * FROM users LEFT JOIN (SELECT * FROM userHits) tx1 ON tx1.id=(SELECT id FROM userHits USE INDEX(userId) WHERE userId=users.id ORDER BY id DESC LIMIT 1);

0.91 seconds


SELECT * FROM users LEFT JOIN (SELECT * FROM userHits) tx1 ON tx1.id=(SELECT id FROM userHits WHERE userId=users.id ORDER BY id DESC LIMIT 1);

~15 seconds


**I realize the cardinality is low (its at 2), which is why MySQL isn't using it, but if a cardinality of 2 speeds up a query by 15x it seems sensible that it should use all indexes even if the cardinality is low. **

Can I configure this in my.cnf to force all indexes be used? Is there a way around this besides specifying the index in the query?


These are all innodb tables, so I thought it best to be in this forum. Excuse me if I was wrong.

Thanks!

Top similar posts to why must i specify an index in query? (1 reply)

query to get record based on fk id (1 reply)

this is a bit hard to explain, so here it go... i have 3 tables licence, option, licence_option (lookup) licence 1 = options a, b, c, d licence 2 = options b, c, d licence 3 = options c, d, e licence 4 = options a, d, e typically what it means is this licence has the following options(modules) it can perform now my work wants the ability to make it that user logs in and gets the NEXT available licence based on they options they pick from the GUI so if user puts username/pas...

Micro-Mechanics: Reply To SGX Query On FY2014 Annual Report Of Micro-Mechanics (Holdi

Micro-Mechanics: Reply To SGX Query On FY2014 Annual Report Of Micro-Mechanics (Holdings) Ltd More... ...

Recursive Query (1 reply)

Hello all, I'm trying to search a table recursively. a b c ------- 1 a 5 5 d 3 3 k 7 6 0 1 2 0 8 Currently I'm using the following query: select a, @pv:=c as 'col3' from (select * from ListTest order by c asc) ListTest join (select @pv:=6)tmp where [email protected]; When I search for 6, the o/p should be as a b c ----- 6 0 1 1 a 5 5 d 3 3 k 7 Using above query I'm able to get the o/p as a b c ----- 6 0 1 1 a 5 Can some one please help me to search the above...

Lookup / Index formula Query

Hi, As attached in the file, the formula should compare if Data in worksheet B with A, if all values in 3 columns matches it should return 'present' Please advice Attached Files Book5.xlsx‎ (12.0 KB) Download ...

Bring the new reply icon back to /et/index, in Forex

The previous version had an icon that would appear when a thread had a new reply. It was a quick, easy way to quickly scan the forum. Maybe it's a setting, but I have not noticed them since the upgrade. Can these be re-enabled? View attachment 146427...

How to access query parameter names with '-' in it (1 reply)

If query parameters in the request looks like this/something.cgi?param_name=1&param-name=2I can access 'param_name' as $arg_param_name. How do I access 'param-name' though? $arg_param-name will not work since as far as nginx is concerned the variable name ends at $arg_param. Is there a workaround for this case? Has anyone else run into a similar problem?...

Bring the new reply icon back to /et/index, in Forex

The previous version had an icon that would appear when a thread had a new reply. It was a quick, easy way to quickly scan the forum. Maybe it's a setting, but I have not noticed them since the upgrade. Can these be re-enabled? View attachment 146427...

Bring the new reply icon back to /et/index, in Forex

The previous version had an icon that would appear when a thread had a new reply. It was a quick, easy way to quickly scan the forum. Maybe it's a setting, but I have not noticed them since the upgrade. Can these be re-enabled? View attachment 146427...

Index archive and restore & performance query related to indexes

To archive: remove files except for the rawdata directory, since rawdata contains all the facts in the bucket. To restore: run splunk rebuild on the archived bucket, then atomically move the bucket to thawed for that index **Queries :** - Is that enough I move the bucket folder(db_recenttime_olddesttime_id) only with the rawdata contents ? deleting the rest of the content inside bucket ? - Is that mandatory i need to place the bucket only in the thawed path and rebuild ? - What happens if ...

Query Performance of History Table (1 reply)

Hello, I'm trying to query our support-ticket database for a report that should show the amount of tickets in its states during a given timespan. The ticket-history table tracks every change on a ticket, so there are a lot of rows for every ticket. I'm only intereseted in the newest entry in the given timespan. Later I'd like to run that query so that it gives me the results on a weekly bases, but for simplification I ran it only for the past few days. Unfortunately this query runs over 2 ho...

binary log index file content after dump (1 reply)

I'm testing a script that manages the incremental backups generated by mysql. The script does a mysqldump every 24hs and a incremental backup every 2hs. Mysql creates the binary logs (along the binary log index file) on a directory /mysql-log/. That is every 24hs, it executes something like: * mysqldump --single-transaction --flush-logs --master-data=2 --routines --delete-master-logs --user=backup_user --password=123456789 <databases> > <somewhere> where the option ...

all SQL query extremly slow (1 reply)

Hi everyone, I am running a woocommerce ecommerce website on a Debian 7 server with nginx and mysql, last version. Since two days, every single query became really slow (20 or 30 seconds) eventhough there is no load at all. I tried to debug a bit watching the mysql-slow-query.log but I can t find any valuable information, here is a result for a simple query: Tcp port: 3306 Unix socket: /var/run/mysqld/mysqld.sock ...

Shell Command for executing query (1 reply)

Dear Experts, Is that anyway i can write my query resultset to excel file with field alignments. I came across the command, mysql -u <username> -h <hostname> -p -e " SELECT FIELD1,FIELD2 FROM TABLE" > /var/www/test.xls I got the result in excel but the field values are aligned automatically, is that any way i can assign field values alignment like 'Left' ,' Right' or 'Justify'. Help me in this.....

Bring the new reply icon back to /et/index, in Forex

The previous version had an icon that would appear when a thread had a new reply. It was a quick, easy way to quickly scan the forum. Maybe it's a setting, but I have not noticed them since the upgrade. Can these be re-enabled? View attachment 146427...

Design Apple Development Security Automobile Network Photography Health Money Travel Shopping Issues Operating systems Drivers Software Programming Tech Home Science Sport Solution