Does the order of tuples in a bulk insert impact query performance?
am 07.02.2010 13:28:51 von Anthony Urso
Does the order of tuples in a bulk insert impact later query
performance? E.g. will sorting the rows before a bulk insert cause
queries to perform better for indexed or non-indexed fields?
Thanks,
Anthony
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org
Re: Does the order of tuples in a bulk insert impact queryperformance?
am 07.02.2010 21:23:38 von Tom Worster
On 2/7/10 7:28 AM, "Anthony Urso" wrote:
> Does the order of tuples in a bulk insert impact later query
> performance? E.g. will sorting the rows before a bulk insert cause
> queries to perform better for indexed or non-indexed fields?
when i load a large body of data (using INFILE), i remove the indexes before
the load and add them back after. i work on the assumption that if the data
is sorted already then the recreation of the indexes in the last step is
faster. but then if you have orthogonal indexes, you have to choose one to
sort the rows by.
as for performance on accessing the table later in normal use, i guess it
depends on the usage patterns. if there's a lot of clustered or sequential
table reads then caching might be more effective if the rows are sorted.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org