-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow passing a table name in GetUpdateSQL()'s $result param #995
Comments
By all means do submit your PR, thank you ! If you don't mind, please also provide the relevant update to the documentation. You can do so by adding a code block with revised DokuWiki source in a PR comment, and I'll paste it into the wiki when I merge it. |
I've been forgetting to ask you about that. |
No. The documentation is a separate thing, and the wiki is configured for restricted write access
Don't sweat it, just type the text and I'll adjust formatting if needed. |
I'm not sure what is going on in |
All of the features you name are there to reduce table lookups when doing bulk inserts of records. I added them about 20 years ago and was able to speed up bulk insults by 10x or more. As my companies application can do 250,000 inserts inside a single transaction and I need it done as efficiently and quickly as possible, you can understand my concern at any changes you might be pushing. As background, what these do is prevent the table schema being read for every insert made by getInsertSql(). This schema read is a resource greedy event and really drags down performance. After being read once they are stored and the in-memory copy re-used. |
Thank you, this is why I try to ask a million questions before submitting a PR. You & @dregad know this codebase inside & out. I'm trying to bring the For In the instance where If I can bring it straight over, all need to do is remove the comments from the code below, and we should be in business for `GetUpdateSQL()' } else if (is_subclass_of($rs, 'adorecordset')) {
// if (isset($rs->insertSig) && is_integer($cacheRS) && $cacheRS == $rs->insertSig) {
// $columns = $cacheCols;
// } else {
$columns = [];
for ($i=0, $max=$rs->FieldCount(); $i < $max; $i++)
$columns[] = $rs->FetchField($i);
// $cacheRS = $cacheSig;
// $cacheCols = $columns;
// $rs->insertSig = $cacheSig++;
// } As stated, I'm trying not to break anything in the process. 😄 |
Disregard that question, it helps when I scroll up in the code and read the first few lines of |
Actually part of that question still stands.
or |
Going with keep @dregad , I didn't forget your request for updated documentation, I'll send that in the PR comment. |
Description
Noticed while working on #899 . Both
GetInsertSQL()
&GetUpdateSQL()
create a database-specific SQL statement based on supplied parameters .GetInsertSQL()
can do this using a supplied table name instead of anADORecordSet
object .GetUpdateSQL()
cannot.Environment
Steps to reproduce
Detailed, step-by-step instructions to reproduce the behavior, including:
Expected behavior
Additional context
#899 Comments thread
I've already implemented a Proof of Concept fix for this, if it's something that would add value to ADOdb, I'll clean up my code and PR it.
The text was updated successfully, but these errors were encountered: