programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

calabast, in I'll just be a quick 3h

Somebody tell this dude about views.

hddsx,

So my work is archaic and doesn’t even use SQL. What are views?

Restaldt, (edited )

Predefined queries that you can interact with like another table more or less

calabast, (edited )

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”

doctordevice, (edited )

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.

dan, (edited )
@dan@upvote.au avatar

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.

Gallardo994,

If they existed for tons of random usecases. When was the last time you created views for “just in case someone asks” situations?

NoneYa, in I'll just be a quick 3h

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.

dan,
@dan@upvote.au avatar

Especially sick of the users who ask for the same data over and over again.

Use something like Apache Airflow to automate it :)

pomodoro_longbreak,
@pomodoro_longbreak@sh.itjust.works avatar

If it’s regular, I recommend cron + mailutils. Have the cron job call a script with a variable sleep in it if you want to make it look more manual.

Winged_Hussar, in I'll just be a quick 3h
@Winged_Hussar@lemmy.world avatar

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.

db2,

“Just email it to me!”

perviouslyiner,

Newspaper: Hackers are announcing a trove of personal data leaked from [company] after a forwarded spreadsheet inadvertently contained more data than the sender realised.

ApexHunter, in It's that time of the year again!

I can’t be the only one disappointed by the lack of an order by clause after being told the list was being sorted (twice!)…

fosforus, (edited ) in I'll just be a quick 3h

Dump all your data in a data lake, throw a thousand GPUs in there too, and you’ll have your answer in 2 hours max.

CowsLookLikeMaps,

Thanks, I’ll tell the client it’ll be ready in 2h.

cypherix93,

Mr. Manager calling from a group

Hi everyone, I know we’re all busy, but I just wanted to align on this 2 hr estimate. Can we put our heads together and do this faster somehow?

fosforus,

Two thousand GPUs

Anticorp, (edited )

No, but since we wasted an hour talking about it, the estimate is now 3 hours. Do you want to have more meetings about it?

tsonfeir, in It's that time of the year again!
@tsonfeir@lemm.ee avatar

I started this in my head sounding like the singer from Cake.

cupcakezealot, in It's that time of the year again!
@cupcakezealot@lemmy.blahaj.zone avatar

dammit bobby tables is on the naughty list again

SHBI7368, in It's that time of the year again!

Love it keep em coming

mariusafa, in every damn time ...

What is that?

Boxman753,

Something that appears in Visual Studio Code, and i assume that in Visual Studio as well.

mindbleach, in Need a rust version too.

You have Perl.

%_=~aj/dy/hfiw8i/g;
$_/a(h0w8)y@;
FWA/E.*FW[tu29uy]/;
%(1)hjc/f4ifh38/y;

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.

merc, in what's the difference?

A key difference:

If you rely too much on PornHub, you’re never going to get fucked.

If you rely too much on GitHub, you’re eventually going to get fucked.

WindowsEnjoyer, in what's the difference?

In Lemmy people are not aware that GitHub is not just git server with lots of code. :)

fruitycoder, in Need a rust version too.

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?

z3rOR0ne, in every damn time ...
@z3rOR0ne@lemmy.ml avatar

What is this, a VSCode message? I use NeoVim on Linux and can only vaguely recall such a message from a time long ago…in a galaxy far far away…

agent_flounder,
@agent_flounder@lemmy.world avatar

Yeah vscode.

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)

Dhs92,

I believe neovim is just a fork of vim that’s still updated and has support for more modern features.

9point6,

FWIW I think vim is also still updated, there was a release this year I believe

emptiestplace,

and then Bram died :(

9point6,

oh… oh shit. That had somehow slipped my mind

:(

emptiestplace,

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.

z3rOR0ne,
@z3rOR0ne@lemmy.ml avatar

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.

1984, (edited )
@1984@lemmy.today avatar

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.

www.lazyvim.org

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.

backhdlp,
@backhdlp@lemmy.blahaj.zone avatar

Average Neovim user (I use Neovim btw)

Tsubodai,

Neovim extension for vscode. Love it.

open_world, in every damn time ...
@open_world@lemmy.world avatar

I feel like this popup shows up too often

technojamin,

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.

Tsubodai,

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!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • programmer_humor@programming.dev
  • localhost
  • All magazines
  • Loading…
    Loading the web debug toolbar…
    Attempt #