Hello, I’ve just come onto this project and I seem to have encountered an error. I have reloaded my browser, even shut down and restart my PC, unfortunately there seems to be an issue with the Codecademy Server.
I keep getting this error message whenever I try and run the terminal. No matter if I have a blank editor or full of SELECT *s.
cp: cannot create regular file ‘setup.sql’: Disk quota exceeded
I’m guessing that there’s a problem with Codecademy server side struggling with an overloaded sandbox.
Not an issue on my end. It’s the lesson itself hanging. As for the lesson it was Book Store Indexes PostgreSQL Project. If you try to save any work the page hangs. It does not do that for me on any page here on this site. I have no browsing issues at all on my browser. I just moved on because this is obviously broken and not maintained(which is a shame because people spend money on this to work).
Quick question here, with the questions 3-5 regarding the partial index. Was it meant to decrease the query time significantly? Mine doesn’t seem to do so.
Here is the code I used to do the index as well as the query:
explain analyze select customers.customer_id, orders.quantity
from customers
join orders
on customers.customer_id = orders.customer_id
where quantity > 18;
create index order_quantity_idx on
orders(quantity)
where quantity > 18;
explain analyze select customers.customer_id, orders.quantity
from customers
join orders
on customers.customer_id = orders.customer_id
where quantity > 18;
(I know that the SQL needs to be capitalized, but for the sake of efficiency I don’t bother)
and these are the planning and execution times for pre and post indexing respectively:
Planning time: 4.432 ms
Execution time: 92.872 ms
—
Planning time: 0.178 ms
Execution time: 77.399 ms
So I’m assuming that my queries were correct? Also, aren’t your query times MUCH better than mine - is the difference in query times due to server latency?
Yes, you are correct. (I must have been partially asleep when I read the numbers.)
I’m not sure why there is such a large difference in query times. There’s many other factors that can impact the explain analyze. If another process was querying the table at the same time while you were running your explain analyze, that would have an impact. Yes, it’s possible server latency would impact the query times.
“EXPLAIN ANALYZE doesn’t work on the COPY` call, so we are using a timestamp before and after we load the information into the database. Make a note of the time difference between the two timestamps as they will get erased in the next task.”
I’m writing this code to compare the two timestamps, please who can help in case the aim of step 9 was something different:
EXPLAIN ANALYZE SELECT * FROM orders;
SELECT NOW();
\COPY orders FROM ‘orders_add.txt’ DELIMITER ‘,’ CSV HEADER;
SELECT NOW();
EXPLAIN ANALYZE SELECT * FROM orders;
Hello @b80, can you include a link to the lesson please? I can try to step thru the lesson to help answer your question. I tried the above but it doesn’t reference the lesson.
You won’t be able to use EXPLAIN ANALYZE to check the runtime query for COPY. Use the code exactly as is. It’s show to you get the time for before and after the query to determine how long the COPY will run. The different in the before time and after time is how long the copy took to run.
SELECT NOW(); -- before timestamp
\COPY orders FROM 'orders_add.txt' DELIMITER ',' CSV HEADER;
SELECT NOW(); -- after timestamp
Still getting the “cp: cannot create regular file ‘setup.sql’: Disk quota exceeded” error which doesn’t allow the learner to finish the project. Have tried refreshing the page and resetting the exercise, neither works.
I am getting the same error as mentioned by OP. I think the size of the database must have gotten too large, and the browser IDE can’t load it anymore. Usually, I’d clear out the underlying DB files and stuff, which often aren’t directly affected by the RESET button, but if the IDE doesn’t load, I can’t really do much. I just marked everything as “done” and carried on. Not really my fault if the site isn’t working properly, is it?
EDIT: Please don’t tell me to reload it or try it again. Everything else is working fine. My connection is okay. I’m fairly certain it has something to do with the code under the hood, because I can’t properly reset the code as it is continuously attempting to reload when I hit “reset”. I believe it’s a technical issue and I truly don’t wish to continue wasting time on it. I submitted a bug report on it. I have spent too much time on this and it is not generative, I just want to let anyone else experiencing this to know it is actually going on.