Any way to improve performance, it seems all queries takes 1.xx seconds, even on Cloudflare dashboar
Any way to improve performance, it seems all queries takes 1.xx seconds, even on Cloudflare dashboard simple products table with 5 rows -


beta, yes.

wrangler d1 info <dbname>?
wrangler d1 migrations testdb apply --local command to apply migration, it worked successfully but when I use the prepare statement I am getting error of no table Test existsObject {
message: D1_ERROR: Failed to parse body as JSON, got: error code: 1042,
cause: Failed to parse body as JSON, got: error code: 1042
}async function InsertIntoContentDatabase(db:D1Database, content:ContentDataType): Promise<D1Result<unknown>[]>{
try {
if(content.contentDataItemType === undefined){
console.log('No contentDataItemType');
throw('Missing contentDataItemType Array');
}
//Because we may have multiple items to push into the database, we need to batch the call
const batcher = await db.prepare("INSERT INTO content_models (contentGroupRef, projectRef, contentElementRef, contentBakedStatement, publishState) VALUES (?1, ?2, ?3, ?4, ?5)")
let binderCollection=[];
for (let index = 0; index < content.contentDataItemType.length; index++) {
const element = content.contentDataItemType[index];
let temp = batcher.bind(
element.contentGroupRef,
element.projectRef,
element.contentElementRef,
element.contentBakedStatement,
element.publishState
);
binderCollection.push(temp);
console.log('Loop Batch=>', JSON.stringify(temp));
}
return await db.batch(binderCollection);
} catch (error:any) {
console.log('D1 Instance=>', JSON.stringify(db.dump()));
console.log({
message: error.message,
cause: error.cause.message,
});
throw(error);
}
}Loop Batch=> {"database":{"fetcher":{}},"statement":"UPDATE content_models SET contentGroupRef = ?2, projectRef = ?3, contentBakedStatement = ?4, publishState = ?5 WHERE contentElementRef = ?1","params":["ref0","cg0","prTest0","We are proud to present a gorgeous large green wall panel square made from ivory wood.",1]}Loop Batch=> {"database":{"fetcher":{}},"statement":"INSERT INTO content_models (contentGroupRef, projectRef, contentElementRef, contentBakedStatement, publishState) VALUES (?1, ?2, ?3, ?4, ?5)","params":["cg0","prTest0","ref0","We are proud to present a gorgeous large green wall panel square made from ivory wood.",1]}Error=> Error: D1_ERROR: Failed to parse body as JSON, got: error code: 1042
at D1Database._send (cloudflare-internal:d1-api:105:19)
at async D1Database.exec (cloudflare-internal:d1-api:41:23)
at async InsertIntoContentDatabase (file:///C:XXXXX/Temp/tmp-35236-4jsc2tuBSi4U/index.js:3232:5)
at async RunContent (file:///C:XXXXX/Temp/tmp-35236-4jsc2tuBSi4U/index.js:3155:17)
at async Array.<anonymous> (file:///C:XXXXX/Temp/tmp-35236-4jsc2tuBSi4U/index.js:3727:12)
at async file:///C:XXXXX/Temp/tmp-35236-4jsc2tuBSi4U/index.js:2408:21 {
stack: Error: D1_ERROR: Failed to parse body as JSON, got…ocal/Temp/tmp-35236-4jsc2tuBSi4U/index.js:2408:21,
message: D1_ERROR: Failed to parse body as JSON, got: error code: 1042,
cause: Error: Failed to parse body as JSON, got: error code: 1042
at D1Database._send (cloudflare-inte…
}Object {
message: D1_EXEC_ERROR: Error in line 1: INSERT INTO conten…'test1','test1',1): no such table: content_models,
cause: Error in line 1: INSERT INTO content_models (conte…'test1','test1',1): no such table: content_models
}