[wp-hackers] DB Queries--which way to go?

Elliott Bäck ecb29 at cornell.edu
Sun Jul 10 16:34:09 GMT 2005


I've currently got two options for db access with a plugin I'm writing, 
and would like an opinion on which one is better:

1)  get the applicable row, update if exists, insert if not
2)  insert blindly, schedule a "cleanup" thread to consolidate duplicates

Another option is something like oracle's MERGE function, where I can 
check a condition and then base my query off subqueries if it exists to 
update the row or else insert, but I don't think MYSQL can do that...

-- 
Thanks,
Elliott C. Bäck

607-229-0623
http://elliottback.com



More information about the wp-hackers mailing list