Ask Your Question
0

Base search on primary key of table is slow

asked 2012-05-26 18:56:50 +0200

RichA gravatar image RichA
105 3 10

I am using Base to connect to a remote MYSQL database. One of the tables has about 4500 records.

I created a Base form to access this table. The form initially displays with the first 10 or so records. I performed a Search for the primary key of about the 500th record in the table and it took forever. I could see record numbers slowly incrementing--it seemed like it was retrieving one record at a time and checking the key field for the search value.

I then created an index on the table, to see if that would speed up the process. I did this directly on the MYSQL database itself, not going through Base. After that, Base still seemed to be looking record-by-record, perhaps ignoring the index and perhaps not knowing about the incex.

Is there any way to speed this up? Is there a way to get Base to use the index on the table when it searches?

I have some familiarity with MYSQL and Postgresql, but I am new to Base. I am trying to use it to create a front-end for some non-technical people who don't know SQL and just need to enter and access data.

Thanks very much.

delete close flag offensive retag edit

2 Answers

Sort by » oldest newest most voted
1

answered 2012-05-27 01:15:14 +0200

LiboV gravatar image LiboV
151 5
http://lo-portal.us/libo

Your right - the search function will always go record by record, and it will always retrieve the data into the actual data control you are searching (though in the background) - this is because search offers the ability to search for items as presented to the end user and offers the ability to search across multiple data fields.

As you found - filtering on the other hand actually generates a select statement in the background and issues that to the database, and is much faster then.

Be aware though that there is one other difference, the result set you are working with does not change with a search but does with a filter. A search changes the record cursor within the current result set, a filter generates a new and different result set.

link delete flag offensive edit
0

answered 2012-05-26 19:23:55 +0200

RichA gravatar image RichA
105 3 10

It looks like Form-based filters is what I need to use.

link delete flag offensive edit

Login/Signup to Answer

Donate

LibreOffice is made available by volunteers around the globe, backed by a charitable Foundation. Please support our efforts: Your donation helps us to deliver a better product!

Question tools

Follow

subscribe to rss feed

Stats

Asked: 2012-05-26 18:56:50 +0200

Seen: 168 times

Last updated: May 27 '12