A view is a saved query that pretends it’s a table. It doesn’t actually store any data. So if you need to query 10 different tables, joining them together and filtering the results specific ways, a view would just be that saved query, so instead of “SELECT * FROM (a big mess of tables)” you can do “SELECT * FROM HandyView”
Basically scripts you can run on the fly to pull calculated data. You can (mostly) treat them like tables themselves if you create them on the server.
So if you have repeat requests, you can save the view with maybe some broader parameters and then just SELECT * FROM [View_Schema].[My_View] WHERE [Year] = 2023 or whatever.
It can really slow things down if your views start calling other views in since they’re not actually tables. If you’ve got a view that you find you want to be calling in a lot of other views, you can try to extract as much of it as you can that isn’t updated live into a calculated table that’s updated by a stored procedure. Then set the stored procedure to run at a frequency that best captures the changes (usually daily). It can make a huge difference in runtime at the cost of storage space.
It can really slow things down if your views start calling other views in since they’re not actually tables
They can be in some cases! There’s a type of view called an “indexed” or “materialized” view where the view data is stored on disk like a regular table. It’s automatically recomputed whenever the source tables change. Doesn’t work well for tables that are very frequently updated, though.
Having said that, if you’re doing a lot of data aggregation (especially if it’s a sproc that runs daily), you’d probably want to set up a separate OLAP database so that large analytical queries don’t slow down transactional queries. With open-source technologies, this is usually using Hive and Presto or Spark combined with Apache Airflow.
Also, if you have data that’s usually aggregated by column, then a column-based database like Clickhouse is usually way faster than a regular row-based database. These store data per-column rather than per-row, so aggregating one column across millions or even billions of rows (eg average page load time for all hits ever recorded) is fast.
I hate these requests so fucking much. I’ve learned a lot of SQL because of it but I’m sick of it. Especially sick of the users who ask for the same data over and over again.
One guy asked me to run a report every first of the month and then he wouldn’t respond when I would send it so I stopped sending it. Additionally because he would request it AGAIN later in the month after I already sent it at the beginning of the month.
Guess it’s too much to search your fucking emails before requesting a new report to be run. A report that I’ve told you countless times will slow down everything for everyone else who’s using the system.
But tHis iS uRgENt aSAp to run a report asking for all data for the last 3 years.
And the data they want is the entire FY, is 3,000,000 records and they need every single data attribute making the file like 250 MBs. Then you put it in their SharePoint and they get mad they can’t just view it in the browser despite the giant “This file is too large to view online, download it” message.
Newspaper: Hackers are announcing a trove of personal data leaked from [company] after a forwarded spreadsheet inadvertently contained more data than the sender realised.
The princess is saved, but all you can think about is rescuing another, with an entirely different plan. Which is just as well because you have no fucking idea how to explain the one you just wrote and executed.
You have rust, you decide to rewrite the C plan but the only library that supports it uses unsafe code so you go back and rewrite it. Wait what were you working on?
Today’s stupid question: are vim and neovim not the same thing? I just type vi (ancient habit) and use whatever it is that executes. (I can go search but interacting here is more fun lol)
Yeah, it doesn’t make a lot of sense. People talk about “when Linus dies”, and obviously that will be devastating, but in my mind Bram just was. I wish I’d made a point of meeting him, or at least sending him an email to say thanks. Not for vim specifically, though I will probably use it until my fingers quit working. As with countess others, Bram inspired me to learn about ICCF Holland, and from there I had the privilege of supporting a child in Uganda through school. That’s what I’d want to thank him for. And vim.
Neovim is a fork of Vim. It uses Lua for configuration instead of the original Vim’s VimScript, but still has a lot of interoperability with original Vim plugins and configuration options.
Neovim is better in many ways, and because it has lua support, it’s so much easier to write plugins for it. So there are thousands of plugins right now, and entire neovim distributions that are configured to work like an IDE, like Lazyvim for example.
I’m a huge fan and I have written plugins myself since it’s easy and rewarding.
But on the server, I don’t bother installing neovim. Ordinary vim is fine for simple editing tasks. But if you want a customized experience to replace VS Code on your computer, you want neovim and not vim.
If you have a common folder that you clone projects to (like OP’s ~/coding), then that checkbox lets you trust that whole folder easily when this pop up comes up.
I have a coding folder “repos”. It’s on a remote machine though and I get this every time I connect to my code folder using a new remote host. So annoying!
programmer_humor
Active
This magazine is from a federated server and may be incomplete. Browse more on the original instance.