BREAD
BREAD
Explore posts from servers
DTDrizzle Team
Created by BREAD on 5/31/2023 in #help
Performance questions
Hey, didn't try it out myself. The format() method was taken from the planetscale driver if I remember correctly
40 replies
DTDrizzle Team
Created by hachoter on 6/12/2023 in #help
What's the overhead (if any) of using the new relational api?
Overhead will not be noticeable until your queries return huge amounts of data
10 replies
DTDrizzle Team
Created by hachoter on 6/12/2023 in #help
What's the overhead (if any) of using the new relational api?
It may depend on DBMS you are using, but in case of Planetscale(and probably any other MySQL but have to be clarified) the query generated by Relational API is not able to leverage indexes. Therefore reads are more expensive and potentially slower, but you will notice difference only with REALLY big tables
10 replies
DTDrizzle Team
Created by BREAD on 5/31/2023 in #help
Performance questions
40 replies
DTDrizzle Team
Created by BREAD on 5/31/2023 in #help
Performance questions
If the conditions would be scoped to the subqueries, there shouldn't be an issue with referencing table that is out of scope, if condition is built following Drizzle's type hints Regarding your condition example
where: and(eq(orders.id, id), sql`json_array_length(${orders.orderItems}) > 0`))
where: and(eq(orders.id, id), sql`json_array_length(${orders.orderItems}) > 0`))
Well, if I understand correctly, sql operator does not provide any type-safety and therefore should not be treated as a tool that provides guarantee because the user is in complete control and can pass anything in there whether it's correct or not
40 replies
DTDrizzle Team
Created by BREAD on 5/31/2023 in #help
Performance questions
40 replies
DTDrizzle Team
Created by BREAD on 5/31/2023 in #help
Performance questions
@Dan Kochetov I see in current implementation Drizzle relies on multiple GROUP BY. Can we not use it to ensure that only distinct records will be selected
40 replies
DTDrizzle Team
Created by BREAD on 5/31/2023 in #help
Performance questions
40 replies
DTDrizzle Team
Created by BREAD on 5/31/2023 in #help
Performance questions
40 replies
DTDrizzle Team
Created by BREAD on 5/31/2023 in #help
Performance questions
40 replies
DTDrizzle Team
Created by BREAD on 5/31/2023 in #help
Performance questions
40 replies
DTDrizzle Team
Created by BREAD on 5/31/2023 in #help
Performance questions
@Dan Kochetov Even if we ignore indexes, it looks like Drizzle in the case of relational queries relies on multiple subqueries that does not have any constraints. Meaning that each subquery will select whole table. In addition, if we take a look at my case, I need to select orders that are bound to specific customer, but as far as I can see, the query built by Drizzle will select all orders with all joined and aggregated data using subqueries and only then will perform WHERE lookup on resulting derived table. Since this table is derived, not an original one stored in DB, it makes sense it does not utilise indexes, since there are none
40 replies
DTDrizzle Team
Created by BREAD on 6/3/2023 in #help
Setting AUTO_INCREMENT starting value
Got it, thank you
4 replies
DTDrizzle Team
Created by BREAD on 5/31/2023 in #help
Performance questions
40 replies
DTDrizzle Team
Created by BREAD on 5/31/2023 in #help
Performance questions
@mcgrealife thanks for tip. Will definitely try it out
40 replies
DTDrizzle Team
Created by BREAD on 5/31/2023 in #help
Performance questions
40 replies
DTDrizzle Team
Created by BREAD on 5/31/2023 in #help
Performance questions
40 replies
DTDrizzle Team
Created by BREAD on 5/31/2023 in #help
Performance questions
As far as I can see, I can get an object consisting out of query and params. For now I can't find a way of turning this staff into plain query
40 replies
DTDrizzle Team
Created by BREAD on 5/31/2023 in #help
Performance questions
40 replies
DTDrizzle Team
Created by BREAD on 5/31/2023 in #help
Performance questions
It would be great if I could do something like this
const query1 = db.insert(table1).values(...).toSQL()

const query2 = db.insert(table2).values(...).toSQL()

await db.execute(`${query1}${query2}`)
const query1 = db.insert(table1).values(...).toSQL()

const query2 = db.insert(table2).values(...).toSQL()

await db.execute(`${query1}${query2}`)
40 replies