SQL Server – Do varchar (max), nvarchar (max), and varbinary (max) columns affect selected queries?

Consider this table:

create table books
Id bigint non null primary key identity (1, 1),
UniqueToken varchar (100) not null,
    [Text] nvarchar (max) non-null

Imagine that we have more than 100,000 books in this table.

We now have 10,000 books of data to put in this table, some of which are in duplicate. We must first filter the duplicates, then insert new books.

One way to check for duplicates is:

select UniqueToken
of books
where UniqueToken in
& # 39; first single token & # 39 ;,
& # 39; second single token & # 39;
- 10,000 articles here

Does the existence of Text column affects the performance of this query? If so, how can we optimize it?

I have the same structure, for other data. And it's not going well. A friend told me that I should divide my table into two tables as follows:

create a table BookUniqueTokens
Id bigint non null primary key identity (1, 1),
UniqueToken varchar (100)

create table books
Id bigint non null primary key,
    [Text] nvarchar (max)

And I have to do my duplicate search algorithm on the first table only, and then insert data into both. In this way, he claimed that the performances were much better because the tables were physically separate. He claimed that [Text] column affects everything to select query on the UniqueToken column.

how to calculate the sum of the selected entries of a column in Magento 2

I want to calculate the sum of all total_achat values โ€‹โ€‹of which ref_by the value is 1. The name of the table is table name. Anyone can help me please.

I want a SQL query that will return total (200 + 97 + 140)

enter the description of the image here

google sheets – If a drop-down list is selected, how can I add it to another column and then collect the sums?

So I have a drop down menu in Col. K with "Apples, oranges, grapes, cherries".

If a child wants to order a specific fruit, I want it to automatically fill the Col N section in green, then add up the total amount needed to order in Col O.

My expected values โ€‹โ€‹are at the bottom right … How can I accomplish this dark magic?

enter the description of the image here

javascript – Add selected items

function loadItens () {
$ .getJSON ("https://api.myjson.com/bins/10hz22", function (data) {
items = date;
$ .each (data, function (key, val) {
$ ("# select-iten") append ("");

loadItens ();

var articles;

$ ("# add-iten"). click (function () {
var if = $ ("# select-iten"). val ();
$ (".items") append (""+
""+ articles[si].id + ""+
""+ articles[si].nome + ""+
""+ toReal (articles[si].preco) + ""+
computeTotal ();

$ (document) .on ("click", ".iten-delete", function () {
$ (this) .parents ("tr"). remove ();
computeTotal ();

function calculaTotal () {
total var = 0;
if ($. "iten-price"). length> 0) {
$ (".name-price") each (function () {
total + = $ (this) .text ();
$ (# Budget-total).

toReal function (str) {
str = parseFloat (str) .toLocaleString (pt-br, {minimumFractionDigits: 2});
return str;

# Name Price from Top movies |

views – Drupal 8 facet: the result should return a value greater than or equal to the selected facet

Here is the scenario. I've created a facet that lists all GPAs (these are decimal numbers). for example. 2.0, 2.5, 3, 3.5 etc.

What I wanted was when a user chooses 2.5 GPAs in the facet, the content returned must be content with GPA equal to or greater than 2.5.

I've tried to understand this by using single views, but I can not make it work. If this can be done with simple views, can you please suggest what to do? Or do you think it can only be done by code?

html – Complicated AJAX update with two selected elements

I have a form with two selection items where users can select a product variant (for example a red, green or blue shirt) and quantity.

When changing the variant / quantity, I make an AJAX request to get the price.

The complicated part is the following: each variation has its own price and its own quantities. For example, red shirts cost 10 USD and a minimum amount of 5 (10, 15 …). Green shirts cost 15 USD, but the quantity starts at 3 (6, 9 …).

(Color / shirt just an example, the real products are control units for street lights ๐Ÿ™‚

The problem is that when the default values โ€‹โ€‹are "red" and "5" and I change to "green", the price is $ 75 (the AJAX request was green + 5). But green only has quantities of 3, 6, 9, and so on.

I could return the minimum quantity from my AJAX request, but the user will not be able to update the price when changing the selected quantity.

The only solution I see is to create two doSubmit () and two submitAjax () functions. But that would mean that I have a lot of duplicate code.



// Variation of product, drop-down list of quantity selection
var product_selection = document.querySelector (# product_selection & # 39;)
var product_variation = document.querySelector (# product_variation & # 39;);
var product_quantity = document.querySelector (# product_quantity & # 39;)

// event listener to submit the form during a change
product_selection.addEventListener (& # 39; submit & # 39; submitAjax);
product_variable.addEventListener (& # 39; change & # 39 ;, doSubmit);
product_quantity.addEventListener (& # 39; change & # 39 ;, doSubmit);

// Submit the form
doSubmit function (event) {
product_selection.dispatchEvent (new event (& # 39;)); // product_selection.submit ();

// Manage ajax submit
submitAjax function (event) {

// Stop sending the default form
event.preventDefault ();

// asks Ajax
$ .ajax ({
url: & # 39; /static/public/ajax/get_product_data.php&#39 ;,
type: "POST",
data: $ (# product_selection). serialize (),
success: function (result) {
if (result == 0) {
alert ('sorry');
} other {
setProductData (result);
error: function (jqxhr, status, exception) {
alert ('sorry');

// Update product details
function setProductData (result) {
$ (# Product_price & # 39;). html (result.price_gross);

// Delete current quantity options
var product_quantity = document.getElementById ("product_quantity");
for (i = product_quantity.options.length - 1; i> = 0; i--) {
product_quantity.remove (i);
// ... reapply new quantity options
var c = 0;
for (var i = result.minimum; i <= result.maximum; i + = result.graduation) {
product_quantity.options[c] = new option (i + & # 39; + pwjs.product.unit, i);
if (result.product_quantity == i) {
var setselectedIndex = c;
c ++;
// product_quantity.selectedIndex = setselectedIndex;

is it possible to define the checkbox selected by default for the selected product categories

for some specific requirements, I want certain product categories to be selected by default,
How can I get there?

drupal trade – From a price resolver, how to access the selected attributes of the current product?

I write a price resolver for drupal trade 2 (on drupal 8). To get the price I want, I will have to retrieve information in a field that has been placed on the selected attribute (s). More specifically, I've added a price field to some attributes that I want to add.

Now, the entities $ entity and $ context do not seem to contain information about the selected attributes. How can I access these attributes?

How to make the configurable product currently selectively selected on the display page?

I need to change the name, price, SKU and more when the user clicks on the options. I therefore need the product ID of the option selected in the product's viewing page.
I have a custom phtml file to write my own change in the product display page. How to get productId in this file by clicking on the options.

security – Why has the basic XK noise model been selected in the Lightning Network transport layer (BOLT 08)?

I am reviewing the Lightning Network Protocol Transport Layer. It is based on the [noise protocol framework] handshake models1.

What I do not understand: why was the basic schema XK selected?

  <- s
  -> e, es 0 2
  <- e, ee                  2                1
  -> s, se 2 5
<- 2 5

First of all, why not KK? The nodes are announced via gossip and on my TCP socket, I should see who is connected to me, able to search for the static key of my peer. Was the reason for it that the lightning knots could be private and in particular on tor?

Second, why not use static keyless protocols? The reason we wanted to have properties 2 and 5 for the initiator and the recipient, respectively?

Property 2:

Sender Authentication Resistant to Impersonation by Key Compromise (KCI) . Sender authentication is based on an ephemeral-static DH ("es" or "se") between the static key pair of the sender and the ephemeral key pair of the recipient. Assuming that the corresponding private keys are secure, this authentication can not be forged.

Property 5:

Encryption to a known recipient, important transmission secret. This charge is encrypted based on an ephemeral-ephemeral DH as well as an ephemeral-static DH with the recipient's static key pair. Assuming ephemeral private keys are secure and the recipient is not actively imitated by an attacker who has stolen his static private key, this payload can not be decrypted.

It's as if I'd given the answer by quoting the page from the noise protocol framework. But maybe I'm wrong, so it would be great to have your ideas.