Download presentation
Presentation is loading. Please wait.
Published byῬαχήλ Λούπης Modified over 5 years ago
1
CS122B: Projects in Databases and Web Applications Winter 2018
Professor Chen Li Department of Computer Science UC Irvine Notes 13: User-Defined Functions (UDF) in MySQL
2
Purpose SQL has its own limitations
Enhance DB using functions implemented in C
3
Example: edit distance
Edit distance between two strings is the minimum number of single-character operations (insert/delete/substitute) to transform one to the other Also known as Levenshtein distance Example: ed("kitten”, "sitting”) = 3 Classic dynamic programming algorithm for computing ed(s1, s2)
4
Supporting Edit Distance as UDF
Compile Edit distance Function in C: ed.c Shared library libed.so CREATE FUNCTION ed RETURNS INTEGER SONAME 'libed.so'; SELECT ed('abc', 'ad'); MySQL
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.