filesort

R: how to find select files in a folder based on matching specific column title

自古美人都是妖i 提交于 2021-01-28 13:37:52
问题 Sorry for the generic question. I'm looking for pointers for sorting out a data folder, in which I have numerous .txt files. All of them have different titles, and for the vast majority of them, the files have the same dimension, that is the column numbers are the same. However, the pain is some of the files, despite having the same number of columns, have different column names. That is in those files, some other variables were measured. I want to weed out these files, and I cannot do by

R: how to find select files in a folder based on matching specific column title

一世执手 提交于 2021-01-28 13:34:39
问题 Sorry for the generic question. I'm looking for pointers for sorting out a data folder, in which I have numerous .txt files. All of them have different titles, and for the vast majority of them, the files have the same dimension, that is the column numbers are the same. However, the pain is some of the files, despite having the same number of columns, have different column names. That is in those files, some other variables were measured. I want to weed out these files, and I cannot do by

R: how to find select files in a folder based on matching specific column title

回眸只為那壹抹淺笑 提交于 2021-01-28 13:33:35
问题 Sorry for the generic question. I'm looking for pointers for sorting out a data folder, in which I have numerous .txt files. All of them have different titles, and for the vast majority of them, the files have the same dimension, that is the column numbers are the same. However, the pain is some of the files, despite having the same number of columns, have different column names. That is in those files, some other variables were measured. I want to weed out these files, and I cannot do by

Avoid filesort with INNER JOIN + ORDER BY

限于喜欢 提交于 2020-01-11 05:32:05
问题 I've been reading other posts but I didn't managed to fix my query. Using DESC order the query is x20 times slower, I must improve that. This is the query: SELECT posts.post_id, posts.post_b_id, posts.post_title, posts.post_cont, posts.thumb, posts.post_user, boards.board_title_l, boards.board_title FROM posts INNER JOIN follow ON posts.post_b_id = follow.board_id INNER JOIN boards ON posts.post_b_id = boards.board_id WHERE follow.user_id =1 ORDER BY posts.post_id DESC LIMIT 10 And these are

FileSort in visual basic based TimeStamp mentioned in the file names

醉酒当歌 提交于 2019-12-25 01:45:57
问题 how to sort the files in the directory based on the part of the file name? File format: prod_orders_XXX_<TimeStamp>.datXXX = symbol of the product and the length may varies. <TimeStamp> = date and time Multiple files for the same XXX are possible with different time stamps. Here are some examples: prod_orders_abc_20122001083000.dat prod_orders_abc_20122007083111.dat prod_orders_xyz_20122003093157.dat prod_orders_xyz_20122001083000.dat prod_orders_abc_20122001163139.dat prod_orders_abc

Mysql slow query: INNER JOIN + ORDER BY causes filesort

那年仲夏 提交于 2019-12-18 05:56:09
问题 I'm trying to optimize this query: SELECT `posts`.* FROM `posts` INNER JOIN `posts_tags` ON `posts`.id = `posts_tags`.post_id WHERE (((`posts_tags`.tag_id = 1))) ORDER BY posts.created_at DESC; The size of tables is 38k rows, and 31k and mysql uses "filesort" so it gets pretty slow. I tried to use different indexes, no luck. CREATE TABLE `posts` ( `id` int(11) NOT NULL auto_increment, `created_at` datetime default NULL, PRIMARY KEY (`id`), KEY `index_posts_on_created_at` (`created_at`), KEY

File Sorting using Visual Basic

喜你入骨 提交于 2019-12-14 03:15:37
问题 how to sort the files in the directory ? i'll have more than 500 no of files in the below format. prod_orders_XXX_<TimeStamp>.dat XXX = symbol of the product and the length may varies between 3-6. <TimeStamp> = date and time Multiple files for the same XXX are possible with different time stamps. Here are some examples: prod_orders_abc_20122001083000.dat prod_orders_abc_20122001083111.dat prod_orders_xyz_20122001093157.dat prod_orders_xyz_20122001083000.dat prod_orders_abc_20122001163139.dat

MySQL: Avoid filesort when using IN and ORDER BY

感情迁移 提交于 2019-12-10 11:45:54
问题 Let's suppose I have the following table (let's call it my_table ): CREATE TABLE `my_table` ( `table_id` int(10) unsigned NOT NULL auto_increment, `my_field` int(10) unsigned NOT NULL default '0' PRIMARY KEY (`table_id`), KEY `my_field` (`my_field`,`table_id`) ) ENGINE=MyISAM The primary key for my_table is table_id (auto_increment) and I also have a key with my_field and table_id . If I test this query... EXPLAIN SELECT * FROM my_table WHERE my_field = 28 ORDER BY table_id DESC; ... I get:

Slow MySQL query

匆匆过客 提交于 2019-12-10 11:41:14
问题 Hey I have a very slow MySQL query. I'm sure all I need to do is add the correct index but all the things I try don't work. The query is: SELECT DATE(DateTime) as 'SpeedDate', avg(LoadTime) as 'LoadTime' FROM SpeedMonitor GROUP BY Date(DateTime); The Explain for the query is: id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE SpeedMonitor ALL 7259978 Using temporary; Using filesort And the table structure is: CREATE TABLE `SpeedMonitor` ( `SMID` int(10) unsigned NOT

Using filesort to sort by datetime column in MySQL

大憨熊 提交于 2019-12-08 04:20:10
问题 I have a table Cars with datetime (DATE) and bit (PUBLIC). Now i would like to take rows ordered by DATE and with PUBLIC = 1 so i use: select c.* from Cars c WHERE c.PUBLIC = 1 ORDER BY DATE DESC But unfortunately when I use explain to see what is going on I have this: 1 SIMPLE a ALL IDX_PUBLIC,DATE NULL NULL NULL 103 Using where; Using filesort And it takes 0,3 ms to take this data while I have only 100 rows. Is there any other way to disable filesort? If i goes to indexes I have index on