pass data to another asp page Programming Software Development by Fergus_1 ok so i have a page with a gridview on it and it displays rows from sql table. i have also a link assigned to each row: <asp:GridView ID="GridViewMatters" runat="server" AutoGenerateColumns="False" OnRowDataBound="GridViewMatters_RowDataBound"> <Columns> <asp:… Re: Improve HAVING BY performance Programming Databases by Biiim > INSERT INTO electronics.products(ProductID, ProductName, Price) VALUES ('1','capacitors', 2.50), ('2','resistors', 4.50), ('3','rectifiers', 7.50), ('4','diodes', 10.00), ('5','ICs', 25.00), ... ('50000','...', ...); I don't see any mention of an index on it & your benchmark indicates you don't have one: ALTER TABLE `… Re: Improve HAVING BY performance Programming Databases by Dani But you're not comparing apples to apples. Your WHERE query and your HAVING query perform different calculations and do different things. In one, you're plucking out all the rows with a price greater than $4, and then calculating an average price for each product. In the other, you're plucking out *all* rows, calculating an average price for each … Re: Improve HAVING BY performance Programming Databases by toneewa I know when you don't use aggregate calculations use WHERE. Producing the same results can be done. I added another test with MAX(Price). With a database over 305K rows, 3 columns, MySQL Workbench is unstable importing. Took over 2 hours. WHERE is faster, and should be used, when no functions are needed. WHERE Query execution time: 0.… Re: Improve HAVING BY performance Programming Databases by Biiim I realise this has been marked as solved, but I wanted to make it known that the HAVING clause runs on the returned result set of your query, which as you say has no indexes on it as it is just a temporarily created result set - but has the benefit of allowing you do do some simple post-processing on the result set. (This is for MariaDB at least)… Re: Improve HAVING BY performance Programming Databases by Biiim > I don't have experience with MariaDB, but in MySQL, something like that will work as long as I do SELECT sum(points) AS total FROM ... HAVING total > 10. Is that what you were getting at? Kind of, MariaDB is a fork of MySQL from around 2009 or something like that, MySQL 5.* and the creator continued developing MariaDB and Oracle took … Re: Improve HAVING BY performance Programming Databases by toneewa I'm a little late to the party, however, I want to share my experience learning MySQL in the past day. I setup a server, a database, and wrote a C++ program to connect to it. It measures the times for 3 SELECTs. The whole product list, using HAVING, and WHERE. I also tested reversing the orders. Query execution time: 0.0002336 seconds … Re: Improve HAVING BY performance Programming Databases by Dani > SELECT sum(points) total FROM ... HAVING points > 10 I don't have experience with MariaDB, but in MySQL, something like that will work as long as I do `SELECT sum(points) AS total FROM ... HAVING total > 10`. Is that what you were getting at? As far as what I was trying to accomplish that provoked this question, I was working on a … Re: Improve HAVING BY performance Programming Databases by toneewa I added your mentioned alter table index. Took 4.375 secs in MySQL Workbench. It did speed up the results. I'll have to try another method of importing to see if I can improve this. I also ommitted the overhead of converting variables for display output measurements, because they were included in the C++ times. If we were to compare the two, it as … Re: How to query database using variable and get all results not just one row Programming Web Development by Mikekelvin To ensure that you're retrieving all records associated with the current user, you need to make sure that your query accurately filters the data based on the user's identifier (variable_name). Here's how you can modify your query to achieve this: // Assuming $currentUser holds the identifier of the current user // Query database to retrieve … Re: How to query database using variable and get all results not just one row Programming Web Development by Chris_103 To retrieve all records associated with the current user, you can use the fetchAll() method instead of fetch(). Here's how you can modify your code: ```php // Query database to retrieve records associated with the user $sql = "SELECT * FROM table_name WHERE variable_name = :variable_name"; $stmt = $conn->prepare($sql); $stmt->… Mariadb10.11.6 Glarea single failed node startup stuck failure Programming Databases by mx_983 Basic background information Mariadb Ver 15.1 District 10.11.6 MariaDB Glarea cluster, one with three nodes: Node1:192.168.18.78 Node2: 192.168.18.79 Node3: 192.168.18.80 Among them, Node1 node was restarted after a power outage of 1 hour, and after executing the system ctl start mariadb, it was stuck for a long time (running for 6 hours) … Using Natural Language to Query SQL Databases with Python LangChain Module Programming Computer Science by usmanmalik57 The advent of large language models (LLM) has replaced complex scripts with natural language for automating various tasks. You can now use LLM to interact with your databases using natural language, which makes life easier for people who do not have sufficient SQL knowledge. In this article, you will learn how to retrieve information from SQL … Re: How to disable the automatic swipe effect on the product page? Programming Web Development by Dani Hello, Google Search Console is showing that vidceo is not the main content of the page, because I don't see any video on [this page](https://www.kupisi.mk/product/index.php?mainCategory=%D0%B7%D0%B0-%D0%B4%D0%BE%D0%BC%D0%B0&productName=%D1%83%D0%BD%D0%B8%D0%B2%D0%B5%D1%80%D0%B7%D0%B0%D0%BB%D0%BD%D0%BE-%D0%BF%D0%B0%D0%BC%D0%B5%D1%82%D0%BD%D0… Re: Improve HAVING BY performance Programming Databases by Reverend Jim Was it worth all that for 50ms? Re: Improve HAVING BY performance Programming Databases by Dani In exchange for less than a day's worth of work? Of course!!!!! I've spent a *lot* longer to shave off a *lot* less. https://www.conductor.com/academy/page-speed-resources/faq/amazon-page-speed-study/ Re: Improve HAVING BY performance Programming Databases by Dani Now as far as whether going down that rabbit hole that day was worth the cost of losing AndreRet, then I'd have to give a resounding no. Re: Improve HAVING BY performance Programming Databases by Reverend Jim I have to admit that 95% of my work from 1995 to 2008 was back end stuff where I didn't have to worry about stuff like that. Digital plumbing and monitoring. The other 5% was single user apps. Not counting the 20% which was pointless meetings. So if you don't mind explaining, I'm curious as to why 50ms would even be noticible. I'm not asking just … Re: Improve HAVING BY performance Programming Databases by Dani I'm too exhausted for an in depth explanation right now but 90% of web development is optimizing for performance. The average DaniWeb page takes anywhere from 80ms up to 250ms to load the HTML (when dealing with low network latency), depending on the type of page, so shaving 50ms off of that is a huge win. Re: Improve HAVING BY performance Programming Databases by Dani Here are some articles that can explain it in greater depth: * https://web.dev/learn/performance/why-speed-matters * https://developer.mozilla.org/en-US/docs/Learn/Performance * https://web.dev/explore/fast The HTML page must be downloaded in its entirety before the web browser can begin loading anything else (CSS, Javascript, images, etc.)… Re: Improve HAVING BY performance Programming Databases by Reverend Jim I suppose I am looking at it in terms of practicality. I suppose there might be several reasons to optimize: 1. It saves resources on the hosting platform 2. It improves the user experience 3. It provides personl satisfaction Point #1 would save you money if the savings were significant. Point #2 would apply if the improvement was … Re: Improve HAVING BY performance Programming Databases by Dani > Point #2 would apply if the improvement was noticible but I doubt anyone could seriously comment, "I think this page rendered 50ms faster than it used to", especially considering all the other things that affect timing, for example, the current loading on my ISP servers, anything else running on my computer or home network, etc. … Re: Improve HAVING BY performance Programming Databases by Dani > I know that in my experience, OR's are very bad for speed you can get away with a few but they can get very bad when they stop the whole query making use of one of the main indexes, you can actually speed it up by moving the or's into the HAVING usually. Thank you for that tip! I never thought of that, but it totally makes sense!! > … Re: Improve HAVING BY performance Programming Databases by toneewa Correct. It wasn't about displaying the results, but to measure the different clauses. I'm not impressed by only 95 INSERTs/sec, and a maximum write speed of 175 KB/s for importing data. Increasing to 50K shows WHERE to be faster. 50K: WHERE Query execution time: 0.0599129 seconds HAVING Query execution time: 0.0621748 … Re: Improve HAVING BY performance Programming Databases by Dani I think you might be missing my point. If you’re fetching different data, there’s no way of saying whether where or having is faster. You would need to write queries that use each, but retrieve the same data, to see which is faster for a use case. Even then, it totally depends on the data in the database itself. The same query can be fast for some … Re: How to query database using variable and get all results not just one row Programming Web Development by Biiim logically, it would be because `WHERE variable_name = :variable_name` matches 1 row in your table maybe try a `var_dump(str_replace(':variable_name',"'some_value'",$sql));var_dump($records);`? run the sql on whichever way you use to access your DB directly I don't use PDO so i'm not too familiar on how it returns results, either … Re: Mariadb10.11.6 Glarea single failed node startup stuck failure Programming Databases by rproffitt From https://stackoverflow.com/questions/78269177/mariadb10-11-6-galera-single-failed-node-startup-stuck-failure where they call it out as a bug waiting for a fix. Re: Mariadb10.11.6 Glarea single failed node startup stuck failure Programming Databases by rproffitt The problem is still unresolved. Until the bug is fixed. Be sure to tell all that you don't accept this as a bug and want a fix now. Re: Mariadb10.11.6 Glarea single failed node startup stuck failure Programming Databases by rproffitt I wonder if the last other stable releases show this issue? "Stable release: 11.3.2 / 16 February 2024; 46 days ago" or the most recent release of MariaDB 10.11: MariaDB 10.11.7 Stable (GA) That is, many fixes don't get released for out of date versions. The new version is how many fixes are issued. Re: Mariadb10.11.6 Glarea single failed node startup stuck failure Programming Databases by toneewa I wonder how these IP addresses are issued. Static, dynamic, or is DHCP on? It reminds me of the time a network printer that stopped working, after the power went out. Other devices connected to the network after it's setup. Then, after rebooting, it got a different IP, but the host still thought it was on the old one. I've seen the same thing when…