[ODBC-175] find from access in a varchar column is so slow ms access freezing for minutes in a small table. Created: 2018-08-25  Updated: 2021-03-04

Status: Stalled
Project: MariaDB Connector/ODBC
Component/s: General
Affects Version/s: 3.0.6
Fix Version/s: 3.1

Type: Task Priority: Minor
Reporter: Shimon Doodkin Assignee: Lawrin Novitsky
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Windows, MS Access



 Description   

from ms access.
the find in a table in a varchar column is so slow MS Access freezing for minutes.
it also prevents the use of access functions like find go to find the first occurrence of something.

also, there is another thing when tracing odbc , it says invalid length -1. many times sometimes.

how to reproduce:
create an InnoDB table in the server, with columns of: id int auto_increment and varchar(256)

CREATE TABLE `test` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`text` varchar(256) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

/* copy paste about 1000 times (select this line and next emmpty line and press control+c and hold control+v until there is enough line number): */
INSERT INTO `test`(`text`)VALUES(RAND());

SELECT * FROM test;

create empty ms access file.
open odbc32 in windows, make a connection to the server and call it with some name, using MariaDB driver. (although I connect SSL i believe it does not change anything, also I connect to database on the internet on my server. so there is some latency)
add from: external data>new data source>from other sources>odbc database. choose: link to the data source. select tab machine data source. pick the table.

open the table in ms access and select the column with the text and press control+f. type something and click find. see it takes a long time. in a not very long table (i use MS Access 2013)



 Comments   
Comment by Lawrin Novitsky [ 2018-09-18 ]

shimondoodkinAfter spending much time on trying to figure out what causes such a slow search with Access, I'd finally noticed that the table in your report has default charset utf8. That made me guess that the issue here is in redundant recoding work.
After setting utf8 as connection charset(3rd screen in the connection setup dialog), I think the performance becomes absolutely acceptable.
I probably close the issue now. If you don't find my solution working for you, or you still think there is a but here, you are free to re-open it.
And thank you for your report, it is still very useful.

Comment by Shimon Doodkin [ 2018-09-19 ]

did you have the slowness?

Comment by Lawrin Novitsky [ 2018-09-19 ]

shimondoodkin yes, and setting connection charset to utf8 solved that

Comment by Shimon Doodkin [ 2018-09-25 ]

setting charset to utf8 did not solve it for me.

Comment by Lawrin Novitsky [ 2018-09-25 ]

Strange, for me it did solve.
Well, re-opening anyway

Generated at Thu Feb 08 03:26:46 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.